Windows 10 uses fiddler to capture Android apps

Insert picture description here

If you want to see more algorithm questions, you can scan the QR code above to follow my WeChat official account " Data Structure and Algorithms ". Up to now, I have updated more than 500 algorithm questions in the official account , some of which have been sorted into pdf documents. , As of now, there are more than 800 pages in total (and will continue to increase), you can reply to the keyword "pdf" in the official account to download.


Original link: https://blog.csdn.net/jianglianye21/article/details/81743129

#1, environment preparation1
, install fiddler on the computer

#2. Settings
1. fiddler>Tools>Fiddler Options>Connections Check Allow remote computers to connect.
2. Remember the port number here: 8888, which will be used later.
Write picture description here

3. Check the computer ip

1. Open cmd, enter: ipconfig, remember this IPv4 address.
Write picture description here

4. Set up proxy

1. Mobile phone settings -> WLAN settings -> select the wifi, click the arrow on the right (some mobile phones long press to pop up the option box).
2. Choose to modify the network configuration:

Server host name: consistent with the IP address of the host computer

Server port number: 8888
Write picture description here

3. After saving, you can catch the request from the mobile phone.
4. Use a browser on the mobile phone to access http://IP: port, use the computer port and the port set by fiddler to access the installation certificate, access the network, and observe whether fiddler can successfully capture the packet. At this time, under normal circumstances, the mobile phone network can be accessed, and the packet capture is successful.

5. After connecting to the computer, the mobile phone may not be connected to the Internet, the solution

(1) Open the registry, create a DWORD under HKEY_CURRENT_USER\SOFTWARE\Microsoft\Fiddler2, set the value to 80 (decimal)
Write picture description here
Write picture description here
(2) Write FiddlerScript rule, click Rules> Customize Rules, use ctr+f to find the OnBeforeRequest method to add a line Code.

if (oSession.host.toLowerCase() == "webserver:8888") 
        {
            oSession.host = "webserver:80";
        }

 
  
  
  • 1
  • 2
  • 3
  • 4

Write picture description here

Write picture description here
(3) At this time, the mobile phone should be able to connect to the Internet

6. Grab the HTTPS request on the APP

1. If the app is all http requests, it is not necessary to install a certificate and can be directly captured. If it is an https request, the mobile phone needs to download the certificate at this time.

2. Open the mobile browser and enter: http://10.168.xx.xx:8888 , the host address in the middle is the address of the local machine found earlier.

3. The following screen appears, click the position pointed by the arrow, and click install.
Write picture description here

#7. Fiddler certificate installation (view HTTPS)
1. First, make sure that the installed Fiddler is a newer version. The older version may not be able to install the fiddler certificate generator.
2. Close Fiddler.
3. Download and install the Fiddler certificate generator. (Note: The Fiddler certificate generator can only be run on systems above Vista) (there is a download link before), or you can download it from the following address:
download address : http://www.telerik.com/docs/default-source/fiddler/ addons/fiddlercertmaker.exe?sfvrsn=2
4. Open Fiddler, click Tools——>Fiddler Options...
5. Switch to the HTTPS tab, check Capture HTTPS CONNECTs, check Decrypt HTTPS trafic, and the installation certificate will pop up Tips. All the way is to confirm the installation.
Write picture description here
6. Restart fiddler, still staying on the HTTPS tab, click Actions on the right, you can see a drop-down menu, click Export Root Certificate to Desktop, the certificate will be generated on the desktop, named FiddlerRoot.cer, click OK to save
Write picture description here
7. Import the certificate for installation
This part of android and ios is a little different.
Method 1:
1) Android can be connected to the computer, open the memory card of the phone from the computer, and directly copy the certificate to the SD card.
2) Click Settings -> Security -> Install from SD Card -> Find the certificate from the internal storage space, click Install (the certificate name can be named whatever you want)
Method two:
1) Android can be connected to the computer, open the memory card of the phone from the computer, and directly copy the certificate to the SD card.
2) Find the storage location of the file on the phone, click on the file name, and you will be prompted to install (the name of the certificate can be named arbitrarily)
Method 3:
ios can log in to the mailbox on the phone browser, then send the certificate to the mailbox, and view it on the phone Email, click the attachment to install the certificate

8. View HTTPS
Open fiddler, Tools——>Fiddler Options…, switch to the HTTPS tab, check all the options, click Save, and you can view the HTTPS interface
Write picture description here

#8. Setting up filtering
1. After setting up the proxy on the mobile phone, all the requests from the pc and app are caught on fiddler at this time. If the URL is opened on the pc, there will be a lot of requests. At this time, the filtering function needs to be turned on.

2. Open fiddler>Tools>Fiddler Options>HTTPS>…from remote clients only, check this option.

…From all processes: catch all requests

…From browsers only: only grab browser requests

…From non-browsers only: Only grab requests from non-browsers

…From remote clients only: only grab remote client requests
Write picture description here
(note: if the phone is set to proxy, remember to restore it after testing and playing, otherwise the phone cannot access the Internet normally.)

Guess you like

Origin blog.csdn.net/abcdef314159/article/details/112258142