Use fiddler achieve mobile packet capture

Can not be viewed directly on the mobile phone network requests data, the need to use the capture tool. Fiddler is a free web debugging proxy, you can use it to achieve record, view and debug http / https communication between mobile terminals and remote servers.

fiddler no mobile client, are installed on the PC, to achieve packet capture program on your phone, you need to do some configuration fiddler and mobile terminal on the PC. Proceed as follows:

A, PC end fiddler configuration

1. Install HTTPS certificate

Many applications relate to personal information on the phone, using relatively secure HTTPS encrypted, and the fiddler to capture only the default http sessions without crawling HTTPS packets, resulting in open after fiddler open https pages (such as Baidu), the solution : open Fiddler-> Tool-> Fiddler Options-> HTTPS tab, and check the capture HTTPS CONNECTs (capture HTTPS connection) and decrypt HTTPS traffic (HTTPS request decryption), and install the certificate (certificate of no first use, it will pop up whether to trust fiddler certificates and safety tips, just click yes on the line), Fiddler restart to take effect.

 
fiddler HTTPS configuration

2. Allow the phone to connect remotely

If you want to capture traffic data on your phone, you need to connect the phone Fiddler on the proxy, Fiddler default does not allow other devices connected Solution: Click Fiddler-> Tools -> Options, select Allow remote computers to the Connections panel to allow other devices connect (Fiddler need to restart the operation force).

 
Allow Remote Access

 

3. Check the IP address

  • 电脑ip地址可通过cmd命令行输入ipconfig查询,或网络连接信息中找到,最直观的方法是将鼠标置于fiddler右上角的online中即可显示电脑的ip地址。如下图我的IP是192.168.1.106。
     
    电脑IP

二、手机端配置

需要在移动终端(手机或pad)上指定代理服务器为Fiddler所在主机IP(需要处于同一网络),端口默认8888。

1. 接入网络

要保证手机和安装有fiddler的电脑处在同一局域网内,手机能ping通电脑。方法:家用或办公环境把PC和手机WLAN连接上同一个路由器的无线SSID获取到同一网段内的IP地址即可。台式机要插入无线网卡才能连WiFi,最好用笔记本电脑和手机连同一WiFi很方便。如下图,我的手机IP是192.168.1.104,与电脑192.168.1.106可互通,就能访问192.168.1.106:8888。

 
手机IP

 

2. 手机安装根证书

在手机上需要安装Fiddler根证书,因为Fiddler是通过自己生成的证书对网络请求重新签名进行https会话解密的,如果不安装证书的话只能抓取HTTP请求。

(1)手机和电脑连接同一个网络,打开手机浏览器,输入Fiddler Server地址http://ipv4.fiddler:8888/(因为fiddler装在PC上,所以Fiddler Server地址就是PC的IP地址,带上端口号8888,我的是http://192.168.1.106:8888/), 跳转到 Fiddler Echo Service 证书下载页,点击FiddlerRoot certificate下载并安装;

 
下载证书.png

 
证书.png

 

(2) 为证书命名后点击确定;


 
Name the certificate

(3) required to set a phone password, set up their own one password to remember on the line, and finally do not have to go system - Security - passwords can be removed;


 
set password

3. The phone proxy settings

Change mobile wireless network proxy method: Open the System Settings -WLAN, press the WiFi access network SSID to modify, click Advanced Options, select Manual proxy, enter the host name fiddler computer ip address 192.168.1.106, enter the port number 8888, save It can be.

 
Proxy Settings

 

Third, packet capture

After the configuration on the PC and on the phone to complete can operate the phone, on the computer get caught up with fiddler, such as access to some sites and APP, fiddler will be displayed in HTTP / HTTPS communications recording captured on mobile phone, capture success.

Fourth, restore your phone's status

After capture, the need to manually restore the phone status, as follows (different models may be slightly different):
(1) to stop the computer to the mobile phone network monitoring: System Settings -WLAN, press wifi network modifications, the advanced options to find the agent, manually remove the agent;
(2) deletion certificate phones: Android device security system set up a trusted user credentials, click the certificate can be deleted;
(3) to remove the password on your phone: phone system - security - password, delete the system password It can be.



Author: Yvanna_15
link: https: //www.jianshu.com/p/724097741bdf
Source: Jane book
Jane book copyright reserved by the authors, are reproduced in any form, please contact the author to obtain authorization and indicate the source.

Guess you like

Origin www.cnblogs.com/blogsaspx/p/11280854.html