如何在adb shell中跟踪路由?
我有一个 root 设备,我在 adb shell 中输入“su”,然后尝试跟踪路由。 它说“traceroute:未找到”。 我在任何 bin 文件夹中都找不到 Traceroute。
感谢您的任何提示。
I have a rooted device, I type "su" in adb shell, then I try to traceroute.
It says "traceroute: not found".
I can't find traceroute in any bin folders.
Thanks for any hints.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
标准 Android 发行版不提供 Traceroute。您可能想尝试在设备上安装 BusyBox: http://www.ihackintosh.com/2009/12/how-to-install-busybox-on-a-rooted-device/
它包含许多在 UNIX 系统上可用的有用工具,并且也适用于Android。可以在这里下载:http://www.busybox.net/
Traceroute is not avaiable with standard Android distribution. You may want to try installing BusyBox on your device: http://www.ihackintosh.com/2009/12/how-to-install-busybox-on-a-rooted-device/
It contains many useful tools that are avaiable on UNIX systems and are also working for Android. It can be downloaded here: http://www.busybox.net/
安装 busybox 后运行以下命令:
就像我已经在
/system/xbin
文件夹中安装了 busybox 那么命令是After installing busybox run the following command:
like i have installed the busybox in
/system/xbin
folder then command is了解
traceroute
可能会有所帮助:它只是将数据包发送到您想要的目的地并增加生存时间 (ttl) 字段。如果 ttl 为零,每个路由器(跳)都会向发送者返回一个数据包。通过这种机制,您可以跟踪数据包通过网络的路线。
知道这一点后,您可以简单地 ping 目的地并手动增加 ttl 字段。 iE(在 adb shell 上,无需 root):
输出可能如下所示:
现在您可以看到沿途每一跳的 ips 地址。当您到达目的地时,您可以停止增加 ttl。
如果您愿意,可以将其包装到脚本中(非常基本的示例):
Understanding
traceroute
could be helpful:It simply sends packets to your desired destination and increases the time-to-live (ttl) field. Every router (hop) will return a packet to the sender if the ttl is zero. With this mecanism you are able to trace the route of your packet through the network.
Knowing this, you could simply ping your destination an manually increase the ttl field. i.E (on adb shell, no root required):
the output could look like this:
Now you can see the ips adresses of every hop in your way. You may stop increasing the ttl when you have reached the destination.
If you like you could wrap it into a skript (very basic sample):