Skip to main content

Overview

Network analysis reveals how iOS apps communicate with servers, exposes API endpoints, and uncovers authentication mechanisms. This is crucial for understanding app functionality and identifying security vulnerabilities.
Most modern iOS apps use HTTPS with certificate pinning, requiring advanced techniques to intercept traffic.

Intercepting Network Traffic

Setting Up a Proxy

1

Configure Burp

  1. Open Burp Suite
  2. Proxy > Options > Proxy Listeners
  3. Add listener on all interfaces (e.g., 0.0.0.0:8080)
  4. Enable “Support invisible proxying”
2

Configure iOS Device

  1. Settings > Wi-Fi > Select network
  2. Scroll down to HTTP Proxy
  3. Select “Manual”
  4. Server: Your computer’s IP
  5. Port: 8080
3

Install CA Certificate

  1. On device, browse to http://burp
  2. Download CA certificate
  3. Settings > Profile Downloaded > Install
  4. Settings > General > About > Certificate Trust Settings
  5. Enable full trust for Burp CA
iOS 10.3+ requires explicit trust for user-installed certificates.

VPN-Based Interception

ProxyMan creates a VPN tunnel for seamless interception:
  1. Install ProxyMan on macOS
  2. Install ProxyMan companion app from App Store
  3. Pair device via QR code
  4. Traffic automatically routed through proxy
Advantages:
  • No manual proxy configuration
  • Works with all apps
  • Captures localhost traffic
  • Automatic certificate installation
ProxyMan requires both devices on same network for initial pairing.

Packet Capture with tcpdump

For low-level packet analysis:
# SSH into jailbroken device
ssh root@<device-ip>

# Install tcpdump via Cydia
apt-get install tcpdump

# Capture all traffic
tcpdump -i any -w /tmp/capture.pcap

# Capture only HTTP/HTTPS
tcpdump -i any -n 'tcp port 80 or tcp port 443' -w /tmp/http.pcap

# Copy to computer for analysis
scp root@<device-ip>:/tmp/capture.pcap .

# Analyze with Wireshark
wireshark capture.pcap
tcpdump -i any -n host api.example.com -w /tmp/api.pcap

SSL Pinning Bypass

Understanding SSL Pinning

App validates the server’s certificate against a bundled copy:
// Certificate pinning implementation
- (void)URLSession:(NSURLSession *)session
    didReceiveChallenge:(NSURLAuthenticationChallenge *)challenge
    completionHandler:(void (^)(NSURLSessionAuthChallengeDisposition, NSURLCredential *))completionHandler {
    
    NSData *serverCert = challenge.protectionSpace.serverTrust.certificateAtIndex(0);
    NSData *pinnedCert = [self loadPinnedCertificate];
    
    if ([serverCert isEqualToData:pinnedCert]) {
        // Certificate matches
        NSURLCredential *credential = [NSURLCredential credentialForTrust:challenge.protectionSpace.serverTrust];
        completionHandler(NSURLSessionAuthChallengeUseCredential, credential);
    } else {
        // Certificate mismatch - reject
        completionHandler(NSURLSessionAuthChallengeCancelAuthenticationChallenge, nil);
    }
}
App validates the public key instead of entire certificate:
// Extract and compare public keys
SecKeyRef serverKey = SecTrustCopyPublicKey(serverTrust);
SecKeyRef pinnedKey = [self loadPinnedPublicKey];

if (SecKeyCompare(serverKey, pinnedKey) == 0) {
    // Keys match
}
Harder to bypass than certificate pinning.
Many apps use TrustKit for pinning:
TrustKit *trustKit = [[TrustKit alloc] initWithConfiguration:@{
    @"api.example.com": @{
        kTSKPublicKeyHashes: @[
            @"sha256/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=",
            @"sha256/BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB="
        ]
    }
}];

Bypass Techniques

Easiest method for jailbroken devices:
1

Install from Cydia

  1. Add repo: https://julioverne.github.io/
  2. Search for “SSL Kill Switch 2”
  3. Install the package
2

Enable in Settings

  1. Settings > SSL Kill Switch 2
  2. Enable “Disable Certificate Validation”
  3. Optionally select specific apps
3

Restart SpringBoard

killall -9 SpringBoard
SSL Kill Switch doesn’t work with all pinning implementations. Have alternatives ready.

Advanced Pinning Bypass

Custom Pinning Logic

Some apps implement custom validation:
// Find and hook custom validator
var methods = ObjC.classes.CustomSSLValidator.$ownMethods;
methods.forEach(function(method) {
    if (method.includes('validate') || method.includes('verify')) {
        Interceptor.attach(
            ObjC.classes.CustomSSLValidator[method].implementation,
            {
                onLeave: function(retval) {
                    console.log('[+] Hooked: ' + method);
                    retval.replace(1);
                }
            }
        );
    }
});

