Flutter
Tip
Apprenez et pratiquez le hacking AWS :
HackTricks Training AWS Red Team Expert (ARTE)
Apprenez et pratiquez le hacking GCP :HackTricks Training GCP Red Team Expert (GRTE)
Apprenez et pratiquez le hacking Azure :
HackTricks Training Azure Red Team Expert (AzRTE)
Soutenir HackTricks
- Vérifiez les plans d’abonnement !
- Rejoignez le 💬 groupe Discord ou le groupe telegram ou suivez-nous sur Twitter 🐦 @hacktricks_live.
- Partagez des astuces de hacking en soumettant des PR au HackTricks et HackTricks Cloud dépôts github.
Flutter est Google’s cross-platform UI toolkit qui permet aux développeurs d’écrire une seule base de code Dart que l’Engine (C/C++ natif) transforme en code machine spécifique à la plateforme pour Android & iOS. L’Engine embarque un Dart VM, BoringSSL, Skia, etc., et est livré sous forme de bibliothèque partagée libflutter.so (Android) ou Flutter.framework (iOS). Tout le réseau réel (DNS, sockets, TLS) s’effectue à l’intérieur de cette bibliothèque, et non dans les couches Java/Kotlin Swift/Obj-C habituelles. Cette conception cloisonnée explique pourquoi les hooks Frida au niveau Java habituels échouent sur les apps Flutter.
Intercepting HTTPS traffic in Flutter
Ceci est un résumé de cet 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
Connaître la version permet de reconstruire ou d’effectuer un pattern-match sur les bons binaires.
| Step | Command / File | Outcome |
|---|---|---|
| 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… |
Trouvez get_snapshot_hash.py.
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.
Option 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.
### Option 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"); }
});
Je n’ai pas le contenu du fichier. Veuillez coller le contenu de src/mobile-pentesting/android-app-pentesting/flutter.md ici (ou envoyer le texte à traduire). Je procéderai à la traduction en respectant vos consignes (ne pas traduire code, tags, liens, chemins, etc.).
frida -U -f com.example.app -l bypass.js
Conseils de portage
- Pour arm64-v8a ou armv7, récupérez les ~32 premiers octets de la fonction depuis Ghidra, convertissez-les en une chaîne hex séparée par des espaces, et remplacez
sig. - Conservez un pattern par release de Flutter, stockez-les dans une cheat-sheet pour réutilisation rapide.
Forcer le trafic via votre proxy
Flutter lui-même ignore les device proxy settings. Options les plus simples :
- Android Studio emulator: Settings ▶ Proxy → manual.
- Physical device: evil Wi-Fi AP + DNS spoofing, or Magisk module editing
/etc/hosts.
Quick Flutter TLS bypass workflow (Frida Codeshare + system CA)
Quand vous n’avez besoin que d’observer une API Flutter pinned, combiner un AVD rooted/writable, une system-trusted proxy CA, et un script Frida drop-in est souvent plus rapide que le reverse-engineering de libflutter.so:
-
Install your proxy CA in the system store. Follow Install Burp Certificate to hash/rename Burp’s DER certificate and push it into
/system/etc/security/cacerts/(writable/systemrequired). -
Drop a matching
frida-serverbinary and run it as root so it can attach to the Flutter process:
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 &'"
- Installez les outils côté hôte et énumérez le paquet cible.
pip3 install frida-tools --break-system-packages
adb shell pm list packages -f | grep target
- Spawn l’application Flutter avec le hook Codeshare qui neutralise les pin checks de BoringSSL.
frida -U -f com.example.target --codeshare TheDauntless/disable-flutter-tls-v1 --no-pause
Le script Codeshare remplace le vérificateur TLS de Flutter de sorte que chaque certificat (y compris ceux générés dynamiquement par Burp) est accepté, contournant les public-key pin comparisons.
- Route traffic through your proxy. Configurez le proxy Wi‑Fi de l’émulateur via l’interface ou imposez-le avec
adb shell settings put global http_proxy 10.0.2.2:8080; si le routage direct échoue, revenez àadb reverse tcp:8080 tcp:8080ou utilisez un VPN host-only.
Une fois que la CA est confiée au niveau OS et que Frida neutralise la logique de pinning de Flutter, Burp/mitmproxy retrouve une visibilité complète pour l’API fuzzing (BOLA, token tampering, etc.) sans repacker l’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). - Dans les builds sans symboles, recherchez la chaîne
"ssl_client"et inspectez les XREFs ; identifiez la fonction prenant trois arguments de type pointer et retournant un booléen. - Compute the runtime offset: take the function address shown by Ghidra and subtract the image base used during analysis to get the relative offset (RVA). 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);
- Recalculez l’offset pour chaque build cible et architecture CPU ; les différences de compilateur/codegen cassent les signatures codées en dur.
- Ce contournement fait que BoringSSL accepte n’importe quelle chaîne, permettant un HTTPS MITM indépendamment des pins/confiance CA dans Flutter.
- Si vous forcez le routage du trafic pendant le débogage pour confirmer le blocage TLS, par exemple :
iptables -t nat -A OUTPUT -p tcp -j DNAT --to-destination <Burp_IP>:<Burp_Port>
…vous aurez toujours besoin du hook ci‑dessus, car la vérification se fait à l’intérieur de libflutter.so, et non dans le magasin de certificats système d’Android.
Références
- 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
- BoringSSL ssl_x509.cc (ssl_crypto_x509_session_verify_cert_chain)
- SSL Pinning Bypass – Android
Tip
Apprenez et pratiquez le hacking AWS :
HackTricks Training AWS Red Team Expert (ARTE)
Apprenez et pratiquez le hacking GCP :HackTricks Training GCP Red Team Expert (GRTE)
Apprenez et pratiquez le hacking Azure :
HackTricks Training Azure Red Team Expert (AzRTE)
Soutenir HackTricks
- Vérifiez les plans d’abonnement !
- Rejoignez le 💬 groupe Discord ou le groupe telegram ou suivez-nous sur Twitter 🐦 @hacktricks_live.
- Partagez des astuces de hacking en soumettant des PR au HackTricks et HackTricks Cloud dépôts github.
HackTricks

