博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
android 抓包 tcpdump
阅读量:7088 次
发布时间:2019-06-28

本文共 1825 字,大约阅读时间需要 6 分钟。

引用:

 

Instructions 
Source Code and Documents 
 
Compiled Binary Download 
数据包分析工具Wireshark 
Installing tcpdump 
Pushing the binary to an existing device
 
Download tcpdump from , then execute:

Cmd代码   
  1. adb root   
  2. adb remount   
  3. adb push /wherever/you/put/tcpdump /system/xbin/tcpdump   
  4. adb shell chmod 6755 /data/local/tmp/tcpdump  

Running tcpdump 
You need to have root access on your device. 
Batch mode capture 
The typical procedure is to capture packets to a file and then examine the file on the desktop, as illustrated below:

Cmd代码   
  1. adb shell tcpdump -i any -p -s 0 -w /sdcard/capture.pcap   
  2. "-i any": listen on any network interface   
  3. "-p": disable promiscuous mode (doesn't work anyway)   
  4. "-s 0": capture the entire packet   
  5. "-w": write packets to a file (rather than printing to stdout)   
  6.   
  7.    ... do whatever you want to capture, then ^C to stop it ...   
  8.   
  9. adb pull /sdcard/capture.pcap .   
  10. sudo apt-get install wireshark  # or ethereal, if you're still on dapper   
  11. wireshark capture.pcap          # or ethereal   
  12.   
  13.    ... look at your packets and be wise ...  

You can run tcpdump in the background from an interactive shell or from Terminal. By default, tcpdump captures all traffic without filtering. If you prefer, add an expression like port 80 to the tcpdump command line.
Real time packet monitoring 
Execute the following if you would like to watch packets go by rather than capturing them to a file (-n skips DNS lookups. -s 0 captures the entire packet rather than just the header):

Cmd代码   
  1. adb shell tcpdump -n -s 0  

Typical tcpdump options apply. For example, if you want to see HTTP traffic: 

Cmd代码   
    1. adb shell tcpdump -X -n -s 0 port 80  
  1. -----------------------------------------------------------引用:

1.下载tcpdump

下载地址:

参考来源1:
 

另外网上也有提供tcpdump下载的来源2:
但是个下载来用会报systag error,不过以上两个来源写的方法基本是靠谱的;
 
 
2.下载wireshark(分析工具,也可用于win平台抓包)
 
参考官网:
http://www.wireshark.org/download.html

转载地址:http://pvfql.baihongyu.com/

你可能感兴趣的文章
Hadoop集群WordCount运行详解(转)
查看>>
[转]SSM框架——详细整合教程(Spring+SpringMVC+MyBatis)
查看>>
一次性搞清楚equals和hashCode
查看>>
Android Studio IDE的 LogCat如何过滤指定应用的调试信息
查看>>
23个常用正则表达式(数值和字符串)
查看>>
struts2中struts.xml配置文件详解
查看>>
Javascript中的with用法
查看>>
GIS-008-ArcGIS JS API 全图
查看>>
js splice方法
查看>>
Linux--多网卡的7种Bond模式
查看>>
ADO 连接数据库,取到VT_DATE型日期转换成 int型
查看>>
properties 配置文件中值换行的问题
查看>>
Azure 部署 Asp.NET Core Web App
查看>>
Masonry和FDTemplateLayoutCell 结合使用示例Demo
查看>>
linux 切换用户之后变成-bash-x.x$的解决方法
查看>>
用备份控制文件做不完全恢复下的完全恢复(数据文件备份<旧>--新建表空间--控制文件备份<次新>--日志归档文件<新>)...
查看>>
python下RSA加密解密以及跨平台问题
查看>>
详解Java Spring各种依赖注入注解的区别
查看>>
android 区分wifi是5G还是2.4G(转)
查看>>
多个构造器参数使用构建器
查看>>