flutter
它能做什么
这份指南涵盖对 Flutter 应用的分析,其逻辑会被提前编译为原生库。适合需要检查自身应用网络保护的开发人员和测试人员。
适用场景
- ✓当 Flutter 应用在其 Java 或 Objective-C 包装层中几乎看不到逻辑时。
- ✓当团队想检查其 Flutter 应用的证书固定在测试中能否被绕过时。
- ✓当授权审查需要读取 Flutter 构建中嵌入的网址或设置时。
技能链接
https://github.com/BitterSecurity/Decepticon/blob/main/packages/decepticon/decepticon/skills/standard/mobile/flutter/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“我们 Flutter 应用的证书固定已经部署。请帮我在我们自己构建的授权测试中,检查它是否真正有效?”
每周 5 个新技能,1 分钟读完。
工作原理
智能体识别 Flutter 构建,审查原生库中嵌入的地址和设置,并测试应用自身的网络流量是否强制执行了证书固定。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Flutter App Reversing Playbook
Flutter compiles Dart AOT to a native shared library (
libapp.so/Flutter.framework).jadx/apktoolshow only the thin Java/ObjC shell and are useless for app logic. Use this playbook when static Android or iOS skills yield nothing but an empty Java wrapper.
Prerequisites
- APK / IPA obtained (see
mobile/android/SKILL.mdPath 1 for APK pull). - Tools:
reflutter(pip install reflutter),uber-apk-signer(download JAR from GitHub releases),adb+ device or emulator,jadx(identification only), Burp Suite proxy. - For iOS:
reFlutteralso patchesFlutter.framework; useobjection patchipaor direct framework patching workflow.
Step 1: Identify a Flutter App
# Unzip APK, look for the telltale Flutter artifacts
unzip -o base.apk -d /tmp/apk-out/
ls /tmp/apk-out/lib/arm64-v8a/
# Flutter app: libflutter.so libapp.so
# Present: flutter_assets/ kernel_blob.bin (optional, debug)
# jadx shows only the Java bootstrap:
jadx -d /tmp/apk-java /tmp/base.apk
# Expect: ~1 class, LoadLibrary("app"), nothing useful
# Confirm with strings:
strings /tmp/apk-out/lib/arm64-v8a/libflutter.so | grep -i "flutter"
strings /tmp/apk-out/lib/arm64-v8a/libapp.so | grep -E "https?://"
Key tell: libapp.so size > 5 MB with no dex business logic; the
kernel_blob.bin in flutter_assets/ indicates a debug/JIT build
(rare in production; can extract Dart directly with dart_vm).
Step 2: reFlutter Workflow — Patch BoringSSL Pinning
reFlutter patches the ssl_crypto_x509_session_verify_cert_chain
function in libflutter.so to always return true, bypassing all
BoringSSL-based certificate validation (covers both custom pinning
and system trust).
Flutter <= 3.23.x (hardcoded proxy IP)
# Patch: supply your Burp listener IP
reflutter base.apk
# reFlutter prompts for IP — enter your Burp machine IP (e.g. 192.168.1.100)
# Output: release.RE.apk (patched, unsigned)
# Sign with uber-apk-signer
java -jar uber-apk-signer.jar --allowResign -a release.RE.apk -o /tmp/
# Install on device
adb install /tmp/release.RE-aligned-signed.apk
# Configure Burp proxy listener on 0.0.0.0:8083 (reFlutter default port is 8083)
# Launch app — HTTPS traffic appears in Burp
Flutter >= 3.24.0 (no hardcoded proxy IP — breaking change)
Starting Flutter 3.24.0 (August 2024), the hardcoded proxy IP was removed from the patched BoringSSL stub. Traffic is no longer redirected to a fixed IP. Two options:
Option A: Device-level proxy
# Patch as above (no IP prompt in 3.24+)
reflutter base.apk
java -jar uber-apk-signer.jar --allowResign -a release.RE.apk -o /tmp/
# Install and configure device proxy manually:
# Android Settings → Wi-Fi → [SSID] → Proxy → Manual
# Host: <Burp-IP> Port: 8080
# Or use TunProxy for non-proxy-aware processes:
adb install TunProxy.apk
# Launch TunProxy, set server to <Burp-IP>:8080, toggle VPN
# Then launch patched app
Option B: Per-app proxy injection via Frida
# Run patched APK + Frida script to redirect all socket connections
frida -U -f com.target.app -l proxy-redirect.js --no-pause
# proxy-redirect.js: hooks connect() syscall, redirects to Burp IP
iOS Flutter.framework patching
# Extract IPA
unzip target.ipa -d /tmp/ipa-out/
# Locate Flutter.framework
ls /tmp/ipa-out/Payload/TargetApp.app/Frameworks/Flutter.framework/Flutter
# reFlutter iOS (experimental — check reFlutter README for current support)
reflutter target.ipa
# Sign with codesign + adhoc or with valid mobileprovision
codesign --force --sign - /tmp/ipa-out/Payload/TargetApp.app/Frameworks/Flutter.framework/Flutter
# Repack + install with ios-deploy or Sideloadly
Step 3: BoringSSL Bypass Mechanism
reFlutter patches ssl_crypto_x509_session_verify_cert_chain to
unconditionally return 1 (success). This function is the central
chain verification entry point in BoringSSL (the TLS library embedded
in libflutter.so) — no root CA, no pinning config, and no custom
validator override this patch because the chain evaluation never runs.
Manual binary patch (if reFlutter fails on a specific version):
# Find the function offset in libflutter.so
r2 -A /tmp/apk-out/lib/arm64-v8a/libflutter.so
# In r2: afl~ssl_crypto_x509
# Or: /c ret in data section near ssl_crypto_x509_session_verify_cert_chain
# Patch: overwrite function prologue with MOV W0, #1 / RET (AArch64)
# MOV W0, 1 = 20 00 80 52
# RET
常见问题
什么是证书固定?
它是一种检查,确保应用只连接到具有预期证书的服务器,从而阻止许多拦截尝试。
为什么 Flutter 包装层帮助不大?
该指南指出,应用逻辑位于原生库中,因此 Java 包装层几乎不显示任何内容。
谁应该进行这些检查?
在自有 Flutter 应用上工作的开发人员和测试人员。
详情
作者的原始描述
Flutter app reversing and SSL pinning bypass — reFlutter Dart-AOT patching, BoringSSL bypass, libapp.so static analysis in Ghidra/radare2, Dart snapshot dump, and iOS Flutter.framework notes.
热度
- GitHub 星标
- 6.5k
- 排名
- #14109
- 许可证
- Apache-2.0
- 更新时间
- 2026/11/1
评论
- …