Charles captures packets to obtain data for development

  • Install
  • HTTP packet capture
  • HTTPS packet capture


 

1. Charles installation

Download and install Charles from the official website:
https://www.charlesproxy.com/download/

 

When brothers use it, according to your version, you must crack the 4.1.4 I downloaded 

The latest version v4.1.4 crack file download:
link:  https://pan.baidu.com/s/1sl5AeTJ  password: cp7z

  1. For Windows platform, overwrite the downloaded charles.jar file to the lib folder in the installation directory to complete the crack!
  2. On the Mac platform, right-click the downloaded charles.jar file on Charles.app to display the package content, and cover it under Content->Java to complete the crack!

2. HTTP packet capture

(1) Check the IP address of the computer

 
(2) Set up mobile HTTP proxy

Connect the mobile phone to the computer, click "Settings -> Wireless LAN -> Connected WiFi", set the HTTP proxy:
the server is the computer IP address: such as 192.168.1.169
Port: 8888


 

After setting the proxy, you need to open Charles on the computer to access the Internet

(3) Open Charles on the computer for HTTP packet capture

Open an app or browser on your phone. If you can't access the Internet, check whether the previous steps are correct.


 

Click "Allow" to allow, the list of HTTP requests of the mobile phone will appear


HTTP packet capture

3. HTTPS packet capture

HTTPS packet capture needs to be set on the basis of HTTP packet capture

This is how to capture HTTPS before setting


 

After setting, the packet capture HTTPS looks like this


 

 

The following are further setup steps for HTTP packet capture based on HTTP packet capture:

(1) Install the SSL certificate to the mobile device

点击 Help -> SSL Proxying -> Install Charles Root Certificate on a Mobile Device


 

A pop-up window appears to get the address chls.pro/ssl


The address of the mobile phone to install the SSL certificate

Enter the address chls.pro/ssl in the mobile Safari browser , the certificate installation page appears, click Install
and enter the password with the password set by the mobile phone to install


Install the certificate
  • Note 1: There are brothers and sisters who say that the Safari browser cannot install the certificate by entering this URL chls.pro/ssl
    . For personal testing, you need to (1) set up the HTTP proxy on the mobile phone (2) Charles should be turned on on the computer
  • Note 2: For iOS 10.3 system, you need to enable full trust Charles certificate in Settings→General→About This Machine→Certificate Trust Settings
    (thanks to @13002171223 for bringing this up, I didn’t upgrade to 10.3 before)
(2) Charles sets Proxy

Proxy -> SSL Proxying Settings...


 

Check Enable SSL Proxying and click Add


 

Host sets the https interface to be captured, for example, if you want to capture this


 


Fill in Host: https://api.weibo.cn
Fill in Port: 443


 
(3) HTTPS packet capture

Let the mobile phone resend the https request, you can see the captured packet



Author: Roy_Liang
Link: http://www.jianshu.com/p/5539599c7a25
Source: Jianshu The
copyright belongs to the author. For commercial reprints, please contact the author for authorization, and for non-commercial reprints, please indicate the source.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326109780&siteId=291194637