[英]How to capture all network data in a android device like fiddler in pc?
Is there a way to analyse network traffic in a android device and log it in SD card?有没有办法分析Android设备中的网络流量并将其记录在SD卡中? For example this app will run in background as a proxy making all network pass through it and based on some filters (eg: facebook data, whatsapp data) inspect data that is being sent and received and log it in a text file.例如,此应用程序将在后台作为代理运行,使所有网络都通过它并基于一些过滤器(例如:facebook 数据、whatsapp 数据)检查正在发送和接收的数据并将其记录在文本文件中。
I don't know of a way to save the data to an SD card but you can capture all traffic from an Android device by configuring Fiddler on a PC that's in the same network .我不知道将数据保存到 SD 卡的方法,但您可以通过在同一网络中的 PC 上配置 Fiddler来捕获来自 Android 设备的所有流量。
In Fiddler, on your PC, go to Tools > Fiddler Options > Connections
在 Fiddler 的 PC 上,转到“ Tools > Fiddler Options > Connections
Check Allow remote computers to connect
勾选Allow remote computers to connect
Check the Fiddler server's IP检查 Fiddler 服务器的 IP
In the Android device's WiFi settings, configure a proxy.在 Android 设备的 WiFi 设置中,配置代理。 Use your Fiddler server's IP and port as the Proxy hostname
and Proxy port
respectively.分别使用 Fiddler 服务器的 IP 和端口作为Proxy hostname
和Proxy port
。
This should make the traffic from your Android device appear in Fiddler.这应该会使来自您的 Android 设备的流量出现在 Fiddler 中。
Check the link at the beginning of this answer for a more detailed description and screenshots.检查此答案开头的链接以获取更详细的描述和屏幕截图。
I think you are looking into TCPDump.我认为您正在研究 TCPDump。 But this cannot be run as a regular user, you will need to become root to executing it.但这不能以普通用户身份运行,您需要成为 root 才能执行它。
Note also that the tcpdump binary is not even published with stock images (my Cyanogenmod does not even contain this).还要注意,tcpdump 二进制文件甚至没有与库存图像一起发布(我的 Cyanogenmod 甚至不包含这个)。
Here are some examples: http://danielmiessler.com/study/tcpdump/以下是一些示例: http : //danielmiessler.com/study/tcpdump/
Some applications on Google Play allow you to capture traffic without rooting your device. Google Play 上的某些应用程序允许您在不植根设备的情况下捕获流量。 One of these is Grey Shirts' Packet Capture .其中之一是Gray Shirts 的数据包捕获。
They work by running on the device as a VPN service.它们通过在设备上作为 VPN 服务运行来工作。 Forcing all traffic to go through it while logging it as well.强制所有流量通过它,同时记录它。 You can then view the logs on the app's UI (It might be possible to pull the session log from the SD card to open it on Wireshark. Haven't tried that).然后,您可以在应用程序的 UI 上查看日志(可能可以从 SD 卡中提取会话日志以在 Wireshark 上打开它。尚未尝试过)。
The app also allows you to install its own root CA certificate so you can view SSL encrypted packets decrypted (just remember to delete the certificate once you're done capturing traffic).该应用程序还允许您安装自己的根 CA 证书,以便您可以查看解密的 SSL 加密数据包(请记住在完成流量捕获后删除证书)。 This works as longs as the app does not usecustomized trusted CAs .只要应用程序不使用自定义的可信 CA,这就会起作用。
Note that you will not be able to capture all traffic with an app running as a VPN service.请注意,您将无法使用作为 VPN 服务运行的应用程序捕获所有流量。 Name resolutions made by apps for example will not pass through the VPN.例如,应用程序进行的名称解析不会通过 VPN。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.