原文链接:http://mysuperbaby.iteye.com/blog/902201

Android利用tcpdump抓包

博客分类:

Instructions 
http://source.android.com/porting/tcpdump.html 
Source Code and Documents 
http://www.tcpdump.org/ 
Compiled Binary Download 
http://www.strazzere.com/android/tcpdump 
数据包分析工具Wireshark 
http://www.wireshark.org/download.html


Installing tcpdump
 
Pushing the binary to an existing device 
Download tcpdump from http://www.tcpdump.org/, then execute:

  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:

  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. ... do whatever you want to capture, then ^C to stop it ...
  7. adb pull /sdcard/capture.pcap .
  8. sudo apt-get install wireshark  # or ethereal, if you're still on dapper
  9. wireshark capture.pcap          # or ethereal
  10. ... 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):

  1. adb shell tcpdump -n -s 0

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

  1. adb shell tcpdump -X -n -s 0 port 80

[转] Android利用tcpdump抓包的更多相关文章

  1. Android利用tcpdump抓包,用wireshark分析包。

    1.前言 主要介绍在android手机上如何利用tcpdump抓包,用wireshark分析包. android tcpdump官网: http://www.androidtcpdump.com/ t ...

  2. Android手机tcpdump抓包

    在开发过程中遇到问题时,无法非常方便的获取到数据包,导致分析解决问题比较麻烦.这里介绍如何在Android手机上实现tcpdump抓包.   1.root机器  在用tcpdump抓包过程中,需要使用 ...

  3. linux下利用tcpdump抓包工具排查nginx获取客户端真实IP实例

    一.nginx后端负载服务器的API在获取客户端IP时始终只能获取nginx的代理服务器IP,排查nginx配置如下 upstream sms-resp { server ; server ; } s ...

  4. android下tcpdump抓包

    tcpdump是最快捷方便的抓包方式,还可以加深对网络协议的理解.android下可以通过如下方式抓包: 1 Android上启动tcpdump Android设备可以把tcpdump的可执行文件上传 ...

  5. Android通过tcpdump抓包(wifi, 2g, 3g都可以)

    http://blog.csdn.net/deng529828/article/details/20646197 1. 手机要有root权限 2. 下载tcpdump   http://www.str ...

  6. Android使用tcpdump抓包

    AllJoyn中有个问题:Server切换到Client后,重新加入其他Server时join session会失败,原因是timeout(join session是异步的,在指定时间内没有收到回应) ...

  7. 利用tcpdump抓包工具监控TCP连接的三次握手和断开连接的四次挥手

    TCP传输控制协议是面向连接的可靠的传输层协议,在进行数据传输之前,需要在传输数据的两端(客户端和服务器端)创建一个连接,这个连接由一对插口地址唯一标识,即是在IP报文首部的源IP地址.目的IP地址, ...

  8. Android通过tcpdump抓包

    1. 手机要有root权限 2. 下载tcpdump   http://www.strazzere.com/android/tcpdump 3. adb push c:\wherever_you_pu ...

  9. 转:android root tcpdump抓包强烈推荐

    转:http://www.cnblogs.com/findyou/p/3491035.html 写的相当详细且完整,业界良心. adb push d:\tcpdump /data/local/ adb ...

随机推荐

  1. border边框的宽度/样式/颜色 全部值

    border 用emmet写border的时候, 缩写是:bd. 不是b, 也不是bdr: b会扩展成bottom, bdr 会扩展成 border-right, border的宽度: 1px 基本上 ...

  2. WCF绑定类型选择

    WCF绑定类型选择   发布日期:2010年12月10日星期五 作者:EricHu   在开发WCF程序时,如何选择一个适合的绑定对于消息传输的可靠性,传输模式是否跨进程.主机.网络,传输模式的支持. ...

  3. AngularJS API之toJson 对象转为JSON

    toJson()能把对象序列化为json 方法讲解 这个方法最多支持2个参数: angular.toJson(obj, pretty); obj 是想要转换的对象, pretty 可以调节格式化的样式 ...

  4. tc 147 2 PeopleCircle(再见约瑟夫环)

    SRM 147 2 600PeopleCircle Problem Statement There are numMales males and numFemales females arranged ...

  5. 1455.Solitaire(bfs状态混摇)

    Solitaire Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total ...

  6. 使用 IntelliJ IDEA 导入 Spark源码及编译 Spark 源代码

    1. 准备工作 首先你的系统中需要安装了 JDK 1.6+,并且安装了 Scala.之后下载最新版的 IntelliJ IDEA 后,首先安装(第一次打开会推荐你安装)Scala 插件,相关方法就不多 ...

  7. jekyll 安装过程

    如果有, linux以源码包方式发布, 方便,快捷, 容易出错,安装内容难找到,版本容易冲突.兼容性会出错.如何解决这种方式:1.上网查找答案,你遇到的别人也有,关键词匹配到,好像没有别的办法解决了, ...

  8. Android文本读写

    //写文件操作   public void writeFileData(String fileName, String message){        try{            FileOut ...

  9. [POJ1068]Parencodings

    [POJ1068]Parencodings 试题描述 Let S = s1 s2...s2n be a well-formed string of parentheses. S can be enco ...

  10. 2016年10月31日--网页 Windows对象操作

    Window.opener:打开当前窗口的源窗口,如果当前窗口是首次启动浏览器打开的,则opener是null. Window.open(URL,name,features,replace):open ...