[Android Reverse] Packet Capture - Charles 4.6.3 New Version Packet Capture Tutorial

1. Required computer tools:

Insert image description here
Download address: https://www.charlesproxy.com/latest-release/download.do

Netdisk download: new version 4.6.3 link: https://pan.baidu.com/s/1XU320vsMFhbgz_E1MwIHLw?pwd=82eh
Extraction code: 82eh

2. Computer configuration:

After downloading and installing, open our Charles and then:

Because HTTP is a clear text transmission, this type of packet can be captured directly by default.
However, HTTPS is a ciphertext transmission and requires the installation of an SSL certificate.

The following will introduce how to configure, and then you can capture HTTPS packets on the computer (because Http packets can be captured without configuration)

(1) Install the computer certificate:

Insert image description here

Insert image description here
Insert image description here
Insert image description here

(2) Export the installed certificate (export for backup):

Insert image description here
Insert image description here
Insert image description here

(3) Configure SSL host and port (required)

Insert image description here
Insert image description here
After configuration, you can use this button to control its [On] and [Off].
Insert image description here
Generally, after configuration, you need to restart the software and browser.

(4) Try to grab the HTTPS package of the computer browser:

###1、首先确保这两个处于【开启状态】~

Insert image description here
###2. Then open the computer browser (usually requires setting, because the browser itself has security verification), so we need to open the browser's certificate import first.
If it already exists, there is no need to import it. This is just for safety reasons.
Insert image description hereInsert image description here
###3. Open some websites in the browser, and you can see in Charles that the HTTPS package has been obtained by Charles.
Insert image description here

3. Mobile phone/simulator configuration:

We generally need to configure these two items in advance on the computer side:

(1) Set the computer WIFI to a static IP:

Because we need the host address of the computer, the configuration on the computer side should not be a dynamic IP.
We generally need to change it to a static IP, so that the IP will not change:
Note: Other parameters can be filled in using the mobile phone - static IP as a reference.

For example, in my mobile phone settings:
Insert image description here

Insert image description here
Insert image description here
Then, open the command line and enter: ipconfig to check whether the local ipv4 is the same as the set one:
Insert image description here

(2) Turn off the computer’s firewall:

Because the computer's firewall will block external network access, the firewall should be turned off when using:
Insert image description here

(3) Mobile phone WIFI proxy settings

The following takes the simulator as an example (similar to the mobile version)
###1.

In the mobile phone's WIFI advanced settings, set the proxy to [Manual], then enter the static IP of the computer and Charles' default port number 8888. Click Save

Insert image description here

###2、

Just click on a networking software on your phone, and then see if Charles on your computer will have the following prompt. If so, it means the connection is about to be successful, click Allow (if you don’t click Allow, the phone’s WIFI will not be able to connect to the Internet, that is, the proxy will not be successful) :

Insert image description here

###3. Tip: You must be curious about 8888where it comes from:
Insert image description here
Insert image description here

(4) Mobile phone installation certificate.

If the certificate is not installed on the mobile phone, the https package cannot be captured!

(1) Method 1 (I learned it by watching other people’s videos, but I feel... just refer to it)

1. Settings in the simulator (similar to mobile phones):
Note that you need to first modify the disk in [Simulator Settings] so that it can be written. Otherwise, if you copy the file to the simulator, it will be rejected and cannot be displayed. (Then restart)
Insert image description here
2. Drag the previously exported certificate file from the computer to the simulator phone
Insert image description here
3. Double-click to open, and then install:
Insert image description here

Insert image description here

(2) Method 2: (The premise is that you need to successfully set up the WIFI proxy first)

(0) First, we open it and check whether the WIFI proxy has been configured successfully:
Insert image description here
Insert image description here

(1) After ensuring that the above is successful, first open the mobile phone configuration in Charles:
Insert image description hereInsert image description here

Pay attention to the translation of this tip: (explains the steps for us to install the certificate on the mobile phone)

Configure your device (talking about mobile devices) to use Charles as its HTTP proxy on 192.168.1.111:8888,
then go to the browser chls.pro/sslto download and install the certificate.
Note that in iOS 10 and above, you must go to Settings > General > About > Certificate Trust Settings and enable the Charles certificate as a trusted certificate.
Note that Apple requires additional settings!

(2) Use the browser of your mobile phone to open it, and it will automatically download it. Pull down the notification bar, click on the downloaded certificate file, and install it on your mobile phone (the installation method is the same as above, the default is enough). If the mobile phone cannot connect to the Internet, turn off SSL first. ,Right now
Insert image description here

Insert image description here
Insert image description here
Insert image description here
Insert image description here

Insert image description here

(4) Try to grab the mobile phone’s package:

Insert image description here

Just open the Internet app on your phone and check whether the phone can connect to the Internet. If it cannot, check whether the WIFI proxy address of the phone is the same as the IPv4 address of the computer? Then try to reconfigure the environment.
Insert image description here
But you will find that if you cancel the SSL above: although the mobile phone can connect to the Internet, it cannot capture HTTPS packets. Try restarting.

Guess you like

Origin blog.csdn.net/zhinengxiong6/article/details/127148645