用途:App Store 分发的 iOS 应用受 Apple FairPlay DRM 加密,做静态分析前需在运行时解密,即“砸壳”。本技能用 Frida 注入运行中的进程,从内存导出已解密的 Mach-O,产出 IPA。
前提条件:已越狱且开启 SSH 的 iOS 设备;设备上安装并运行 frida-server;主机安装 Python 3 及 frida、frida-tools(pip3 install frida frida-tools);主机与设备可通过 USB 或网络 SSH 连通。
安装:git clone https://github.com/P4nda0s/frida-ios-dump.git,进入目录后 pip3 install -r requirements.txt,并编译 TypeScript agent:npm install --ignore-scripts 与 npx frida-compile dump.ts -o dist/dump.js。该版本使用 TypeScript agent,必须先编译出 dist/dump.js 才能运行 dump.py。
使用流程:先用 frida-ps -H <device_ip> -a 或 SSH 查询 Info.plist 获取目标 Bundle ID;确保目标 App 正在运行;执行 python3 dump.py -H <device_ip> -u mobile -P <password> <bundle_id>,例如 python3 dump.py -H 192.168.1.100 -u mobile -P alpine app.ish.iSH。成功后当前目录生成 .ipa,可用 otool -l 检查 LC_ENCRYPTION_INFO,cryptid 为 0 表示解密成功。
输出用途:解密后的 Mach-O 可载入 IDA/Ghidra/Hopper 做静态分析,用 class-dump 提取 ObjC 头文件,搜索敏感字符串与 URL,或配合 Frida 做动态分析、符号恢复。
限制与注意:设备需保持解锁,App 需在前台运行;含多个 framework 的 App 会一并导出加密 framework;部分带越狱检测的 App 可能在导出完成前退出,需先绕过检测。常见问题包括 frida-server 未运行或版本不匹配、SSH 连接被拒、Bundle ID 错误、超时及 cryptid 仍为 1 等,需按提示排查。frida-server 与主机 frida 主版本需一致。