Android implements packet capture using Fiddler to capture packets

Fiddler download: https://pan.baidu.com/s/1QzvL0xugp6XX7gbFBFlEJg?pwd=bf6u 
Extraction code: bf6u 

1. Fiddler configuration 

If you do not need https, you can open  
fiddler on your computer without turning on https packet capture. The mobile phone and computer are in the same network segment. Fiddler opens https packet capture ( Tools->Options->HTTPS) and configures the port ( Tools->Options->Gateway). (The listening port defaults to 8888)

 For apps with ordinary http requests, the above configuration is not required. (The listening port defaults to 8888)

 2. Computer ip view  

win+R, enter cmdEnter. Summon cmd and enter ipconfig. The ipv4 address is the computer’s ip address.

 3. Configure the agent on your mobile phone or simulator 

Turn on the phone, connect to the WiFi on the same network as the computer, find the advanced settings or proxy settings , select the proxy 手动, then enter the ipv4 address of the computer obtained in the previous step as the host name, and enter the listening port configured by fiddler as the port.

 4. Install the Fiddler certificate on your mobile phone

Open the browser on your mobile phone and access what you just entered ip:端口. For example, mine is 192.168.3.141:8888. Zoom in on this interface and find the blue download link. Click to download and install.

 Basically, you can capture the packet. If you still don’t capture the data, you need to use drony and fiddler to capture the packet.

Drony download: https://pan.baidu.com/s/1G-IXl_gcKV-41bOE7BITXg?pwd=6h5x 
Extraction code: 6h5x 

Principle analysis

  • The APP restricts the use of the default system proxy, causing the system proxy set through WiFi to become invalid.
  • By using VPN, drony intercepts all the traffic of the set APP, and then forwards this part of the traffic to the listening port of fiddler, forcing this part of the traffic to pass through fiddler, and fiddler can intercept and view the captured requests.

manual:

1. After installing drone, open droneAPP and slide left to switch to the settings interface.

 2. Enter the wireless network setting interface

 3. On the WiFi interface, long press the currently connected WiFi and click Edit.

 You may encounter several problems here:

  • The WiFi list is not displayed. Generally, you will encounter this problem. You need to allow drone to locate, read the application list, turn WLAN on and off in the permissions, and then restart drone to restore the display. Got it
  • Displaying a lot of WiFi lists: This is because drony will display all WiFi lists saved by the system instead of the WiFi that can currently be searched.

4.Drony sets the same proxy IP and port as Fiddler

 

 5. Swipe up to view more settings below, set filter default values ​​and enter the rule setting interface

 6. Enter the forwarding rule settings and click the plus sign to add rules.

7. For action, select all local proxy chains, then click APP selection below to select the APP to capture packets. If you do not select APP, all APP requests will be forwarded, which may easily cause misjudgment.

 8. Click the Save button in the upper right corner to save the current filtering rule configuration.

 

 9. After the configuration is completed, return to the rule list interface and confirm the rules again.

10. Return to the main interface, click the switch to turn on proxy forwarding 

 11. View the request content on fiddler.

Guess you like

Origin blog.csdn.net/qq_15059163/article/details/131748625