Use tcpdump in android to intercept and analyze network packets

1. Download tcpdump
http://pan.baidu.com/s/1c0vkU2k

2. Upload to the phone via adb command
adb push tcpdump /system/bin

3、adb shell tcpdump -p -vv -s 0 -w /sdcard/capture.pcap

1
2
3
4
5
6
7
8
9
#tcpdump 用法:
 
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)
# ... do whatever you want to capture, then ^C to stop it …

4. Run the app to capture the package, after completing the corresponding operation, CTRL + C to terminate, and then extract the command through the following command:
adb pull /sdcard/capture.pcap

5. Open the capture.pcap file through wireshark to view the corresponding data, as shown below:

 

Reprinted from: http://www.yinqisen.cn/blog-470.html

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326553495&siteId=291194637