Intercepting Mobile Traffic with Burp Suite — A Practical Guide
. Goal & Requirements
Goal
Use Burp Suite to intercept and inspect network traffic between a mobile app and its backend so you can analyze API requests/responses and find security issues (insecure transport, sensitive data leakage, auth flaws, etc.).
Requirements / Prerequisites
-
Burp Suite (Community or Professional).
-
Test devices: Android device/emulator and/or iOS device/simulator (physical device preferred).
-
Same Wi-Fi or USB cable (ADB) connection between device and Burp machine.
-
Basic knowledge of ADB (Android) and Frida (runtime hooking).
-
Frida +
frida-server
installed for runtime bypass techniques. -
Optional:
objection
,apktool
,jadx
for static changes and binary analysis. -
Burp CA certificate exported for installation on test devices.
2. Lab Setup — Repeatable & Isolated
Why isolation matters
Keep tests reproducible and prevent accidental leaks or interference with production networks. Use a dedicated VM or a separate laptop for Burp.
Recommended setup
-
Dedicated VM or laptop running Burp (preferably air-gapped or on a controlled network).
-
Android: emulator (Android Studio) or physical device.
-
iOS: test device (preferred) or simulator.
-
Install Frida &
frida-server
on devices if you plan to bypass pinning at runtime.
3. Export & Install Burp CA
Export the certificate
Burp → Proxy → Options → Import / export CA certificate → Export in DER or PEM.
Install on Android
-
User store: works for many apps, but Android 7+ apps that opt-in to stricter network config may ignore user CAs.
-
System store: requires root (install CA into system trust store if needed).
Install on iOS
-
Host certificate on a reachable location (or email it). Install profile, then enable trust: Settings → General → About → Certificate Trust Settings → Enable full trust.
4. Configure Burp Suite
Basic proxy listener
-
Proxy → Options → Add listener on
0.0.0.0:8080
(or specific interface/IP).
Intercept toggle
-
Proxy → Intercept → Toggle Intercept On/Off to capture requests live.
SSL/TLS
-
Burp supports modern TLS versions; defaults usually suffice. Adjust SSL settings in Options only if necessary.
Other settings
-
Upstream proxy chaining & client certificates: configure in Options when required.
-
Turn off enforced client certificate requirement unless testing mutual TLS.
5. Connecting Android Devices
Option A — Same Wi-Fi (simple)
-
Find Burp machine IP (e.g.,
192.168.1.100
). -
On Android: Wi-Fi → Long-press network → Modify network → Advanced options → Proxy → Manual → Host:
192.168.1.100
, Port:8080
.
Option B — ADB port forwarding (no Wi-Fi)
-
Example:
(Useful when the app connects to localhost:8080
on device or to avoid Wi-Fi configuration.)
Notes
-
Android 7+ may ignore user CAs for certain apps. If CA install isn’t enough, use Frida or system CA (root) methods.
6. Connecting iOS Devices
Wi-Fi proxy
-
iOS Wi-Fi → Info (i) → Configure Proxy → Manual → Server: Burp IP, Port:
8080
.
CA trust
-
Install Burp certificate → Settings → General → About → Certificate Trust Settings → Enable full trust.
iOS nuances
-
Apps using ATS or custom
SecTrust
evaluation may still reject user-installed CA — Frida or dynamic library injection is typically required to bypass pinning.
7. First Capture — Confirm Interception
-
Launch the app.
-
With Burp Intercept ON, confirm requests appear under Proxy → Intercept.
-
If TLS errors / failures occur:
-
Confirm Burp CA installed & trusted.
-
Verify proxy settings.
-
Investigate whether the app uses Network Security Config (Android) or certificate pinning (iOS).
-
8. SSL Pinning — Common Bypass Strategies (Lab-safe)
Choice of strategy depends on platform, framework and protections used by the app.
Strategy A — Network Security Config (Android)
If the app uses network_security_config.xml
, you can modify it during APK rebuild to allow user CAs.
Quick steps
Note: Only works if the app respects network config and doesn’t have stronger pinning.
Strategy B — Frida (runtime hooking) — Android & iOS
Frida hooks runtime checks (no permanent binary change). Often the fastest, most flexible approach.
Android Frida example (bypass-ssl.js
):
Run:
iOS Frida hint
Hook SecTrustEvaluate
or equivalent native APIs to force a successful trust result. Exact implementation depends on iOS version and symbols.
Strategy C — Objection (Frida wrapper)
Strategy D — Binary patching (static)
Decompile (jadx/apktool), locate pinning code or native hooks, patch to remove checks, re-sign. Persistent but riskier (breaks signatures & may trigger integrity checks).
Strategy E — Root/Jailbreak + System CA
Install Burp CA into the system trust store on rooted Android or use jailbreak tools on iOS. Historically tools like SSLKillSwitch existed for iOS (modern iOS may be harder).
9. Common Pinning Targets & Where to Hook
-
OkHttp (Android):
okhttp3.CertificatePinner.check
-
Javax SSL:
javax.net.ssl.X509TrustManager.checkServerTrusted
-
Conscrypt / TrustManagerImpl (Android): native/Conscrypt hooks
-
NSURLSession / CFNetwork (iOS): delegate methods or
SecTrustEvaluate
hooking -
Native libraries (.so): hook native symbols or patch binary
10. Inspecting API Calls in Burp
What to inspect
-
Request URL & method (GET, POST, PUT, DELETE).
-
Request headers:
Authorization
, cookies,Content-Type
. -
Request body: JSON, form data, multipart, binary.
-
Response status codes, headers, and body.
-
Look for tokens, PII, API keys in bodies or query strings.
Useful Burp features
-
HTTP history — full request log.
-
Repeater — replay and modify requests manually.
-
Intruder — automated payloads (use responsibly with throttling).
-
Decoder / Comparer — analyze encodings and diffs.
-
Pretty-print JSON in response viewer.
Tests to try
-
Modify IDs (look for IDOR).
-
Tamper tokens or JWT claims.
-
Replay and change
user_id
or role fields. -
Test endpoints without auth or with expired tokens.
11. Advanced Analysis Tips
-
Compare mobile vs web client behaviour (often the same endpoints behave differently).
-
Inspect WebSockets (Burp Professional supports frames).
-
If the app encrypts payloads at application layer, reverse client crypto to decrypt.
-
Watch for rate limiting and throttling; test responsibly.
-
When payloads are compressed/binary, use hex view or export for offline analysis.
12. Troubleshooting — Common Pitfalls
-
Still failing after installing CA: App probably uses pinning or only trusts system CA. Try Frida or system CA with root.
-
Frida won’t attach: Check
frida-server
version matches Frida client, runfrida-server
as root, ensure correct process privileges. -
Anti-Frida protections: Some apps detect Frida; apply community bypass scripts or emulate expected environment.
-
Burp TLS errors: Verify SNI, TLS version/cipher compatibility, and that Burp listener uses proper IP.
-
Native pinning: May require native hooks or
.so
patching.
13. When Pinning Bypass Fails — Next Steps
-
Use jadx / apktool /
strings
to locate pinning logic and certificates. -
Inspect native libraries (
.so
files) for pinning in C/C++ code. -
Hook native JNI boundary or patch native functions.
-
Consider more advanced runtime instrumentation or patch + re-sign if legal and appropriate for lab testing.
14. Post-Intercept Analysis — What to Look For
-
Unencrypted sensitive data (passwords, tokens, PII).
-
Broken authorization (endpoints accessible without proper tokens).
-
Exposed secrets (hardcoded API keys).
-
Insecure endpoints (use of HTTP for sensitive operations).
-
Poor token handling (long-lived tokens, insecure refresh flows).
Deliverable evidence: saved requests, screenshots, and step-by-step reproduction steps.
15. Remediation Recommendations (Developer-facing)
-
Store secrets securely (Android Keystore, iOS Keychain).
-
Use TLS with modern ciphers, enable HSTS.
-
If using pinning: prefer public-key pinning with rotation and server-side fallback.
-
Avoid logging sensitive data in responses or client logs.
-
Enforce server-side authorization checks — never rely on client checks.
16. Quick Command & Snippet Cheat-Sheet
Burp CA export
ADB reverse
Start frida-server on device
Launch app with Frida
Objection
APK unpack / rebuild
17. Example End-to-End Workflow (Concise)
-
Setup Burp listener and export CA.
-
Configure device proxy → Install & trust Burp CA.
-
Attempt normal capture; if traffic appears, analyze in Burp.
-
If TLS blocked, launch
frida-server
and run Frida bypass script (or use Objection). -
Capture the decrypted requests/responses in Burp.
-
Document findings, collect evidence, and prepare remediation guidance.
18. Useful Tools & Resources (Self-Study)
-
Frida — dynamic instrumentation toolkit.
-
Objection — Frida-based runtime mobile exploration.
-
apktool / jadx — static Android analysis.
-
Burp Suite — proxy, repeater, intruder, history.
-
adb — Android device bridge.
-
iOS tooling — Frida + jailbreak tools for deeper instrumentation.
19. Closing Notes & Offer
Intercepting mobile traffic with Burp Suite is straightforward once devices trust your CA — the complexity is in bypassing modern pinning and protections. In lab engagements you’ll typically use a combination of Frida runtime hooks, static patching, and system CA tricks (root/jailbreak) to succeed.
If you want, I can immediately produce one of the following (pick one and I’ll write it here):
-
A one-page lab checklist (printable).
-
A polished Frida script set tailored to Android apps using OkHttp / TrustManager.
-
A report template for submitting findings to a dev team.
Comments
Post a Comment