Flutter Apps

Flutter apps require different approach:
# Use reFlutter for automatic bypass
pip install reflutter

# Patch Flutter engine
reflutter app.ipa

# Install patched IPA
# SSL pinning bypassed in Flutter layer

React Native

Hook React Native networking:
if (ObjC.classes.RCTHTTPRequestHandler) {
    Interceptor.attach(
        ObjC.classes.RCTHTTPRequestHandler['- sendRequest:withDelegate:'].implementation,
        {
            onEnter: function(args) {
                console.log('[+] RN request intercepted');
                // Modify request as needed
            }
        }
    );
}

Xamarin Apps

Xamarin uses Mono runtime:
// Hook .NET ServicePointManager
var ServerCertificateValidationCallback = /* find callback */;
Interceptor.replace(ServerCertificateValidationCallback, 
    new NativeCallback(function() {
        return 1;  // Always valid
    }, 'int', [])
);

Analyzing API Communication

Request Analysis

Identify how the app authenticates:
GET /api/user/profile HTTP/1.1
Host: api.example.com
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
  • Decode JWT tokens at jwt.io
  • Check expiration and claims
  • Test token reuse and refresh
GET /api/data HTTP/1.1
Host: api.example.com
X-API-Key: abc123def456ghi789
  • Extract from requests
  • Check if static or per-user
  • Test without key for validation
POST /oauth/token HTTP/1.1

grant_type=authorization_code&
code=AUTH_CODE&
client_id=CLIENT_ID&
client_secret=CLIENT_SECRET
  • Map OAuth flow
  • Extract client credentials
  • Test PKCE implementation
GET /api/data HTTP/1.1
Cookie: sessionid=abc123; csrftoken=xyz789
  • Check secure/httponly flags
  • Test session fixation
  • Verify CSRF protection

Response Analysis

{
  "status": "success",
  "data": {
    "user_id": 12345,
    "email": "[email protected]",
    "premium": true,
    "subscription_expires": "2025-12-31"
  },
  "meta": {
    "api_version": "2.1",
    "timestamp": 1709481600
  }
}

Man-in-the-Middle Techniques

Request Modification

1

Intercept request

  1. Proxy > Intercept > Intercept is on
  2. Trigger request in app
  3. Request appears in Burp
2

Modify parameters

# Original
POST /api/purchase
{"item_id": 123, "price": 9.99}

# Modified
POST /api/purchase  
{"item_id": 123, "price": 0.01}
3

Forward request

Click “Forward” to send modified request
Use Match/Replace rules for automatic modification.

Attack Scenarios

Test if server validates prices:
POST /api/purchase HTTP/1.1

{
  "item_id": 123,
  "quantity": 1,
  "price": 0.01,     // Modified from 99.99
  "currency": "USD"
}
Only test on apps you’re authorized to test. This is often illegal otherwise.
Test Insecure Direct Object References (IDOR):
# Access another user's data
GET /api/user/12345/private-data HTTP/1.1

# Try different user ID
GET /api/user/99999/private-data HTTP/1.1
Test for rate limiting:
import requests

# Send 1000 requests
for i in range(1000):
    resp = requests.post('https://api.example.com/login',
        json={'username': 'test', 'password': f'pass{i}'}
    )
    print(f"Request {i}: {resp.status_code}")
Test duplicate parameter handling:
POST /api/transfer HTTP/1.1

amount=1.00&amount=1000.00&recipient=attacker

Tools and Automation

Proxyman

Modern macOS proxy with iOS pairing

Burp Suite

Industry-standard security testing proxy

mitmproxy

Scriptable MITM proxy

Wireshark

Network protocol analyzer

Postman

API testing and documentation

HTTPToolkit

Modern HTTP debugging

Best Practices

1

Document Everything

  • Keep detailed logs of all requests/responses
  • Screenshot important findings
  • Export traffic captures for review
  • Map complete API surface
2

Test Systematically

  • Start with passive observation
  • Identify authentication mechanism
  • Map all endpoints
  • Test authorization boundaries
  • Check input validation
3

Stay Legal

  • Only test apps you’re authorized to test
  • Respect terms of service
  • Don’t access others’ data
  • Report vulnerabilities responsibly
4

Verify Findings

  • Reproduce issues multiple times
  • Test on different accounts
  • Confirm with direct API calls
  • Document exact reproduction steps
Network analysis complete when you have:
  • Successfully intercepted all traffic
  • Bypassed SSL pinning if present
  • Mapped complete API structure
  • Identified authentication mechanisms
  • Documented potential vulnerabilities
  • Tested key security controls

Resources

SSL Kill Switch 2

Jailbreak tweak for SSL bypass

objection

Runtime mobile exploration toolkit

Frida CodeShare

Community scripts including SSL bypass

OWASP Mobile

Mobile security testing guide

Build docs developers (and LLMs) love