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 ์ง์ํ๊ธฐ
- ๊ตฌ๋ ๊ณํ ํ์ธํ๊ธฐ!
- **๐ฌ ๋์ค์ฝ๋ ๊ทธ๋ฃน ๋๋ ํ ๋ ๊ทธ๋จ ๊ทธ๋ฃน์ ์ฐธ์ฌํ๊ฑฐ๋ ํธ์ํฐ ๐ฆ @hacktricks_live๋ฅผ ํ๋ก์ฐํ์ธ์.
- HackTricks ๋ฐ HackTricks Cloud ๊นํ๋ธ ๋ฆฌํฌ์งํ ๋ฆฌ์ PR์ ์ ์ถํ์ฌ ํดํน ํธ๋ฆญ์ ๊ณต์ ํ์ธ์.
Flutter๋ Google์ ํฌ๋ก์ค-ํ๋ซํผ UI ํดํท์ผ๋ก, ๊ฐ๋ฐ์๊ฐ ๋จ์ผ Dart ์ฝ๋๋ฒ ์ด์ค๋ฅผ ์์ฑํ๋ฉด Engine (๋ค์ดํฐ๋ธ C/C++)์ด ์ด๋ฅผ Android ๋ฐ iOS์ฉ ํ๋ซํผ๋ณ ๋จธ์ ์ฝ๋๋ก ๋ณํํฉ๋๋ค. Engine์๋ Dart VM, BoringSSL, Skia ๋ฑ์ด ํฌํจ๋์ด ์์ผ๋ฉฐ, ๊ณต์ ๋ผ์ด๋ธ๋ฌ๋ฆฌ libflutter.so (Android) ๋๋ Flutter.framework (iOS)๋ก ๋ฐฐํฌ๋ฉ๋๋ค. ์ค์ ๋คํธ์ํน(DNS, sockets, TLS)์ ๋ชจ๋ ์ด ๋ผ์ด๋ธ๋ฌ๋ฆฌ ๋ด๋ถ์์ ๋ฐ์ํ๋ฉฐ, ์ผ๋ฐ์ ์ธ Java/Kotlin Swift/Obj-C ๋ ์ด์ด์์๋ ์ผ์ด๋์ง ์์ต๋๋ค. ์ด๋ฌํ ๋ถ๋ฆฌ๋ ์ค๊ณ ๋๋ฌธ์ ๊ธฐ์กด์ Java ์์ค Frida ํํน์ Flutter ์ฑ์์ ๋์ํ์ง ์์ต๋๋ค.
Flutter์์ HTTPS ํธ๋ํฝ ๊ฐ๋ก์ฑ๊ธฐ
์ด๊ฒ์ ์ด blog post์ ์์ฝ์ ๋๋ค.
Flutter์์ HTTPS ๊ฐ๋ก์ฑ๊ธฐ๊ฐ ๊น๋ค๋ก์ด ์ด์
- 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.
์ ํํ Flutter ์คํ ์๋ณ
๋ฒ์ ์ ์๋ฉด ์ฌ๋ฐ๋ฅธ ๋ฐ์ด๋๋ฆฌ๋ฅผ ์ฌ๋น๋ํ๊ฑฐ๋ ํจํด ๋งค์นญํ ์ ์์ต๋๋ค.
| Step | Command / File | Outcome |
|---|---|---|
| ์ค๋ ์ท ํด์ ๊ฐ์ ธ์ค๊ธฐ | python3 get_snapshot_hash.py libapp.so | adb4292f3ec25โฆ |
| ํด์ โ Engine ๋งคํ | reFlutter์ enginehash ๋ฆฌ์คํธ | Flutter 3 ยท 7 ยท 12 + engine commit 1a65d409โฆ |
| ์ข ์ ์ปค๋ฐ ๊ฐ์ ธ์ค๊ธฐ | ํด๋น engine ์ปค๋ฐ์ DEPS ํ์ผ | โข 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โ 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:
ssl_x509.cc์์return 1;์ ๊ฐ์ ํฉ๋๋ค.- (Optional)
socket_android.cc์์ ํ๋ก์๋ฅผ ํ๋์ฝ๋ฉ("10.0.2.2:8080").
- libflutter.so๋ฅผ Re-compileํ๊ณ , APK/IPA๋ก ๋ค์ ๋ฃ์ด ์๋ช ํ ์ค์นํฉ๋๋ค.
- Pre-patched builds๋ ๋น๋ ์๊ฐ์ ์ ์ฝํ๊ธฐ ์ํด reFlutter GitHub ๋ฆด๋ฆฌ์ค์ ์ผ๋ฐ ๋ฒ์ ์ฉ์ผ๋ก ์ ๊ณต๋ฉ๋๋ค.
Option B โ Live hooking with Frida (the โhard-coreโ path)
์ฌ๋ณผ์ด stripped๋์ด ์๊ธฐ ๋๋ฌธ์, ๋ก๋๋ ๋ชจ๋์์ ํด๋น ํจ์์ ์ฒซ ๋ฐ์ดํธ๋ฅผ pattern-scanํ ๋ค์ ๋ฐํ ๊ฐ์ ์ค์๊ฐ์ผ๋ก ๋ณ๊ฒฝํฉ๋๋ค.
// 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"); }
});
๋ฒ์ญํ src/mobile-pentesting/android-app-pentesting/flutter.md ํ์ผ์ ๋ด์ฉ์ ๋ถ์ฌ๋ฃ์ด ์ฃผ์ธ์(๋๋ ํ์ผ ์ ์ฒด๋ฅผ ์ ๊ณต). ์ ๊ณตํ์ ๋ด์ฉ์ ์ง์นจ์ ๋ฐ๋ผ ํ๊ตญ์ด๋ก ๋ฒ์ญํด ๋๋ฆฝ๋๋ค.
frida -U -f com.example.app -l bypass.js
ํฌํ ํ
- For arm64-v8a or armv7, Ghidra์์ ํจ์์ ์ฒ์ ์ฝ 32๋ฐ์ดํธ๋ฅผ ๊ฐ์ ธ์ ๊ณต๋ฐฑ์ผ๋ก ๊ตฌ๋ถ๋ 16์ง์ ๋ฌธ์์ด๋ก ๋ณํํ ๋ค
sig๋ฅผ ๊ต์ฒดํ์ธ์. - ๊ฐ Flutter release๋น ํ๋์ ํจํด์ ์ ์งํ๊ณ , ๋น ๋ฅธ ์ฌ์ฌ์ฉ์ ์ํด ์นํธ์ํธ์ ์ ์ฅํ์ธ์.
ํ๋ก์๋ฅผ ํตํ ํธ๋ํฝ ๊ฐ์ ์ ๋ฌ
Flutter ์์ฒด๋ ๊ธฐ๊ธฐ ํ๋ก์ ์ค์ ์ ๋ฌด์ํฉ๋๋ค. ๊ฐ์ฅ ์ฌ์ด ์ต์ :
- Android Studio emulator: Settings โถ Proxy โ manual.
- Physical device: evil Wi-Fi AP + DNS spoofing, ๋๋ Magisk ๋ชจ๋๋ก
/etc/hosts๋ฅผ ํธ์ง.
๋น ๋ฅธ Flutter TLS bypass ์ํฌํ๋ก์ฐ (Frida Codeshare + system CA)
ํ๋ Flutter API๋ง ๊ด์ฐฐํด์ผ ํ ๋๋, rooted/writable AVD, system-trusted proxy CA, ๊ทธ๋ฆฌ๊ณ drop-in Frida ์คํฌ๋ฆฝํธ๋ฅผ ์กฐํฉํ๋ ๊ฒ์ด 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 &'"
- ํธ์คํธ ์ธก ๋๊ตฌ๋ฅผ ์ค์นํ๊ณ ๋์ ํจํค์ง๋ฅผ ์ด๊ฑฐํฉ๋๋ค.
pip3 install frida-tools --break-system-packages
adb shell pm list packages -f | grep target
- Codeshare hook์ผ๋ก Flutter ์ฑ์ ์คํํด BoringSSL pin checks๋ฅผ ๋ฌด๋ ฅํํฉ๋๋ค.
frida -U -f com.example.target --codeshare TheDauntless/disable-flutter-tls-v1 --no-pause
Codeshare ์คํฌ๋ฆฝํธ๋ Flutter TLS ๊ฒ์ฆ๊ธฐ๋ฅผ ์ค๋ฒ๋ผ์ด๋ํ์ฌ Burp๊ฐ ๋์ ์ผ๋ก ์์ฑํ ์ธ์ฆ์๋ฅผ ํฌํจํ ๋ชจ๋ ์ธ์ฆ์๋ฅผ ์๋ฝํ๊ฒ ํ์ฌ public-key pin ๋น๊ต๋ฅผ ์ฐํํฉ๋๋ค.
- ํธ๋ํฝ์ ํ๋ก์๋ก ๋ผ์ฐํธํฉ๋๋ค. ์๋ฎฌ๋ ์ดํฐ์ Wi-Fi ํ๋ก์ GUI๋ฅผ ์ค์ ํ๊ฑฐ๋
adb shell settings put global http_proxy 10.0.2.2:8080๋ก ๊ฐ์ ์ค์ ํ์ธ์; ์ง์ ๋ผ์ฐํ ์ด ์คํจํ๋ฉดadb reverse tcp:8080 tcp:8080๋๋ host-only VPN์ผ๋ก ํด๋ฐฑํ์ธ์.
OS ๋ ์ด์ด์์ CA๋ฅผ ์ ๋ขฐํ๋๋ก ์ค์ ํ๊ณ Frida๊ฐ Flutter์ pinning ๋ก์ง์ ๋ฌด๋ ฅํํ๋ฉด, Burp/mitmproxy๋ APK๋ฅผ ์ฌํจํค์งํ์ง ์๊ณ ๋ API fuzzing (BOLA, token tampering ๋ฑ)์ ๋ํด ์์ ํ ๊ฐ์์ฑ์ ํ๋ณตํฉ๋๋ค.
BoringSSL ๊ฒ์ฆ์ ์คํ์ ๊ธฐ๋ฐ ํ (์๊ทธ๋์ฒ ์ค์บ ์์)
ํจํด ๊ธฐ๋ฐ ์คํฌ๋ฆฝํธ๊ฐ ์ํคํ ์ฒ ๊ฐ(e.g., x86_64 vs ARM)์์ ์คํจํ ๊ฒฝ์ฐ, libflutter.so ๋ด๋ถ์ ์ ๋ ์ฃผ์๋ก BoringSSL ์ฒด์ธ ๊ฒ์ฆ๊ธฐ๋ฅผ ์ง์ ํ ํ์ธ์. ์ํฌํ๋ก์ฐ:
- APK์์ ๊ธฐ๊ธฐ์ ๋ง๋ ABI ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ฅผ ์ถ์ถํ์ธ์:
unzip -j app.apk "lib/*/libflutter.so" -d libs/๊ทธ๋ฆฌ๊ณ ๊ธฐ๊ธฐ์ ๋ง๋ ๊ฒ์ ์ ํํ์ธ์ (์:lib/x86_64/libflutter.so). - Ghidra/IDA์์ ๋ถ์ํ์ฌ ๊ฒ์ฆ๊ธฐ ์์น๋ฅผ ์ฐพ์ผ์ธ์:
- ์ถ์ฒ: BoringSSL ssl_x509.cc ํจ์
ssl_crypto_x509_session_verify_cert_chain(3 args, returns bool). - ์ฌ๋ณผ์ด ์ ๊ฑฐ๋ ๋น๋์์๋ Search โ For Strings โ
ssl_clientโ XREFs๋ฅผ ์ฌ์ฉํ ๋ค์, ์ฐธ์กฐ๋ ๊ฐFUN_...์ ์ด์ด ํฌ์ธํฐ ๊ฐ์ ์ธ์ 3๊ฐ์ boolean ๋ฐํ์ ๊ฐ์ง ํจ์๋ฅผ ์ ํํ์ธ์. - ๋ฐํ์ ์คํ์
์ ๊ณ์ฐํ์ธ์: Ghidra์ ํ์๋ ํจ์ ์ฃผ์์์ ์ด๋ฏธ์ง ๋ฒ ์ด์ค๋ฅผ ๋นผ์ธ์ (์: Ghidra๋ PIE Android ELF์ ๋ํด ์ข
์ข
0x00100000์ ํ์ํฉ๋๋ค). ์:0x02184644 - 0x00100000 = 0x02084644. - base + offset์ผ๋ก ๋ฐํ์์์ ํ ์ ๊ฑธ๊ณ ์ฑ๊ณต์ ๊ฐ์ ํ์ธ์:
// 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
- Signature scans์ ARM์์๋ ์ฑ๊ณตํ ์ ์์ง๋ง opcode layout์ด ๋ณ๊ฒฝ๋์ด x86_64์์๋ ๋์น ์ ์์ต๋๋ค; ์ด offset method๋ RVA๋ฅผ ์ฌ๊ณ์ฐํ๊ธฐ๋ง ํ๋ฉด ์ํคํ ์ฒ์ ๊ตฌ์ ๋ฐ์ง ์์ต๋๋ค.
- This bypass๋ BoringSSL์ด any chain์ ์๋ฝํ๊ฒ ๋ง๋ค์ด Flutter ๋ด๋ถ์ pins/CA trust์ ๊ด๊ณ์์ด HTTPS MITM์ ๊ฐ๋ฅํ๊ฒ ํฉ๋๋ค.
- TLS ์ฐจ๋จ์ ํ์ธํ๊ธฐ ์ํด debugging ์ค์ ํธ๋ํฝ์ force-routeํ๋ ๊ฒฝ์ฐ, ์:
iptables -t nat -A OUTPUT -p tcp -j DNAT --to-destination <Burp_IP>:<Burp_Port>
โฆ์ฌ์ ํ ์์ hook์ด ํ์ํฉ๋๋ค. ๊ฒ์ฆ์ Android์ ์์คํ ์ ๋ขฐ ์ ์ฅ์๊ฐ ์๋๋ผ libflutter.so ๋ด๋ถ์์ ์ด๋ฃจ์ด์ง๊ธฐ ๋๋ฌธ์ ๋๋ค.
์ฐธ๊ณ ์๋ฃ
- 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 ์ง์ํ๊ธฐ
- ๊ตฌ๋ ๊ณํ ํ์ธํ๊ธฐ!
- **๐ฌ ๋์ค์ฝ๋ ๊ทธ๋ฃน ๋๋ ํ ๋ ๊ทธ๋จ ๊ทธ๋ฃน์ ์ฐธ์ฌํ๊ฑฐ๋ ํธ์ํฐ ๐ฆ @hacktricks_live๋ฅผ ํ๋ก์ฐํ์ธ์.
- HackTricks ๋ฐ HackTricks Cloud ๊นํ๋ธ ๋ฆฌํฌ์งํ ๋ฆฌ์ PR์ ์ ์ถํ์ฌ ํดํน ํธ๋ฆญ์ ๊ณต์ ํ์ธ์.


