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 का क्रॉस-प्लेटफ़ॉर्म UI toolkit है जो developers को एक ही Dart कोड-बेस लिखने देता है जिसे Engine (native C/C++) Android & iOS के लिए platform-specific मशीन कोड में बदल देता है। Engine में Dart VM, BoringSSL, Skia आदि बंडल होते हैं और यह shared library libflutter.so (Android) या Flutter.framework (iOS) के रूप में वितरित होता है। सारा वास्तविक नेटवर्किंग (DNS, sockets, TLS) इस लाइब्रेरी के अंदर होता है, नहीं सामान्य Java/Kotlin Swift/Obj-C लेयर्स में। यही साइलो डिज़ाइन का कारण है कि सामान्य Java-स्तर के Frida hooks Flutter ऐप्स पर विफल होते हैं।
Flutter में HTTPS ट्रैफिक को इंटरसेप्ट करना
यह इस blog post का सारांश है।
Flutter में HTTPS इंटरसेप्शन मुश्किल क्यों है
- SSL/TLS verification BoringSSL में दो लेयर नीचे रहता है, इसलिए Java SSL‐pinning bypasses इसे प्रभावित नहीं करते।
- BoringSSL अपने खुद के CA स्टोर का उपयोग करता है libflutter.so के अंदर; अपना Burp/ZAP CA Android के system store में इम्पोर्ट करने से कुछ नहीं बदलता।
- libflutter.so में symbols stripped & mangled होते हैं, जिससे certificate-verification function dynamic tools से छिप जाता है।
सटीक Flutter स्टैक का फ़िंगरप्रिंट लें
Version जानने से आप सही binaries को re-build या pattern-match कर सकते हैं।
| 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… |
Find get_snapshot_hash.py here.
लक्ष्य: ssl_crypto_x509_session_verify_cert_chain()
- Located in
ssl_x509.ccinside BoringSSL. - Returns
bool– एक हीtrueपूरे certificate chain चेक को bypass करने के लिए काफी है। - यही function हर CPU arch पर मौजूद होता है; केवल opcodes भिन्न होते हैं।
Option A – Binary patching with reFlutter
- Clone app के Flutter version के लिए exact Engine & Dart sources।
- Regex-patch दो 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, इसे वापस APK/IPA में ड्रॉप करें, sign करें, install करें।
- Common versions के लिए Pre-patched builds reFlutter GitHub releases में भेजे जाते हैं ताकि build time के घंटों की बचत हो सके।
Option B – Live hooking with Frida (the “hard-core” path)
क्योंकि symbol stripped है, आप loaded module के पहले 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 access to your repository. Paste the contents of src/mobile-pentesting/android-app-pentesting/flutter.md here (or upload the file), and I’ll translate the English text to Hindi following your rules.
frida -U -f com.example.app -l bypass.js
Porting tips
- For arm64-v8a or armv7, Ghidra से फ़ंक्शन के पहले ~32 बाइट निकालें, उन्हें space-separated hex string में कन्वर्ट करें, और
sigको बदलें। - Keep one pattern per Flutter release, उन्हें तेज़ पुन: उपयोग के लिए cheat-sheet में स्टोर करें।
Forcing traffic through your proxy
Flutter itself ignores device proxy settings. Easiest options:
- Android Studio emulator: Settings ▶ Proxy → manual.
- Physical device: evil Wi-Fi AP + DNS spoofing, या Magisk module से
/etc/hostsसंपादित करना।
Quick Flutter TLS bypass workflow (Frida Codeshare + system CA)
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:
-
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 स्क्रिप्ट Flutter TLS verifier को ओवरराइड करता है ताकि every certificate (Burp के dynamically generated ones सहित) स्वीकार हो जाएँ, और public-key pin comparisons को side-step कर दिया जाए।
- अपने proxy के माध्यम से ट्रैफ़िक रूट करें। emulator Wi-Fi proxy GUI को configure करें या इसे लागू करें via
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 करें।
एक बार CA OS लेयर पर trusted हो और Frida Flutter की pinning logic को quash कर दे, तो Burp/mitmproxy बिना APK को repack किए API fuzzing (BOLA, token tampering, आदि) के लिए पूरी visibility प्राप्त कर लेते हैं।
BoringSSL verification का Offset-based hook (no signature scan)
जब pattern-based scripts architectures के बीच fail कर जाएँ (e.g., x86_64 vs ARM), तो libflutter.so के अंदर absolute address से सीधे BoringSSL chain verifier को hook करें। Workflow:
- APK से सही-ABI library निकालें:
unzip -j app.apk "lib/*/libflutter.so" -d libs/और उस एक को चुनें जो device से मेल खाती हो (e.g.,lib/x86_64/libflutter.so). - Ghidra/IDA में analyze करें और verifier को locate करें:
- Source: BoringSSL ssl_x509.cc function
ssl_crypto_x509_session_verify_cert_chain(3 args, returns bool). - Stripped builds में, string
"ssl_client"को search करें और XREFs inspect करें; उस function की पहचान करें जो तीन pointer-like args लेता है और boolean return करता है। - Runtime offset compute करें: Ghidra में दिखे function address को लें और analysis के दौरान उपयोग किए गए image base को subtract करें ताकि relative offset (RVA) मिले। Example:
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);
Notes
- प्रत्येक target build और CPU architecture के लिए offset को पुनर्गणना करें; compiler/codegen के अंतर हार्डकोड किए गए signatures को तोड़ देते हैं।
- यह bypass BoringSSL को किसी भी chain को स्वीकार करने के लिए मजबूर करता है, जिससे Flutter के अंदर pins/CA trust की परवाह किए बिना HTTPS MITM सक्षम हो जाता है।
- यदि आप debugging के दौरान ट्रैफ़िक को force-route करते हैं ताकि TLS blocking की पुष्टि कर सकें, e.g.:
iptables -t nat -A OUTPUT -p tcp -j DNAT --to-destination <Burp_IP>:<Burp_Port>
…आपको ऊपर दिया गया hook अभी भी चाहिए होगा, क्योंकि सत्यापन libflutter.so के अंदर होता है, न कि Android’s 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
- 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 सबमिट करें।
HackTricks

