Android使用tcpdump抓包

首先,需要下载tcpdump

地址:


全部抓包:
adb remount
adb shell
cd data/local
./tcpdump -p -vv -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)
pause(ctrl+C退出抓包)
adb pull /sdcard/capture.pcap


只监听Http的:

adb remount

adb shell tcpdump -X -n -s 0 port 80 
adb push tcpdump /data/local/tcpdump
adb shell chmod 6755 /data/local/tcpdump
adb shell rm -r /sdcard/capture.pcap
adb shell  /data/local/tcpdump -i any -p -s 0 -w /sdcard/capture.pcap
pause(ctrl+C退出抓包)
adb pull /sdcard/capture.pcap



tcpdump下载链接:http://download.csdn.net/detail/singleton1900/5508561

你可能感兴趣的:(Android使用tcpdump抓包)