一.常規操作步驟
1. 手機要有root權限 2. 下載tcpdump http://www.strazzere.com/android/tcpdump 3. adb push c:\wherever_you_put\tcpdump /data/local/tcpdump 如果這一步真機無法push,可以用adb push c:\where_you_put\tcpdump /sdcard,即先將文件存入不需要權限的文件夾中,這里用sdcard,然后在傳到/data/local/tcpdump。 4. adb shell chmod 6755 /data/local/tcpdump 5, adb shell,
6. su獲得root權限
7, cd /data/local
8, ./tcpdump -i any -p -s 0 -w /sdcard/capture.pcap
注意:可以直接進入adb shell,通過tcpdum命令看看是否已經存在tcpdump,已存在的就不需要在下載傳到手機了
命令參數:
# "-i any": listen on any network interface # "-p": disable promiscuous mode (doesn't work anyway) # "-s 0": capture the entire packet # "-w": write packets to a file (rather than printing to stdout) ... do whatever you want to capture, then ^C to stop it ...
下載tcpdump文件到電腦
adb pull /sdcard/capture.pcap capture.pcap #抓到的包導出到電腦,利用wireshark進行協助
然后用wireshark打開即可看到數據包的詳細信息