Flutter
Tip
AWS Hacking’i öğrenin ve pratik yapın:
HackTricks Training AWS Red Team Expert (ARTE)
GCP Hacking’i öğrenin ve pratik yapın:HackTricks Training GCP Red Team Expert (GRTE)
Azure Hacking’i öğrenin ve pratik yapın:
HackTricks Training Azure Red Team Expert (AzRTE)
HackTricks'i Destekleyin
- abonelik planlarını kontrol edin!
- 💬 Discord grubuna veya telegram grubuna katılın ya da Twitter’da bizi takip edin 🐦 @hacktricks_live.**
- Hacking ipuçlarını paylaşmak için HackTricks ve HackTricks Cloud github reposuna PR gönderin.
Flutter is Google’s cross-platform UI toolkit that lets developers write a single Dart code-base which the Engine (native C/C++) turns into platform-specific machine code for Android & iOS. The Engine bundles a Dart VM, BoringSSL, Skia, etc., and ships as the shared library libflutter.so (Android) or Flutter.framework (iOS). All actual networking (DNS, sockets, TLS) happens inside this library, not in the usual Java/Kotlin Swift/Obj-C layers. That siloed design is why the usual Java-level Frida hooks fail on Flutter apps.
Intercepting HTTPS traffic in Flutter
This is a summary of this blog post.
Why HTTPS interception is tricky in Flutter
- SSL/TLS verification lives two layers down in BoringSSL, so Java SSL‐pinning bypasses don’t touch it.
- BoringSSL uses its own CA store inside libflutter.so; importing your Burp/ZAP CA into Android’s system store changes nothing.
- Symbols in libflutter.so are stripped & mangled, hiding the certificate-verification function from dynamic tools.
Fingerprint the exact Flutter stack
Knowing the version lets you re-build or pattern-match the right binaries.
| Step | Command / File | Outcome |
|---|---|---|
| Adım | Komut / Dosya | Sonuç |
| Get snapshot hash | python3 get_snapshot_hash.py libapp.so | adb4292f3ec25… |
| Map hash → Engine | enginehash list in reFlutter | Flutter 3 · 7 · 12 + engine commit 1a65d409… |
| Pull dependent commits | DEPS file in that engine commit | • dart_revision → Dart v2 · 19 · 6• dart_boringssl_rev → BoringSSL 87f316d7… |
Find get_snapshot_hash.py here.
Target: ssl_crypto_x509_session_verify_cert_chain()
- Located in
ssl_x509.ccinside BoringSSL. - Returns
bool– a singletrueis enough to bypass the whole certificate chain check. - Same function exists on every CPU arch; only the opcodes differ.
Seçenek A – Binary patching with reFlutter
- Clone the exact Engine & Dart sources for the app’s Flutter version.
- Regex-patch two hotspots:
- In
ssl_x509.cc, forcereturn 1; - (Optional) In
socket_android.cc, hard-code a proxy ("10.0.2.2:8080").
- Re-compile libflutter.so, drop it back into the APK/IPA, sign, install.
- Pre-patched builds for common versions are shipped in the reFlutter GitHub releases to save hours of build time.
Seçenek B – Live hooking with Frida (the “hard-core” path)
Because the symbol is stripped, you pattern-scan the loaded module for its first bytes, then change the return value on the fly.
// attach & locate libflutter.so
var flutter = Process.getModuleByName("libflutter.so");
// x86-64 pattern of the first 16 bytes of ssl_crypto_x509_session_verify_cert_chain
var sig = "55 41 57 41 56 41 55 41 54 53 48 83 EC 38 C6 02";
Memory.scan(flutter.base, flutter.size, sig, {
onMatch: function (addr) {
console.log("[+] found verifier at " + addr);
Interceptor.attach(addr, {
onLeave: function (retval) { retval.replace(0x1); } // always 'true'
});
},
onComplete: function () { console.log("scan done"); }
});
Çevirmemi istediğiniz “src/mobile-pentesting/android-app-pentesting/flutter.md” dosya içeriğini buraya yapıştırın veya metni gönderin.
frida -U -f com.example.app -l bypass.js
Portlama ipuçları
- For arm64-v8a or armv7, Ghidra’dan fonksiyonun ilk ~32 byte’ını alın, boşluklarla ayrılmış bir hex dizesine dönüştürün ve
sigile değiştirin. - Her Flutter sürümü için bir desen tutun, hızlı yeniden kullanım için bunları bir kısa başvuru listesinde saklayın.
Trafiği proxy’niz üzerinden zorlamak
Flutter kendisi cihaz proxy ayarlarını yok sayar. En kolay seçenekler:
- Android Studio emulator: Settings ▶ Proxy → manual.
- Physical device: evil Wi-Fi AP + DNS spoofing, veya
/etc/hostsdosyasını düzenleyen bir Magisk module.
Hızlı Flutter TLS bypass iş akışı (Frida Codeshare + system CA)
Sadece pinned Flutter API’sini gözlemlemeniz gerektiğinde, rooted/writable AVD, system-trusted proxy CA ve drop-in Frida script’i birleştirmek genellikle libflutter.so’yu reverse-engineer etmeye göre daha hızlıdır:
-
Proxy CA’nızı system store’a yükleyin. Burp’ın DER sertifikasını hash’leyip yeniden adlandırmak ve bunu
/system/etc/security/cacerts/içine push etmek için Install Burp Certificate rehberini izleyin (yazılabilir/systemgerekli). -
Eşleşen bir
frida-serverikilisini bırakın ve root olarak çalıştırın ki Flutter sürecine bağlanabilsin:
adb push frida-server-17.0.5-android-x86_64 /data/local/tmp/frida-server
adb shell "su -c 'chmod 755 /data/local/tmp/frida-server && /data/local/tmp/frida-server &'"
- Host tarafı araçlarını kurun ve hedef paketi listeleyin.
pip3 install frida-tools --break-system-packages
adb shell pm list packages -f | grep target
- Flutter uygulamasını, BoringSSL pin kontrollerini etkisiz hale getiren Codeshare hook ile başlatın.
frida -U -f com.example.target --codeshare TheDauntless/disable-flutter-tls-v1 --no-pause
The Codeshare script, Flutter TLS verifier’ı geçersiz kılar; böylece Burp’ın dinamik olarak oluşturduğu sertifikalar da dahil olmak üzere tüm sertifikalar kabul edilir ve public-key pin comparisons’ı atlatır.
-
Route traffic through your proxy. Emülatörün Wi‑Fi proxy GUI’sini yapılandırın veya
adb shell settings put global http_proxy 10.0.2.2:8080ile zorlayın; doğrudan yönlendirme başarısız olursaadb reverse tcp:8080 tcp:8080veya host-only VPN’e geri dönün. -
If the app ignores OS proxy settings, redirect sockets with a Frida shim. frida4burp gibi araçlar
dart:io/BoringSSL socket oluşturmayı hook’layarak dışa giden TCP oturumlarını proxy’inize zorlar, bu hardcodedHttpClient.findProxyFromEnvironmentveya Wi‑Fi bypass’leri olsa bile geçerlidir. Script’te proxy host/port’unu ayarlayın ve TLS bypass ile birlikte çalıştırın:
frida -U -f com.example.target --no-pause \
--codeshare TheDauntless/disable-flutter-tls-v1 \
-l frida4burp.js
Works on iOS via a Frida gadget or USB frida-server; chaining the socket redirect with the TLS bypass restores both routing and certificate acceptance for Burp/mitmproxy.
Once the CA is trusted at the OS layer and Frida quashes Flutter’s pinning logic (plus socket redirection if needed), Burp/mitmproxy regains full visibility for API fuzzing (BOLA, token tampering, etc.) without repacking the APK.
Offset-based hook of BoringSSL verification (no signature scan)
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:
- Extract the right-ABI library from the APK:
unzip -j app.apk "lib/*/libflutter.so" -d libs/and pick the one matching the device (e.g.,lib/x86_64/libflutter.so). - Analyze in Ghidra/IDA and locate the verifier:
- Source: BoringSSL ssl_x509.cc function
ssl_crypto_x509_session_verify_cert_chain(3 args, returns bool). - In stripped builds, use Search → For Strings →
ssl_client→ XREFs, then open each referencedFUN_...and pick the one with 3 pointer-like args and a boolean return. - Compute the runtime offset: take the function address shown by Ghidra and subtract the image base (e.g., Ghidra often shows
0x00100000for PIE Android ELFs). Example:0x02184644 - 0x00100000 = 0x02084644. - Hook at runtime by base + offset and force success:
// frida -U -f com.target.app -l bypass.js --no-pause
const base = Module.findBaseAddress('libflutter.so');
// Example offset from analysis. Recompute per build/arch.
const off = ptr('0x02084644');
const addr = base.add(off);
// ssl_crypto_x509_session_verify_cert_chain: 3 args, bool return
Interceptor.replace(addr, new NativeCallback(function (a, b, c) {
return 1; // true
}, 'int', ['pointer', 'pointer', 'pointer']));
console.log('[+] Hooked BoringSSL verify_cert_chain at', addr);
Notlar
- İmza taramaları ARM’da başarılı olabilir ancak opcode düzeni değiştiği için x86_64’te kaçırılabilir; bu offset yöntemi, RVA’yı yeniden hesapladığınız sürece mimariden bağımsızdır.
- Bu bypass, BoringSSL’in herhangi bir zinciri kabul etmesine neden olur; bu da Flutter içindeki pins/CA güvenine bakılmaksızın HTTPS MITM’e izin verir.
- TLS engellemesini doğrulamak için hata ayıklama sırasında trafiği zorla yönlendirirseniz, örneğin:
iptables -t nat -A OUTPUT -p tcp -j DNAT --to-destination <Burp_IP>:<Burp_Port>
…yine de yukarıdaki hook’a ihtiyacınız olacak, çünkü doğrulama libflutter.so içinde gerçekleşir, Android’in sistem güven deposunda değil.
Referanslar
- https://sensepost.com/blog/2025/intercepting-https-communication-in-flutter-going-full-hardcore-mode-with-frida/
- Flutter SSL Bypass: How to Intercept HTTPS Traffic When all other Frida Scripts Fail (vercel)
- Flutter SSL Bypass: How to Intercept HTTPS Traffic When all other Frida Scripts Fail (medium)
- PoC Frida hook for Flutter SSL bypass
- BoringSSL ssl_x509.cc (ssl_crypto_x509_session_verify_cert_chain)
- SSL Pinning Bypass – Android
- Practical Mobile Traffic Interception
Tip
AWS Hacking’i öğrenin ve pratik yapın:
HackTricks Training AWS Red Team Expert (ARTE)
GCP Hacking’i öğrenin ve pratik yapın:HackTricks Training GCP Red Team Expert (GRTE)
Azure Hacking’i öğrenin ve pratik yapın:
HackTricks Training Azure Red Team Expert (AzRTE)
HackTricks'i Destekleyin
- abonelik planlarını kontrol edin!
- 💬 Discord grubuna veya telegram grubuna katılın ya da Twitter’da bizi takip edin 🐦 @hacktricks_live.**
- Hacking ipuçlarını paylaşmak için HackTricks ve HackTricks Cloud github reposuna PR gönderin.


