How to Intercept iPhone Traffic for Mobile Applications that Bypass Proxy Settings
Abdullah Diaa

Many iOS applications intentionally bypass system proxy settings for security reasons or to prevent traffic inspection. This guide demonstrates how to set up transparent proxying on macOS to intercept HTTPS traffic from iOS apps that ignore proxy configurations, useful for legitimate security testing, app debugging, and API analysis on your own devices.
- Debugging your own applications
- Security testing with proper authorization
- Educational research in controlled environments
- Understanding API behavior for apps you're developing integrations with
Why Apps Bypass Proxy Settings
- Using low-level networking APIs that ignore system proxy configuration
- Implementing certificate pinning
- Using custom network stacks
- Hardcoding direct connections to servers
This guide uses a transparent proxy approach that intercepts traffic at the network level, making it invisible to the application.
Prerequisites
- A Mac running macOS
- An iPhone (that you own or have permission to test)
- mitmproxy installed on your Mac (
brew install mitmproxy) - Administrator access on your Mac
- USB cable for iPhone connection
Step 1: Install the mitmproxy Certificate on Your iPhone
First, configure your iPhone to trust mitmproxy's certificate authority:
-
Start mitmproxy on your Mac:
mitmproxy --listen-port 8889 -
On your iPhone, open Safari and navigate to
`mitm.it` -
Follow the iOS installation instructions to download the certificate profile
-
Install the profile:
- Go to Settings → General → Profile & Device Management
- Tap on the mitmproxy profile and install it
-
Enable full trust for the certificate:
- Navigate to Settings → General → About → Certificate Trust Settings
- Toggle on "Enable full trust" for the mitmproxy root certificate
Step 2: Configure Internet Sharing via USB
Set up your Mac to share its internet connection with your iPhone:
-
Connect your iPhone to your Mac using a USB cable
-
On your Mac, open System Preferences → Sharing
-
Click the info button (ⓘ) next to "Internet Sharing"
-
Configure sharing settings:
- Share your connection from: Wi-Fi
- To computers using: iPhone USB (check this option)
- Enable Internet Sharing by checking the main checkbox
This creates a network bridge interface on your Mac that will handle all iPhone traffic.
Step 3: Identify the Bridge Interface
/sbin/ifconfig | grep -A 5 bridge
Look for an interface named `bridge100` or similar with an IP address (typically `192.168.2.1`):
bridge100: flags=8a63<UP,BROADCAST,SMART,RUNNING,ALLMULTI,SIMPLEX,MULTICAST> mtu 1500
options=3<RXCSUM,TXCSUM>
ether fa:4d:89:96:7d:64
inet 192.168.2.1 netmask 0xffffff00 broadcast 192.168.2.255
inet6 fe80::f84d:89ff:fe96:7d64%bridge100 prefixlen 64 scopeid 0x1e
Verify that traffic is flowing through this interface:
sudo /usr/sbin/tcpdump -i bridge100
You should see packet activity when using your iPhone.
Step 4: Configure macOS Packet Filter for Transparent Redirection
Configure the packet filter to redirect all TCP traffic to mitmproxy:
-
Open the packet filter configuration file:
sudo vim /etc/pf.conf -
Add this redirection rule in the correct position:
rdr on bridge100 inet proto tcp from any to any -> 127.0.0.1 port 8889⚡ PlacementThis line must be placed:- AFTER any
rdr-anchor "com.apple/*"lines - BEFORE any
dummynet-anchorlines
- AFTER any
-
Reload the packet filter configuration:
sudo /sbin/pfctl -f /etc/pf.conf -
Enable IP forwarding to allow traffic passthrough:
sudo /usr/sbin/sysctl -w net.inet.ip.forwarding=1
Step 5: Launch mitmproxy in Transparent Mode
Start mitmproxy with transparent mode enabled:
mitmweb --mode transparent --listen-host 127.0.0.1 --listen-port 8889
Success! You Can Now Intercept All HTTPS Traffic
Understanding the Transparent Proxy Approach
- Network-level interceptionTraffic is redirected at the packet filter level, before applications can bypass proxy settings
- Transparent operationThe iPhone doesn't know a proxy exists - it believes it's connecting directly to servers
- USB tetheringEnsures all traffic routes through your Mac, preventing cellular data bypass
Keyboard Shortcuts and Tips
~d facebook.com to show only Facebook traffic)- Use
mitmwebfor a web-based UI - Use
mitmdumpfor command-line scripting
Troubleshooting Common Issues
No traffic appearing:
- Verify the certificate is in "Certificate Trust Settings" and fully trusted
- Confirm the bridge interface is active:
`ifconfig bridge100` - Check packet filter rules are loaded:
`sudo pfctl -s all` - Ensure IP forwarding is enabled:
`sysctl net.inet.ip.forwarding`
Certificate errors in apps:
- Some apps use certificate pinning - this requires additional techniques or may not be bypassable
- Ensure you've enabled "full trust" for the mitmproxy certificate
Connection issues:
- Disable Internet Sharing and re-enable it
- Restart mitmproxy
- Check firewall settings aren't blocking port 8889
Cleanup and Restoration
When finished testing:
- Stop mitmproxy (press
`q`and confirm) - Disable Internet Sharing in System Preferences
- Remove the packet filter rule from
`/etc/pf.conf` - Reload the original configuration:
`sudo /sbin/pfctl -f /etc/pf.conf` - Optionally, remove the mitmproxy certificate from your iPhone
