android中使用tcpdump攔截分析網絡數據包


1、下載tcpdump
http://pan.baidu.com/s/1c0vkU2k

2、通過adb命令上傳到手機里
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、運行要截包的app,完成對應操作后,CTRL + C 終止,然后通過下面命令取出命令:
adb pull /sdcard/capture.pcap

5、通過wireshark打開capture.pcap文件,查看對應的數據,如下圖:

 

轉自:http://www.yinqisen.cn/blog-470.html

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM