1. Environmental description
- Mac OS Sierra 10.12.4
- Charles 4.0.1
- ios 11.2.2(15C202)
- The mobile phone and the computer are in the same WIFI network
2. Packet capture steps
- Charles set proxy port
- Mobile phone settings access proxy
- Install Charles protocol certificate on Mac
- Install the Charles protocol certificate on the mobile phone
3. Start capturing packets
1. Charles set proxy port
- select menu
Proxy -> Proxy setting...
- 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 input
ifconfig
- Click on the Charles menu,
help->Local IP Address
2.2 Set up iPhone wifi proxy
设置->无线局域网->您的 WIFI
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
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:
- Charles menu
Help->SSL Proxying->Install Charles Root Certificate
, install Charles' certificate. Follow the steps to add to the trust list. - Add proxy 443 port listening
- Charles menu
Proxy->SSL Proxying Setting
- Add listening on port 443, host is "*" (any address)
- Charles menu
4. Install the Charles protocol certificate on the phone
- 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.
- Mobile Safari Access
chls.pro/ssl
Install Certificate
Under normal circumstances, it is chls.pro/ssl, and use Safari to open this address. Follow the prompts to install the certificate.
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