原文链接: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. jquery客户端验证插件

    http://www.cnblogs.com/masing/articles/2157420.html http://www.oschina.net/p/jquery+formvalidator ht ...

  2. django学习<一>:安装

    这两天打算摸索下和python相关的东西,然后正好小伙伴有个关于网站的任务,就怀着好奇的心态了解了下,然后就很自然地开始涉及django的问题. 首先就是django安装的问题,想不到第一步就出问题了 ...

  3. IEnumerable 和 IEnumerator

    IEnumerable 接口只包含一个抽象的方法 GetEnumerator(),它返回一个可用于循环访问集合的 IEnumerator 对象,IEnumerator 对象是一个集合访问器. 需要给自 ...

  4. JavaScript模板引擎实现数据交互

    经过1年的磨练,近期终于稍微明白到,前端是怎么做到企业要求的:数据交互. 1,ajax+json这个是必须学的,但没问题,我们可以通过这个博客来慢慢了解怎么回事? 2,可以通过JS框架和JS模板来实现 ...

  5. Sql导出数据报错-->SQL Server 阻止了对组件 'Ad Hoc Distributed Queries' 的 STATEMENT'OpenRowset/OpenDatasource' 的访问

    SQL Server 阻止了对组件 'Ad Hoc Distributed Queries' 的 STATEMENT'OpenRowset/OpenDatasource' 的访问,因为此组件已作为此服 ...

  6. iOS9 Universal Link实现

    先来贴几个比较全面的帖子,看完就差不多了. 1   iOS 9 通用链接(Universal Links) 帖子注意项非常重要,仔细阅读. 自己补充几点: 1 服务器上配置的json文件apple-a ...

  7. RelativeLayout布局

    RelativeLayout用到的一些重要的属性: 第一类:属性值为true或falseandroid:layout_centerHrizontal 水平居中android:layout_center ...

  8. Mac OS 中的 Python(和 NumPy)开发环境设置

    http://www.python()tab.com/html/2013/pythonjichu_1010/582.html ()需要删除

  9. 【C语言入门教程】3.4 循环控制语句

    循环结构又称重复结构,是程序的 种基本结构之一.它反复执行循环体内的代码,解决需要大量重复处理的问题.循环结构由循环控制语句实现,其中内建有条件控制语句,用来判读是否继续执行循环操作.C 语言提供了  ...

  10. 关于css3的动画总结

    旋转:transform:rotate(xxdeg)扭曲:transform:skey(x,y)缩放:transform:scale(x,y)变形位移:transform:translate(x,y) ...