2011年5月17日 星期二

[Android] tcpdump for Android devices

tcpdump for Android devices

  • tcpdump, a powerful command-line packet analyzer.
How to install on your device?
Unzip tcpdump.rar
// copy to tcpdump to your /system/bin:
1. adb remount 
2. adb push tcpdump /system/bin
3. adb shell chmod 777 /system/bin/tcpdump 

How to run tcpdump on your device?
Run: adb shell tcpdump -i any -w /storage/netlog.cap
Stop: USE Ctrl + C to abort this packet monitor. 
Download log: adb pull /storage/netlog.cap c:\ 
Delete log: adb rm /storage/netlog.cap 

tcpdump parameters
-i :後面接要監聽的網路介面,例如 eth0, lo, ppp0 等等的介面;any表示所有的網路介面
-w :後面接要監聽所得的封包資料儲存的檔名


References

沒有留言:

張貼留言