hits313/alab

GitHub: hits313/alab

一款零依赖 Android Studio 的自动化渗透测试框架,通过单条命令即可构建集成 Root、Frida 注入与 Burp 全局抓包的移动安全分析环境。

Stars: 1 | Forks: 0

``` ██████╗ ██╗ █████╗ ██████╗ ██╔══██╗██║ ██╔══██╗██╔══██╗ ███████║██║ ███████║██████╔╝ ██╔══██║██║ ██╔══██║██╔══██╗ ██║ ██║███████╗██║ ██║██████╔╝ ╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝╚═════╝ ``` # alab — Android 渗透测试框架 **零 Android Studio 的 Android 渗透测试实验室。一条命令。已 Root。已绕过证书绑定。已对接 Burp。** [![Linux](https://img.shields.io/badge/Linux-supported-success?logo=linux&logoColor=white)](#linux) [![macOS](https://img.shields.io/badge/macOS-supported-success?logo=apple&logoColor=white)](#macos) [![Windows](https://img.shields.io/badge/Windows-WSL2%20%2F%20native-success?logo=windows&logoColor=white)](#windows) [![Frida](https://img.shields.io/badge/Frida-17.2.14-ff3366)](https://frida.re) [![Magisk](https://img.shields.io/badge/Magisk-25.2%20%2B%20Zygisk-00ff88)](https://github.com/topjohnwu/Magisk) [![License](https://img.shields.io/badge/license-MIT-blue)](LICENSE) *由 hits 开发 · 由人类 + AI (Opus 4.6) 构建*
## 它能做什么 `alab` 会启动一个已 Root 的 Pixel 6 模拟器 (Android 13, API 33),推送 `frida-server`,将 Burp CA 作为**系统证书**安装,将所有设备流量路由至 Burp,并为您提供一个简洁的 CLI 来安装/反编译/拦截任何 APK —— **无需 Android Studio,无需 Genymotion,无需 VMware**。 ``` $ alab start [*] Starting Pixel6_API33_root... [+] Emulator PID: 88421 [*] Waiting for device to boot... [+] Device booted. [*] Enabling root... [+] Root: uid=0 [+] Proxy → Burp 10.0.2.2:8080 [+] Zygisk ON · DenyList ON [+] Ready. Run alab screen to mirror display. ``` ## 功能特性 - **一键启动** — `alab start` → 启动、Root、代理、Zygisk 全部就绪 - **🎯 猎捕模式** — `alab hunt com.x.y` 运行 APK 拉取 → jadx → apkleaks → manifest → 导出组件 → **REPORT.md**,全自动化 - **🩺 Doctor** — `alab doctor` 会验证 KVM、SDK、frida 版本同步、Burp 监听器及各项工具,并为每项失败的检查提供准确的修复命令 - **🔄 Frida-sync** — `alab frida-sync` 会根据宿主机上的 frida-tools 和设备 ABI 自动下载对应的 `frida-server` - **系统级 Burp 证书安装** — 无需应用级代理即可进行 TLS 拦截 - **Magisk + Zygisk + DenyList** — 为绕过 Root 检测预先配置 - **全绕过工具集** — `alab unpin-full ` 在一次 Frida 加载中链式执行 SSL + Root + RASP 绕过 - **APK 工具链** — jadx, apktool, dex2jar, apkleaks, androguard (支持拆分 APK) - **Frida 17.2.14** — 宿主工具 + 服务端二进制文件锁定为匹配版本 - **CLI 代理就绪** — 为 Claude Code 和 Gemini CLI 提供开箱即用的配置 - **跨平台** — Linux, macOS (Apple Silicon + Intel), Windows (WSL2 + 原生) - **Tab 补全** — bash/zsh;实时从设备中 Tab 补全已安装的包名 ## 快速安装 ### Linux ``` git clone https://github.com/hits313/alab.git ~/tools/android-lab cd ~/tools/android-lab && chmod +x start-lab.sh # 请按照 docs/ALAB-INSTALL.md 中的 §2 进行 SDK + AVD 设置 echo "alias alab='bash ~/tools/android-lab/start-lab.sh'" >> ~/.zshrc && source ~/.zshrc ``` ### macOS (Apple Silicon 或 Intel) ``` brew install openjdk@17 python@3.11 wget android-platform-tools scrcpy git clone https://github.com/hits313/alab.git ~/tools/android-lab # 请按照 docs/ALAB-INSTALL.md 中的 §3 操作(注意:Apple Silicon 上的 arm64-v8a sysimg) ``` ### Windows **WSL2 (推荐):** `wsl --install -d Ubuntu-22.04`,然后按照 WSL 中的 Linux 流程操作。 **原生:** 参见 [docs/ALAB-INSTALL.md](docs/ALAB-INSTALL.md) 中的第 4 节 — winget + Git Bash。 📄 **完整安装指南:** [docs/ALAB-INSTALL.md](docs/ALAB-INSTALL.md) · [docs/ALAB-Framework-Guide.pdf](docs/ALAB-Framework-Guide.pdf) ## 命令 | 阶段 | 命令 | 功能说明 | |-----------|----------------------------------------|---------------------------------------------| | 启动 | `alab start` | 启动 AVD、自动 Root、开启代理、开启 Zygisk | | 启动 | `alab setup` | 完整流程: Root + frida + Burp 证书 + 代理| | 启动 | `alab status` | 设备 · Root · Magisk · Frida · 代理 | | 健康 | **`alab doctor`** | 环境健康检查 — KVM/SDK/frida 同步/Burp | | 健康 | **`alab version`** | alab + frida + Magisk + AVD 版本 | | Frida | `alab frida` | 推送并启动 frida-server | | Frida | **`alab frida-sync`** | 自动获取与宿主工具匹配的 frida-server | | 拦截 | `alab burp-cert` | 将 Burp CA 安装为系统证书并重启 | | 拦截 | `alab proxy-on` / `proxy-off` | 切换 Burp 代理 | | 拦截 | **`alab certs`** | 列出受信任的 CA + Burp 证书状态 | | 脱钩 | `alab unpin com.bank.app` | objection SSL 脱钩 | | 脱钩 | `alab unpin-frida com.bank.app` | Frida 多重堆栈 SSL 脱钩 | | 脱钩 | **`alab unpin-full com.bank.app`** | SSL + Root + RASP (链式) | | APK | `alab install app.apk [splits...]` | install -r / install-multiple | | APK | `alab pull-apk com.x.y` | 拉取 APK (支持拆分包) | | APK | `alab decompile app.apk` | jadx → `/tmp/jadx-/` | | APK | `alab strings app.apk` | apkleaks — 密钥与端点 | | APK | `alab manifest app.apk` | 导出 AndroidManifest.xml | | APK | **`alab grep `** | grep 反编译源码 | | **猎捕** | **`alab hunt com.x.y`** | **自动侦察 → REPORT.md 位于 ~/hunt//** | | 设备 | `alab logcat com.x.y` | 过滤的实时 logcat | | 设备 | `alab pull-data com.x.y` | 拉取 `/data/data/` | | 设备 | **`alab snapshot {save\|load\|list}`** | AVD 状态快照 | | Magisk | `alab denylist-add com.x.y` | 向指定包名隐藏 Root | 运行不带参数的 `alab` 以查看完整菜单。 ## Frida 脚本 一个精选的脚本集随项目发布在 [`frida-scripts/`](frida-scripts/) 目录下 —— 包含适用于 Android 和 iOS 的生产级绕过脚本。每个脚本都在文件内标注了其上游来源。 ### Android — `frida-scripts/android/` | 脚本 | 绕过目标 | |---|---| | [`root-bypass.js`](frida-scripts/android/root-bypass.js) | RootBeer · su 二进制文件 · Magisk 路径 · build 标签 · 基础 SafetyNet | | [`rasp-bypass.js`](frida-scripts/android/rasp-bypass.js) | 反调试 · 反模拟器 · 反 Frida · 反 Xposed · ptrace · 自杀进程 | | [`ssl-multi-unpin.js`](frida-scripts/android/ssl-multi-unpin.js) | OkHttp3/4 · Conscrypt · TrustKit · NSC · React-Native · Cordova · Cronet | | [`biometric-bypass.js`](frida-scripts/android/biometric-bypass.js) | BiometricPrompt · FingerprintManager 强制成功 | | [`webview-debug.js`](frida-scripts/android/webview-debug.js) | 强制开启 `setWebContentsDebuggingEnabled(true)` 用于 chrome://inspect | ### iOS — `frida-scripts/ios/` | 脚本 | 绕过目标 | |---|---| | [`jailbreak-bypass.js`](frida-scripts/ios/jailbreak-bypass.js) | 文件/URL 方案/fork/dyld/IOSSecuritySuite 越狱检查 | | [`ssl-bypass.js`](frida-scripts/ios/ssl-bypass.js) | BoringSSL · SecTrustEvaluate · AFNetworking · TrustKit | | [`anti-frida-bypass.js`](frida-scripts/ios/anti-frida-bypass.js) | sysctl P_TRACED · 端口 27042 · dyld frida-* 掩码 | ### 通过 alab 封装运行 ``` alab unpin com.bank.app # objection one-liner bash unpin.sh com.bank.app full # Android: SSL + root + RASP bash unpin.sh com.bank.ios ios-full # iOS: JB + SSL + anti-Frida ``` 或者使用 Frida 手动链式执行: ``` frida -U -f com.target.app \ -l frida-scripts/android/root-bypass.js \ -l frida-scripts/android/rasp-bypass.js \ -l frida-scripts/android/ssl-multi-unpin.js \ --no-pause ``` 完整列表和致谢请参阅 [`frida-scripts/README.md`](frida-scripts/README.md)。 ## 致谢 — 上游 Frida 研究 这些脚本改编自以下公共项目的技术。**请给他们的仓库点 Star** —— 那才是真正的研究所在。 | 项目 | 来源 | |---|---| | iddoeldor / **frida-snippets** | https://github.com/iddoeldor/frida-snippets | | httptoolkit / **frida-interception-and-unpinning** | https://github.com/httptoolkit/frida-interception-and-unpinning | | sensepost / **objection** | https://github.com/sensepost/objection | | WithSecureLabs / **android-keystore-audit** | https://github.com/WithSecureLabs/android-keystore-audit | | dki / **ios10-ssl-bypass** | https://codeshare.frida.re/@dki/ios10-ssl-bypass/ | | nabla-c0d3 / **ssl-kill-switch2** | https://github.com/nabla-c0d3/ssl-kill-switch2 | | Areizen / **iOS-Jailbreak-Detection-Bypass** | https://github.com/Areizen/iOS-Jailbreak-Detection-Bypass | | r0ysue / **AndroidSecurityStudy** | https://github.com/r0ysue/AndroidSecurityStudy | | Ch0pin / **medusa** | https://github.com/Ch0pin/medusa | | Areizen / **Android-Application-Pentest-Roadmap** | https://github.com/Areizen/Android-Application-Pentest-Roadmap | | **Frida Codeshare** 社区 | https://codeshare.frida.re | 提取自上述项目的代码模式保留其原始许可证 (MIT / Apache-2.0 / Frida-codeshare 条款)。alab 原创代码遵循 MIT 协议。 ## 使用 CLI 代理驱动 alab **Claude Code** 和 **Gemini CLI** 均可端到端驱动 alab。示例工作流程: 代理会顺序执行 `alab` 命令,解析反编译输出,编写 Frida hooks,并将发现结果保存至 `~/hunt//`。可通过 `.claude/settings.json` 预先授予权限 —— 参见安装指南中的第 7 节。 ## 技术栈 | 组件 | 版本 | |-----------------|----------------| | AVD | Pixel 6 · Android 13 · API 33 · `google_apis` | | 模拟器加速 | KVM (Linux) · HVF (macOS) · Hyper-V (Windows) | | Frida | 17.2.14 host + server | | objection | latest | | jadx | 1.5.0 | | dex2jar | v2.4 | | apktool | 2.5.0 | | Magisk | v28.1 + Zygisk + DenyList | | Burp | Community / Pro (系统证书安装) | ## 仓库布局 ``` alab/ ├── start-lab.sh # main dispatcher (the `alab` command) ├── unpin.sh # SSL/RASP/root unpin wrapper ├── magisk-root.sh # Magisk install helper ├── CHANGELOG.md ├── completions/ │ └── alab.bash # bash/zsh tab completion ├── frida-scripts/ │ ├── README.md │ ├── android/ # root-bypass, rasp-bypass, ssl-multi-unpin, biometric, webview │ ├── ios/ # jailbreak-bypass, ssl-bypass, anti-frida-bypass │ └── universal-ssl-unpin.js ├── docs/ │ ├── ALAB-INSTALL.md # full install + ops guide │ └── ALAB-Framework-Guide.pdf ├── LICENSE └── README.md ``` ## 免责声明 `alab` 仅用于**授权的安全测试** —— 包括您在范围内的漏洞赏金计划 (BBP)、您自己的应用程序、CTF 挑战,或具有书面授权的渗透测试。请勿将此框架用于您未获授权测试的系统。作者不对滥用行为承担责任。 ## 许可证 MIT — 参见 [LICENSE](LICENSE)。
**由 hits 开发** · *由人类 + AI (Opus 4.6) 构建* [安装指南](docs/ALAB-INSTALL.md) · [PDF](docs/ALAB-Framework-Guide.pdf) · [问题反馈](https://github.com/hits313/alab/issues)
标签:Android, Android 13, Android Emulator, API接口, APK反编译, AVD, Burp Suite, Docker支持, DSL, Frida, Magisk, Proxy, Root, SSL Unpinning, Windows WSL2, Zygisk, 云资产清单, 安全测试, 应用安全, 抓包代理, 攻击性安全, 环境自动化, 目录枚举, 移动安全, 移动端漏洞挖掘, 系统级证书, 网络拦截, 自动化安全工具, 自定义脚本, 证书绕过, 逆向工程, 黑盒测试