使用前提:手机已获得root权限
下载tcpdump
使用方法:
1. adb push 电脑路径\tcpdump /data/local/tcpdump
2, adb shell
3, cd /data/local
chmod 777 tcpdump 获得权限
4, 开始抓包:./tcpdump -i any -p -s 0 -w /sdcard/capture.pcap
(命令参数:
# "-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)
)
... 抓包已开始, Ctrl+C 停止抓包...
5, 取出抓包文件:adb pull /sdcard/capture.pcap d:/
6, 在电脑上用wireshark打开capture.pcap即可分析数据