--- name: android-ssl-pinning-bypass description: Bypass Android certificate pinning four ways — objection/Frida runtime hooks (universal unpinning scripts), network-security-config user-CA patch, API-23 downgrade, and reversing custom TrustManager/OkHttp pinning. Tier 1. Use when proxied HTTPS fails due to pinning. Aligns to OWASP MASTG MASVS-NETWORK. --- # Android Certificate Pinning Bypass Pinning hides the backend from your proxy. Defeat it so you can test the API — the real impact lives there. ## Trigger phrases `ssl pinning, certificate pinning, pinning bypass, objection sslpinning, frida unpinning, trustmanager, okhttp certificatepinner, network security config user ca` ## Method (four approaches — try in order) 1. **A — objection + Frida (runtime hook, fastest):** - Rooted/Frida-server device: `objection -g explore` → `android sslpinning disable`. - No root: `objection patchapk -s target.apk && adb install target.objection.apk`, then the same. - Universal Frida scripts: - `frida -U -f --codeshare pcipolloni/universal-android-ssl-pinning-bypass-with-frida --no-pause` - `frida -U -f --codeshare akabe1/frida-multiple-unpinning --no-pause` 2. **B — trust user CA via network-security-config (API 24+):** patch `res/xml/network_security_config.xml`: ```xml ``` repackage (`apktool b` + `uber-apk-signer`) and install. 3. **C — API-23 downgrade:** lower `minSdk`/`targetSdk` to 23 in the manifest so the user CA store is trusted by default; repackage. 4. **D — reverse custom pinning:** `d2j-dex2jar app.apk` → JD-GUI, find the validation method; or `objection` → `android hooking search classes TrustManager` and hook `OkHttp CertificatePinner` / `TrustManagerImpl.verifyChain`. ## Modern / rare techniques - **Native / BoringSSL pinning** (incl. Flutter) — hook `SSL_CTX_set_custom_verify` with Frida (see `android-native-lib-analysis`, `android-crossplatform-flutter-rn-xamarin`). - **Spawn-gating** (`frida -f ... --no-pause`) to beat pinning set up at startup before you can attach. - Combine with `android-root-antidebug-bypass` when the app also detects root/Frida and refuses to run. ## Bypass / evasion If the app kills itself under Frida, apply anti-root/anti-Frida hooks first (`android-root-antidebug-bypass`), then unpin; for gadget-injected (non-root) flows use `objection patchapk`. ## Escalation / chaining Unlocks the entire backend for `android-network-cleartext-tls` and `android-backend-api-testing`/`api-security` — do this early. Also enables MITM content injection for `android-webview-attacks`. ## Backend & tooling Preferred Kali path (native Kali / WSL+Kali / Kali-SSH / Kali-MCP / HexStrike). Needs the user's device/emulator (Frida-server matching arch, or objection patchapk) + Burp/mitmproxy; route through Burp if a Burp MCP is present. Windows-local last resort. See `zazy-orchestrator`. ## Verification (background, before reporting) Confirm previously-pinned HTTPS traffic is now visible in the proxy (a real request/response appears) after the hook/patch — that is the verification. Re-confirm the channel stays intercepted across app restart. ## Evidence Which method worked, the hook/patch applied, and proxied traffic from the "protected" channel. Remediation note: pinning alone is not anti-tamper — combine with root/Frida detection, integrity checks, and attestation.