Flutter
Tip
AWS हैकिंग सीखें और अभ्यास करें:
HackTricks Training AWS Red Team Expert (ARTE)
GCP हैकिंग सीखें और अभ्यास करें:HackTricks Training GCP Red Team Expert (GRTE)
Azure हैकिंग सीखें और अभ्यास करें:
HackTricks Training Azure Red Team Expert (AzRTE)
HackTricks का समर्थन करें
- सदस्यता योजनाओं की जांच करें!
- हमारे 💬 Discord समूह या टेलीग्राम समूह में शामिल हों या हमें Twitter 🐦 @hacktricks_live** पर फॉलो करें।**
- हैकिंग ट्रिक्स साझा करें और HackTricks और HackTricks Cloud गिटहब रिपोजिटरी में PRs सबमिट करें।
Flutter Google का cross-platform UI toolkit है जो developers को एक single Dart code-base लिखने देता है जिसे Engine (native C/C++) platform-specific machine code में बदल देता है Android & iOS के लिए। Engine में एक Dart VM, BoringSSL, Skia आदि बंडल होते हैं, और यह shared library libflutter.so (Android) या Flutter.framework (iOS) के रूप में शिप होता है। सारा वास्तविक networking (DNS, sockets, TLS) इस लाइब्रेरी के अंदर होता है, न कि सामान्य Java/Kotlin या Swift/Obj-C लेयर्स में। यह siloed डिज़ाइन ही वजह है कि सामान्य Java-स्तर के Frida hooks Flutter apps पर फेल हो जाते हैं।
Intercepting HTTPS traffic in Flutter
यह इस blog post का सार है।
Why HTTPS interception is tricky in Flutter
- SSL/TLS verification lives two layers down in BoringSSL, इसलिए Java SSL‐pinning bypasses इसे प्रभावित नहीं करते।
- BoringSSL uses its own CA store inside libflutter.so; अपना Burp/ZAP CA Android’s system store में इम्पोर्ट करने से कुछ नहीं बदलता।
- libflutter.so में symbols stripped & mangled होते हैं, जो certificate-verification function को dynamic tools से छुपा देते हैं।
Fingerprint the exact Flutter stack
version जानने से आप सही binaries को re-build या pattern-match कर सकते हैं।
| Step | Command / File | Outcome |
|---|---|---|
| Snapshot hash प्राप्त करें | python3 get_snapshot_hash.py libapp.so | adb4292f3ec25… |
| Hash को Engine से map करें | enginehash list in reFlutter | Flutter 3 · 7 · 12 + engine commit 1a65d409… |
| निर्भर 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– एक singletrueपूरे certificate chain check को bypass करने के लिए पर्याप्त है। - वही function हर CPU arch पर मौजूद है; केवल opcodes अलग होते हैं।
Option A – Binary patching with reFlutter
- ऐप के Flutter version के लिए exact Engine & Dart sources clone करें।
- दो hotspots को regex-patch करें:
ssl_x509.ccमें,return 1;जबरदस्ती करें- (Optional)
socket_android.ccमें proxy hard-code करें ("10.0.2.2:8080").
- libflutter.so re-compile करें, APK/IPA में वापस डालें, sign करें, install करें।
- आम versions के लिए pre-patched builds reFlutter GitHub releases में उपलब्ध हैं ताकि build time बच सके।
### Option B – Live hooking with Frida (the “hard-core” path) क्योंकि symbol stripped है, आप loaded module में उसके first bytes के लिए pattern-scan करते हैं, और फिर चलते समय return value बदल देते हैं।
// 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"); }
});
I don’t have the contents of src/mobile-pentesting/android-app-pentesting/flutter.md. Paste the file content here (or the part you want translated) and I’ll translate it to Hindi following your rules.
frida -U -f com.example.app -l bypass.js
पोर्टिंग सुझाव
- For arm64-v8a or armv7, Ghidra से फ़ंक्शन के पहले ~32 बाइट लें, उन्हें एक space-separated hex string में बदलें, और
sigको बदलें। - प्रत्येक Flutter release के लिए एक पैटर्न रखें, तेज़ पुन:प्रयोग के लिए इन्हें एक cheat-sheet में स्टोर करें।
अपने proxy के माध्यम से ट्रैफ़िक भेजना
Flutter स्वयं device proxy settings को ignore करता है। सबसे आसान विकल्प:
- Android Studio emulator: Settings ▶ Proxy → manual.
- Physical device: evil Wi-Fi AP + DNS spoofing, या Magisk module से
/etc/hostsसंपादित करना।
Quick Flutter TLS bypass वर्कफ़्लो (Frida Codeshare + system CA)
जब आपको केवल किसी pinned Flutter API का निरीक्षण करना हो, तो rooted/writable AVD, एक system-trusted proxy CA, और एक drop-in Frida script को मिलाना अक्सर libflutter.so को reverse-engineer करने से तेज़ होता है:
-
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 &'"
- host-side tooling इंस्टॉल करें और target package को enumerate करें।
pip3 install frida-tools --break-system-packages
adb shell pm list packages -f | grep target
- Codeshare hook के साथ Flutter app को spawn करें जो BoringSSL pin checks को निष्क्रिय कर देता है.
frida -U -f com.example.target --codeshare TheDauntless/disable-flutter-tls-v1 --no-pause
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.
- Route traffic through your proxy. Emulator के Wi-Fi proxy GUI को configure करें या इसे मजबूर करने के लिए
adb shell settings put global http_proxy 10.0.2.2:8080चलाएँ; अगर direct routing fail करे तोadb reverse tcp:8080 tcp:8080या host-only VPN का fallback लें।
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.
Offset-based hook of BoringSSL verification (no signature scan)
जब pattern-based scripts architectures (e.g., x86_64 vs ARM) में fail कर जाएँ, तो libflutter.so के भीतर absolute address द्वारा सीधे BoringSSL chain verifier को hook करें। Workflow:
- APK से right-ABI library निकालें:
unzip -j app.apk "lib/*/libflutter.so" -d libs/और उस एक को चुनें जो device से मेल खाती हो (e.g.,lib/x86_64/libflutter.so). - Ghidra/IDA में analyze करें और verifier को locate करें:
- स्रोत: 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, फिर प्रत्येक referencedFUN_...खोलें और उस फ़ंक्शन को चुनें जिसकी 3 pointer-like args हों और boolean return हो। - runtime offset compute करें: Ghidra में दिख रही function address लें और image base घटाएँ (उदाहरण के लिए, Ghidra अक्सर PIE Android ELFs के लिए
0x00100000दिखाता है)। उदाहरण:0x02184644 - 0x00100000 = 0x02084644. - runtime पर base + offset पर hook करें और success को force करें:
// 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);
नोट्स
- Signature scans ARM पर सफल हो सकते हैं लेकिन x86_64 पर मिस कर सकते हैं क्योंकि opcode layout बदल जाता है; यह offset method architecture-agnostic है जब तक आप RVA पुन:गणना करते हैं।
- यह bypass BoringSSL को किसी भी chain को accept करने के लिए मजबूर करता है, जिससे Flutter के अंदर pins/CA trust की परवाह किए बिना HTTPS MITM संभव हो जाता है।
- यदि आप debugging के दौरान TLS blocking की पुष्टि करने के लिए force-route traffic करते हैं, उदाहरण के लिए:
iptables -t nat -A OUTPUT -p tcp -j DNAT --to-destination <Burp_IP>:<Burp_Port>
…तब भी आपको ऊपर दिया गया hook चाहिए होगा, क्योंकि सत्यापन libflutter.so के अंदर होता है, न कि Android के system trust store में।
संदर्भ
- 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
Tip
AWS हैकिंग सीखें और अभ्यास करें:
HackTricks Training AWS Red Team Expert (ARTE)
GCP हैकिंग सीखें और अभ्यास करें:HackTricks Training GCP Red Team Expert (GRTE)
Azure हैकिंग सीखें और अभ्यास करें:
HackTricks Training Azure Red Team Expert (AzRTE)
HackTricks का समर्थन करें
- सदस्यता योजनाओं की जांच करें!
- हमारे 💬 Discord समूह या टेलीग्राम समूह में शामिल हों या हमें Twitter 🐦 @hacktricks_live** पर फॉलो करें।**
- हैकिंग ट्रिक्स साझा करें और HackTricks और HackTricks Cloud गिटहब रिपोजिटरी में PRs सबमिट करें।


