Skip to content

Commit aec417f

Browse files
authored
Merge pull request #1616 from HackTricks-wiki/update_SSL_Pinning_Bypass___Android_20251128_123757
SSL Pinning Bypass – Android
2 parents 2d58952 + 9603069 commit aec417f

File tree

1 file changed

+32
-0
lines changed
  • src/mobile-pentesting/android-app-pentesting

1 file changed

+32
-0
lines changed

src/mobile-pentesting/android-app-pentesting/flutter.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,37 @@ Flutter itself **ignores device proxy settings**. Easiest options:
7474
* **Android Studio emulator:** Settings ▶ Proxy → manual.
7575
* **Physical device:** evil Wi-Fi AP + DNS spoofing, or Magisk module editing `/etc/hosts`.
7676

77+
### Quick Flutter TLS bypass workflow (Frida Codeshare + system CA)
78+
When you only need to observe a pinned Flutter API, combining a rooted/writable AVD, a system-trusted proxy CA, and a drop-in Frida script is often faster than reverse-engineering libflutter.so:
79+
80+
1. **Install your proxy CA in the system store.** Follow [Install Burp Certificate](install-burp-certificate.md) to hash/rename Burp's DER certificate and push it into `/system/etc/security/cacerts/` (writable `/system` required).
81+
82+
2. **Drop a matching `frida-server` binary and run it as root** so it can attach to the Flutter process:
83+
84+
```bash
85+
adb push frida-server-17.0.5-android-x86_64 /data/local/tmp/frida-server
86+
adb shell "su -c 'chmod 755 /data/local/tmp/frida-server && /data/local/tmp/frida-server &'"
87+
```
88+
89+
3. **Install the host-side tooling and enumerate the target package.**
90+
91+
```bash
92+
pip3 install frida-tools --break-system-packages
93+
adb shell pm list packages -f | grep target
94+
```
95+
96+
4. **Spawn the Flutter app with the Codeshare hook that neuters BoringSSL pin checks.**
97+
98+
```bash
99+
frida -U -f com.example.target --codeshare TheDauntless/disable-flutter-tls-v1 --no-pause
100+
```
101+
102+
The Codeshare script overrides the Flutter TLS verifier so every certificate (including Burp's dynamically generated ones) is accepted, side-stepping public-key pin comparisons.
103+
104+
5. **Route traffic through your proxy.** Configure the emulator Wi-Fi proxy GUI or enforce it via `adb shell settings put global http_proxy 10.0.2.2:8080`; if direct routing fails, fall back to `adb reverse tcp:8080 tcp:8080` or a host-only VPN.
105+
106+
Once the CA is trusted at the OS layer and Frida quashes Flutter's pinning logic, Burp/mitmproxy regains full visibility for API fuzzing (BOLA, token tampering, etc.) without repacking the APK.
107+
77108
### Offset-based hook of BoringSSL verification (no signature scan)
78109
When pattern-based scripts fail across architectures (e.g., x86_64 vs ARM), directly hook the BoringSSL chain verifier by absolute address within libflutter.so. Workflow:
79110

@@ -114,6 +145,7 @@ iptables -t nat -A OUTPUT -p tcp -j DNAT --to-destination <Burp_IP>:<Burp_Port>
114145
- [https://sensepost.com/blog/2025/intercepting-https-communication-in-flutter-going-full-hardcore-mode-with-frida/](https://sensepost.com/blog/2025/intercepting-https-communication-in-flutter-going-full-hardcore-mode-with-frida/)
115146
- [Flutter SSL Bypass: How to Intercept HTTPS Traffic When all other Frida Scripts Fail](https://m4kr0x.medium.com/flutter-tls-bypass-how-to-intercept-https-traffic-when-all-other-frida-scripts-fail-bd3d04489088)
116147
- [BoringSSL ssl_x509.cc (ssl_crypto_x509_session_verify_cert_chain)](https://github.com/google/boringssl/blob/main/ssl/ssl_x509.cc#L238)
148+
- [SSL Pinning Bypass – Android](https://hardsoftsecurity.es/index.php/2025/11/26/ssl-pinning-bypass-android/)
117149

118150

119151
{{#include ../../banners/hacktricks-training.md}}

0 commit comments

Comments
 (0)