惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Forbes - Security
Forbes - Security
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
P
Palo Alto Networks Blog
Martin Fowler
Martin Fowler
T
Threatpost
D
Docker
S
Schneier on Security
M
MIT News - Artificial intelligence
G
Google Developers Blog
L
LINUX DO - 热门话题
J
Java Code Geeks
月光博客
月光博客
博客园 - 三生石上(FineUI控件)
IT之家
IT之家
博客园 - Franky
C
Cyber Attacks, Cyber Crime and Cyber Security
K
Kaspersky official blog
Google DeepMind News
Google DeepMind News
N
News and Events Feed by Topic
V
Vulnerabilities – Threatpost
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
人人都是产品经理
人人都是产品经理
Spread Privacy
Spread Privacy
T
Tailwind CSS Blog
爱范儿
爱范儿
阮一峰的网络日志
阮一峰的网络日志
U
Unit 42
C
CERT Recently Published Vulnerability Notes
The GitHub Blog
The GitHub Blog
Simon Willison's Weblog
Simon Willison's Weblog
NISL@THU
NISL@THU
MongoDB | Blog
MongoDB | Blog
Application and Cybersecurity Blog
Application and Cybersecurity Blog
H
Heimdal Security Blog
Recorded Future
Recorded Future
云风的 BLOG
云风的 BLOG
SecWiki News
SecWiki News
P
Privacy International News Feed
P
Proofpoint News Feed
O
OpenAI News
B
Blog
腾讯CDC
F
Full Disclosure
Apple Machine Learning Research
Apple Machine Learning Research
T
Tor Project blog
H
Hacker News: Front Page
Project Zero
Project Zero
Hugging Face - Blog
Hugging Face - Blog
C
Cisco Blogs
S
Security Affairs

博客园 - xin36933

浅析android OCR文字识别 Android中使用代码截图的各种方法总结 Android 开机自动启动服务 SqlServer表死锁的解决方法 数据库 的事务日志已满。若要查明无法重用日志中的空间的原因,请参阅 sys.databases 中的 log_reuse_wait_desc 列。 修改Android工程版本 android利用剪切板来实现数据的传递 ANDROID开发之SQLite详解 浅析SQLite数据库开发常用管理工具 android DDMS 连接真机(己ROOT),用file explore看不到data/data文件夹的解决办法 Android手机获取手机唯一识别号(转) android 程序时时获取logcat信息 Android adb shell启动应用程序的方法 android打电话、发短信实现 Android全局变量的定义与使用 安卓4.0/4.1/4.2手机怎么打开USB调试模式 Android中的DDMS进行调试 Runtime.getRuntime().exec执行阻塞问题解决 GC_EXTERNAL_ALLOC freed 与 GC_EXPLICIT freed 是什么?
Android通过tcpdump抓包
xin36933 · 2014-06-23 · via 博客园 - xin36933

1. 手机要有root权限

2. 下载tcpdump   http://www.strazzere.com/android/tcpdump

3.tcpdumptcpdump

4. adb shell chmod 6755 /data/local/tcpdump

5, adb shell,   su获得root权限

6, cd /data/local

7, ./tcpdump -i any -p -s 0 -w /sdcard/capture.pcap

命令参数:

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

8,  adb pull /sdcard/capture.pcap d:/

9,  在电脑上用wireshark打开capture.pcap即可分析log

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):  

adb shell tcpdump -n -s 0   

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

只监听http  

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

根据以上的信息,写一个bat去执行(tcpdump文件必须在当前目录里)。

开始tcpdump 

adb push tcpdump /data/local/tcpdump

adb shell chmod 6755 /data/local/tcpdump

adb shell rm -r /sdcard/capture.pcap

adb shell  /data/local/tcpdump -i any -p -s 0 -w /sdcard/capture.pcap

pause

下载tcpdump文件到电脑 

 adb pull /sdcard/capture.pcap capture.pcap 

 问题:有些机器root后通过adb shell 后,默认不是root用户,需要输入 su才能切换到root,这样在执行批处理会有问题,解决方法如下

adb shell "su -c 'sleep 1'"

adb start-server

adb push tcpdump /data/local/tcpdump 

 因没有root权限导致的问题

adb shell su -c "/data/local/tmp/tcpdump -i any -p -s 0 -w /sdcard/netCapture.pcap"