关于网络抓包工具用到两个:1.tcpdump    2.wireshark

tcpdump下载地址:http://www.tcpdump.org/

选择tcpdump-4.3.0.tar.gz,下载下来的是源代码包,通过编译得到tcpdump文件(如何编译网上资料一箩筐)。

wireshark下载地址:http://www.wireshark.org/download.html

步骤:

将编译得到的tcpdump放到android设备根目录的data/local下面,命令行adb shell------------->su(给予权限)----------------------> exit(退出Shell脚本)

执行adb shell tcpdump -p -vv -s 0 -w /sdcard/tcpdump.txt命令将会抓取网络数据写入到android设备SD卡下的tcpdump.txt文件中

adb shell

su

cd /data/local

./tcpdump -p -vv -s 0 -w /sdcard/tcpdump.txt

打开tcpdump.txt文本文件,可以发现是二进制文件,这时就要用到上面所提到的wireshark工具进行解析该文件。

首先将/sdcard/tcpdump.txt文件通过 adb命令pull到电脑上 adb pull /sdcard/tcpdump.txt c:/   (导出到C盘根目录)

然后直接将tcpdump.txt拖动到打开的wireshark主界面,这样就能很清楚的看到抓取的所有条目的网络数据。

 

完毕。

更多相关文章

  1. 一款常用的 Squid 日志分析工具
  2. GitHub 标星 8K+!一款开源替代 ls 的工具你值得拥有!
  3. RHEL 6 下 DHCP+TFTP+FTP+PXE+Kickstart 实现无人值守安装
  4. Linux 环境下实战 Rsync 备份工具及配置 rsync+inotify 实时同步
  5. Nginx系列教程(六)| 手把手教你搭建 LNMP 架构并部署天空网络电影
  6. android ubuntu9.10 源码的编译 Eclipse工程 Contacts编译 应用
  7. android wifi ralink rt3070开发记录
  8. webrtc的音频处理模块apm( audio processing)下载与编译出libweb
  9. Android(安卓)Studio 的简单配置使用以及各文件用途(一)

随机推荐

  1. android之Notification版本兼容性问题
  2. Android版本28用http请求CLEARTEXT commu
  3. Android——文本类控件
  4. Android requestFeature() must be calle
  5. Android学习笔记_57_ExpandableListView
  6. android > PopupWindow 底部弹出框
  7. Android 页面或文件或网络请求时的加载动
  8. Android应用程序键盘(Keyboard)消息处理机
  9. android 实现沉浸式,状态栏
  10. selinux android property_context作用(待