mitmproxy
https://docs.mitmproxy.org/stable/
mitmproxy is a set of tools that provide an interactive, SSL/TLS-capable intercepting proxy for HTTP/1, HTTP/2, and WebSockets.
This post shows you how to intercept network traffic from iPhone using mitmproxy on Mac.
Install mitmproxy on Mac
Run mitmproxy
Get IP address from Mac
System Preferences -> Network -> Wi-Fi -> Advanced... -> TCP/IP -> IPv4 Address: 10.0.0.3 (your IP will differ)
or run following command
Configure iPhone to use mitmproxy
Settings -> Wi-Fi -> (i) button from currently connected Wi-Fi -> HTTP PROXY | Configure Proxy
- Off -> Manual
- Set Server to IPv4 address from above
- Set Port to 8080
Download configuration profile
Visit http://mitm.it with Safari on your iPhone.
If you see below message when visiting http://mitm.it, make sure: (1) mitmproxy is running and (2) iPhone is configured to use mitmproxy from above.
On http://mitm.it,
click Get mitmproxy-ca-cer.pem
for iOS -> Allow
Click open Show Instructions
(below Get mitmproxy-ca-cer.pem
)
and follow the instructions.
1. Use Safari to download the certificate
We just downloaded above.
2. Install the new Profile
Settings -> General -> VPN & Device Management
Select the downloaded profile, mitmproxy.
Press Install -> confirm Install
Profile is installed.
3. Certificate Trust Settings
Settings -> General -> About -> Certificate Trust Settings
Toggle mitmproxy to ON
Ready
Run mitmproxy or mitmweb
Use
Now use your iPhone and network traffic from/to your iPhone will be logged on http://127.0.0.1:8081