MacOS Charles grabs Iphone's https request to solve unknown

1. Environmental description

  1. Mac OS Sierra 10.12.4
  2. Charles 4.0.1
  3. ios 11.2.2(15C202)
  4. The mobile phone and the computer are in the same WIFI network

Charles download address

2. Packet capture steps

  1. Charles set proxy port
  2. Mobile phone settings access proxy
  3. Install Charles protocol certificate on Mac
  4. Install the Charles protocol certificate on the mobile phone

3. Start capturing packets

1. Charles set proxy port

  • select menuProxy -> Proxy setting...

Charles grabs the https of the iPhone

  • Set the port, if no setting is required, the default is 8888

2. Mobile phone settings access proxy

Confirm before setting

  • iPhone and Mac in the same WIFI environment
  • The network is interoperable, and there is no firewall blocking (by default, it is all connected, unless the LAN firewall, routing, and computer have settings)

2.1 Get computer IP

2 ways:

  • computer terminal inputifconfig
  • Click on the Charles menu,help->Local IP Address

2.2 Set up iPhone wifi proxy

设置->无线局域网->您的 WIFI

Enter image description

After setting up, the iPhone will link to Charles, prompting you that there is a link that needs to be linked to your proxy.....click allow

Enter image description

3. Install the Charles protocol certificate on the Mac

Through steps 1 and 2, you find that Charles can already capture data, but the data packets are unknown or garbled. This is because the access to the https interface requires certificate trust, so we need to install the certificate

The following 2 certificates need to be installed:

Enter image description

  1. Charles menu Help->SSL Proxying->Install Charles Root Certificate, install Charles' certificate. Follow the steps to add to the trust list.
  2. Add proxy 443 port listening
    • Charles menuProxy->SSL Proxying Setting
    • Add listening on port 443, host is "*" (any address)

Enter image description

Enter image description

4. Install the Charles protocol certificate on the phone

  1. Charles menu Help->SSL Proxying->Install Charles Root Certificate on a Mobile Device or Remote browser, a prompt will pop up during installation, allowing you to use your mobile phone to access the address to install the certificate.

Enter image description

  1. Mobile Safari Access chls.pro/sslInstall Certificate

Under normal circumstances, it is chls.pro/ssl, and use Safari to open this address. Follow the prompts to install the certificate.

Enter image description

The default is "unverified", after installation it is "verified"

Fourth, capture the package

Through steps 1, 2, and 3, IOS 10 and below can capture mobile phone data packets normally. But IOS 11 doesn't work.

  • IOS 11 settings
    • Settings->General->About This Mac->Certificate Trust Settings
    • Turn on the switch behind the certificate you just installed (the default is off)
    • IOS 11 normal packet capture

Advertising column: welcome to follow my personal blog

Guess you like

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