Mac利用wireshark和tcpdump做移动端协议测试

上一篇 / 下一篇  2016-11-08 20:26:01 / 个人分类:协议测试

Mac利用wiresharktcpdump移动端协议测试

原理:利用adb下的tcpdump进行抓包

步骤:

1.   手机要有root权限

2.   下载tcpdump文件

3.   利用adb命令将tcpdump文件push到手机的data文件夹中

adb push /Users/shenglu/Downloads/tcpdump /data/local/tmp

4.   adb root

5.   adb shell

6.   cd /data/local/tmp

7.   chmod 777 tcpdump   //67是为了让tcpdump可读可写可执行

8.   exit

9.   adb shell

10.        su –c’/data/local/tmp/tcpdump –p –vv –s 0 –w /sdcard/capture.pcap –s1600’

11.        adb pull /sdcard/capture.pcap .  //下载tcpdump文件到电脑最后有个点,表示将capture.pcap文件保存到当前路径        

12.        利用wireshark打开capture.pcap文件进行分析

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 ...

如果只监听http,可以加上端口号:adb shell tcpdump -X -n -s 0 port 80

详细的tcpdump命令见博客:http://blog.chinaunix.net/uid-11242066-id-4084382.html


TAG: TCPDump tcpdump wireshark

 

评分:0

我来说两句

日历

« 2024-04-06  
 123456
78910111213
14151617181920
21222324252627
282930    

数据统计

  • 访问量: 33158
  • 日志数: 12
  • 建立时间: 2016-04-06
  • 更新时间: 2016-11-08

RSS订阅

Open Toolbar