Fiddler capture Principles and Configuration

The front end of the time required to test a company's APP, persevering often encountered toast prompt an error situation, so it is necessary to use fiddler packet capture and see if the interface returns an error.

1, download and install Fiddler

   First, the computer needs to install Fiddler, fool-style installation.

2, Fiddler works

Fiddler HTTP proxy is located between the client and the server side, it is possible to record all HTTP (S) requests between client and server, for a particular HTTP (S) requests, analyzing data transmitted over the network, you may also be provided breakpoint modification request data and the data returned by the server.
Fiddler establishing a proxy server between the browser and the server, the application layer Fiddler work of seven, capable of capturing HTTP (S) requests through. After the start Fiddler proxy settings automatically cost machine, the default port is 8888. Fiddler recording not only a network PC browser request data, can also be recorded HTTP (S) of other network devices in the same requested data. Data transfer process is as follows:

1) the client sends a HTTP (S) is requested, the request will go through the proxy server Proxy Fiddler like WEB server.
2) Fiddler proxy server intercepts the request packet client, and then forwarded to the WEB server, can do some request message before forwarding the modified operating parameter.
After. 3) WEB server processes the request sends a response, Fiddler proxy server intercepts WEB server response packet.
4) Fiddler processed after the response packet back to the client.

3, Fiddler crawling HTTPS principle

Now APP in data transmission basically use HTTS transmission, data transmission is encrypted, which increases the difficulty we analyze the data packets, in addition to better Fiddler HTTP packets can crawl, you can also grab HTTPS packets . Need to do some special configuration is required due to the HTTPS transport to the CA certificate, so crawl crawling HTTPS packets. Fiddler to intercept HTTPS packet process is as follows:

1) The client requests to establish links HTTPS encryption protocol sends the client a list of supported versions and other information to the server.
2) Fiddler accept client requests sent by the client and disguised as the same request to the WEB server.
3) After the WEB server receives a request Fiddler screened suitable encryption protocol from the request. And returns the server CA certificate, certificate including public key information.
4) Fiddler received a response after saving the server certificate WEB server and a self-signed CA certificate, disguised as a server, the certificate issued to the client under.
5) client authentication certificate legitimacy. (Fiddler able to crawl HTTPS packets key to this step)
6) producing symmetric key client, sent to the server via a public key encryption certificate.
After 7) Fiddler intercepting client requests, using the private key to decrypt the message, symmetric encryption keys acquired, and sent to the WEB server in the server certificate using the public key encryption with the symmetric key. In this case the symmetric key has been leaked, after the secret key data of the client and server side interface transmission can be used.
After 8) WEB server receives the encrypted sent by the client to decrypt the symmetric key using the private key, and the encrypted symmetric key test data to the client.
9) Fiddler obtained using a symmetric key to decrypt the packet front.
10) The client authentication data is correct after the HTTPS connection is established, the client begins sending encrypted using the symmetric key data to the service server
11) Fiddler using the symmetric key to decrypt data sent by the client and re-encrypt the acquired preceding forwarded to the client.

4, Fiddler configuration

If you just need to listen to the native browser HTTP packet then need to do any additional configuration, open Fiddler can be used directly. Generally, we need to listen to the remote terminal equipment network requests, need to do the following configuration. Open Fiddler, select Tools-> Options-> Connections in the menu bar. Enter the listening port (default is 8888), select Allow remotecomputers to connect, and then click OK to restart Fiddler.

Since we need to monitor network requests the mobile phone side, it is also necessary to set up the mobile phone side. First make sure the mobile phone network and install Fiddler computer networks in the same wifi network. Fiddler can click on the upper right corner of the main interface of the "Online" button to see Fiddler host the host name and IP address, you need to configure the IP address of the phone network.

But in general are now transmitted APP HTTPS request to fetch all the required settings fiddler HTTPS requests. Front also spoke, HTTPS data packet transmission when it comes to the issue of certificates and data encryption, so Fiddler need to crawl HTTPS packets needs to be done, then other configurations.
First is open Fiddler configuration: Tools-> Options-> HTTPS:

Check Capture HTTPS CONNECTS and Decrypt HTTPS traffic option, if you just want to grab this unit or remote terminal data packets, can this drop-down box in ... from all processes select.

Open collection iOS browser, enter the host Fiddler where ip: 8888, after the visit, download the certificate.

 

 

 

 

Download and install the certificate profile in the iOS settings.

Once installed, open the phone network settings, select with Fiddler hosts on the same network, the proxy bar wifi advanced settings of the following manual setting, set the input Fiddler host's IP address and port number (IP previous step display) (the previous default 8888 that), tap store. This will generally be successful, but also need more iOS10 Settings - General - About This Mac - trust certificate, certificate of trust to open the switch. Since then, the proxy settings on iOS success. After these configurations according to restart Fiddler. We have to open the HTTPS links APP discovery can capture data packets HTTPS in the phone side.

 

Original Reference: http://www.luoxudong.com/?p=306

 

 

Guess you like

Origin www.cnblogs.com/selinanan/p/12449118.html