当前位置: 首页>>技术教程>>正文


tracepath和traceroute之间有什么重大区别?

, ,

问题描述

我最近读了一篇关于HowToGeek的文章让我有点头疼。我对Linux的经验相当少,所以请原谅我,如果这是entry-level:

“The tracepath command is similar to traceroute, but it doesn’t require root privileges.”

http://www.howtogeek.com/108511/how-to-work-with-the-network-from-the-linux-terminal-11-commands-you-need-to-know/

traceroute和tracepath如何以不同的方式执行类似的功能?

traceroute做了什么,需要root权限,tracepath没有?

是否有人应该首选traceroute或vice-versa?

最佳解决方法

traceroute和tracepath如何以不同的方式执行类似的功能?

这两个程序基本上都做了一件事:发送和接收某些IP数据包。

您可以使用普通套接字API来执行此操作,也可以操作来自接口的原始数据包。套接字API不需要root权限,因为它非常安全。内置了一些机制来防止一个程序访问另一个程序所做的IP数据包。

Tracepath使用套接字API来实现其所有功能。 Traceroute操作原始包以实现其某些功能。

traceroute做了什么,需要root权限,tracepath没有?

它操纵原始包。

要操作原始数据包,您需要root权限,因为这样做会绕过套接字API的安全机制。您可以使用该界面访问所有其他进程和用户的通信。试想一下,如果病毒可以操纵原始包,病毒可以做什么。

是否有人应该首选traceroute或vice-versa?

One advanced command available in Traceroute is the ability to run a network trace using IPv4 or IPv6 protocol. It is also possible to choose between ICMP, TCP or UDP data formats for a probe. Traceroute can choose specific source routings for the probe and choose what port to send from. It can set limits on the minimum and maximum TTL to accept from an outbound probe. IN addition, Traceroute can show the wait time for response pings as well as set how many packets are send in each probe and how many probes to send. Some of these commands may not be supported by networking hardware along the path, which could terminate the probe before it reaches its target destination.

来源:1 2 3

次佳解决方法

您可以使用traceroute进行高级网络跟踪,您可以选择IPv4和Ipv6协议,也可以选择ICMP,TCP或UDP数据格式进行探测。

因此,traceroute具有比使用UDP数据包进行跟踪的tracepath更高级的选项。

现在关于超级用户权限:

您可以将traceroute与普通用户和超级用户一起使用,这取决于您要使用的选项,下面是一个示例:

networking,traceroute,ubuntu

这里我们使用的UDP数据包不需要超级用户权限

networking,traceroute,ubuntu

这里我们使用需要特权的ICMP echo数据包。

通过ICMP数据包,您可以进行DDOS攻击。

要了解ICMP选项Traceroute Man Page

要在终端man traceroute中查看traceroute选项类型

ICMP需要超级用户权限,以确保只有管理员可以使用它的一些选项,因为它可以用于ping死亡和收集有关特定网络的信息,这里的权限将使超级用户能够使用ICMP更改选项数据包。

你可以看到它,当你试图ping这样的网站,如www.microsoft.com,你的ping甚至会失败,因为微软路由器阻止ICMP_requests。

因此,linux保护系统免受非特权用户的攻击,因此他们无法使用此命令进行攻击。

第三种解决方法

我想你必须阅读这个http://www.ehow.com/list_7526520_differences-between-traceroute-tracepath.html

从以上链接:

TracePath

Tracepath traces a path to a designated network address, reporting on the “time to live” or TTL lag and maximum transmission units (MTU) along the way. This command can be run by any user other with access to the command line prompt.


Traceroute Basics

Traceroute is essentially the same as Tracepath except that by default, it will only give the TTL value. If you want additional data, you must request those variables on the command line. Also, traceroute requires superuser access to run the command on a Linux box, and some advanced data requests may not be supported by all of the routers along the path. In a Windows environment, any user with access to the command line can run Traceroute.

参考资料

本文由Ubuntu问答整理, 博文地址: https://ubuntuqa.com/article/1537.html,未经允许,请勿转载。