
Ios Pentesting
- 26 installs
- 1.6k repo stars
- Updated July 19, 2026
- wgpsec/aboutsecurity
Helps with testing & qa tasks during AI-assisted development.
About
ios-pentesting is a Claude Code skill for testing & qa. It helps solo builders move faster with AI-assisted coding.
- ios-pentesting
- Testing & QA
- AI-coding skill
Ios Pentesting by the numbers
- 26 all-time installs (skills.sh)
- +2 installs in the week ending Jul 27, 2026 (Skillselion tracking)
- Ranked #1,382 of 2,153 Testing & QA skills by installs in the Skillselion catalog
- Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/wgpsec/aboutsecurity --skill ios-pentestingAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 26 |
|---|---|
| repo stars | ★ 1.6k |
| Last updated | July 19, 2026 |
| Repository | wgpsec/aboutsecurity ↗ |
What it does
Helps with testing & qa tasks during AI-assisted development.
Files
iOS 应用渗透测试方法论
阶段流: 环境准备 → IPA静态分析 → 动态分析(Frida/Objection) → 数据存储安全 → 网络通信安全 → URL Scheme → 保护机制绕过
深入参考
- IPA 静态分析与二进制安全检查 → references/ios-static-analysis.md
- Frida/Objection 动态 Hook 与认证绕过 → references/ios-frida-dynamic.md
---
Phase 0: 环境准备
设备要求
测试设备选择?
├─ 越狱 iPhone(推荐)
│ ├─ checkra1n (A5-A11, 硬件级)
│ ├─ unc0ver / Taurine (软件越狱)
│ └─ Dopamine / palera1n (较新设备)
├─ 非越狱设备
│ ├─ 功能有限: 无法访问沙箱、Keychain dump
│ ├─ 可用 objection + Frida Gadget 注入
│ └─ 仍可做: 网络分析、IPA 静态分析、备份分析
└─ 模拟器(Xcode Simulator)
└─ Intel Mac 常见 x86_64 simulator 架构,Apple Silicon 支持 arm64 simulator 架构
└─ 不支持真机越狱场景,硬件能力与 Keychain 行为也不同于真机核心工具链
| 工具 | 用途 | 安装 |
|---|---|---|
| Frida + frida-tools | 动态 Hook / 运行时分析 | pip install frida-tools |
| objection | Frida 自动化封装 | pip install objection |
| otool / jtool2 | 二进制分析 | macOS 内置 / brew |
| class-dump | ObjC 类信息提取 | brew install class-dump |
| Ghidra / IDA / Hopper | 反汇编/反编译 | 各自官网 |
| Burp Suite | 流量拦截 | PortSwigger |
| MobSF | 自动化静态+动态分析 | Docker 部署 |
| ideviceinstaller | IPA 安装/管理 | brew install ideviceinstaller |
| ios-deploy | 设备部署 | brew install ios-deploy |
| Keychain-Dumper | Keychain 数据提取 | GitHub (越狱设备) |
| SSL Kill Switch 2 | SSL Pinning 绕过 | Cydia |
IPA 获取
# 从越狱设备提取
ssh root@device_ip
find /var/containers/Bundle/Application/ -name "*.app" 2>/dev/null
# 使用 frida-ios-dump
pip install frida-ios-dump
python dump.py -H device_ip -p 22 "AppName"
# 从 iTunes 备份提取
# macOS: ~/Library/Application Support/MobileSync/Backup/
# 第三方下载
# iMazing / Apple Configurator 2---
Phase 1: IPA 静态分析
IPA 结构解析
# IPA 本质是 ZIP
mv target.ipa target.zip
unzip target.zip -d ipa_contents/
# 目录结构:
# Payload/
# AppName.app/
# Info.plist ← 应用配置(权限/URL Scheme/ATS)
# _CodeSignature/ ← 代码签名
# Frameworks/ ← 第三方框架
# Assets.car ← 资源文件
# AppName ← 主二进制(Mach-O)二进制安全检查
# PIE(地址随机化)
otool -hv AppName | grep PIE
# 应包含 PIE flag
# Stack Canaries(栈保护)
otool -I -v AppName | grep stack_chk
# 应包含 stack_chk_guard 和 stack_chk_fail
# ARC(自动引用计数)
otool -I -v AppName | grep objc_release
# 应包含 _objc_release
# 加密状态
otool -arch all -Vl AppName | grep -A5 LC_ENCRYPT
# cryptid = 1 → 已加密(App Store 版本)
# cryptid = 0 → 未加密(可直接分析)
# 第三方库
otool -L AppName不安全函数检查
# 弱哈希
otool -Iv AppName | grep -w "_CC_MD5"
otool -Iv AppName | grep -w "_CC_SHA1"
# 不安全随机数
otool -Iv AppName | grep -w "_random\|_srand\|_rand"
# 不安全内存操作
otool -Iv AppName | grep -w "_gets\|_memcpy\|_strncpy\|_strlen\|_sprintf\|_vsprintf"
# 不安全 malloc
otool -Iv AppName | grep -w "_malloc"Info.plist 审计
# 转为可读 XML
plutil -convert xml1 Info.plist
# 关键字搜索
grep -i "NSAppTransportSecurity" Info.plist
grep -i "CFBundleURLTypes" Info.plist
grep -i "UsageDescription" Info.plist
grep -i "NSAllowsArbitraryLoads" Info.plist关键检查项:
| 配置 | 风险 | 影响 |
|---|---|---|
NSAllowsArbitraryLoads = true | 高 | 禁用 ATS,允许 HTTP |
CFBundleURLTypes | 中 | URL Scheme 可被劫持 |
无 NSAppTransportSecurity | 低 | 使用默认 ATS(安全) |
LSApplicationQueriesSchemes | 信息 | 可探测已安装应用 |
ObjC 类信息提取
# class-dump 提取头文件
class-dump AppName > headers.h
# 搜索敏感方法
grep -n "password\|token\|secret\|encrypt\|decrypt\|key" headers.h
# 反汇编 text 段
otool -tV AppName | head -100
# ObjC segment
otool -oV AppName | head -100---
Phase 2: 动态分析 (Frida/Objection)
Frida 基础操作
# 列出设备上的应用
frida-ps -Uai
# 附加到运行中的应用
frida -U "AppName"
# 以 spawn 模式启动
frida -U -f com.target.app
# 使用脚本
frida -U -f com.target.app -l hook.jsObjection 核心功能
# 连接到应用
objection --gadget "AppName" explore
# 环境信息
env
# 枚举组件
ios hooking list classes
ios hooking list class_methods ClassName
# NSUserDefaults 读取
ios nsuserdefaults get
# Keychain dump
ios keychain dump
# Cookie 读取
ios cookies get --json
# Plist 查看
ios plist cat /path/to/file.plist
# 二进制信息
ios info binary
# 禁用 SSL Pinning
ios sslpinning disable
# 禁用越狱检测
ios jailbreak disable
# 加密监控
ios monitor crypt
# 生物认证绕过
ios ui biometrics_bypass进程枚举与 Hook
动态分析目标?
├─ 数据存储审计 → Keychain dump + NSUserDefaults + Plist
├─ 网络流量分析 → SSL Pinning 绕过 + Burp 拦截
├─ 认证绕过 → Hook evaluatePolicy / 生物认证
├─ 加密算法审计 → ios monitor crypt
├─ URL Scheme 测试 → 构造 scheme:// URL 触发
└─ 内存分析 → 搜索敏感数据残留---
Phase 3: 数据存储安全
存储位置全检查
数据存储审计清单?
├─ NSUserDefaults → Library/Preferences/<BundleID>.plist
│ └─ objection: ios nsuserdefaults get
│ └─ 是否存储明文凭据/Token?
├─ Keychain
│ └─ objection: ios keychain dump
│ └─ Keychain-Dumper(越狱设备)
│ └─ 数据保护等级是否合适?
├─ CoreData/SQLite → Library/Application Support/
│ └─ find ./ -name "*.sqlite" -or -name "*.db"
│ └─ 数据是否加密?
├─ Realm → Documents/default.realm
│ └─ find ./ -name "*.realm*"
│ └─ 使用 Realm Studio 查看
├─ Plist 文件
│ └─ find ./ -name "*.plist"
│ └─ 是否存储敏感信息?
├─ Cookie → Library/Cookies/cookies.binarycookies
│ └─ objection: ios cookies get --json
│ └─ Secure/HttpOnly flag?
├─ Cache → Library/Caches/<BundleID>/Cache.db
│ └─ sqlite3 Cache.db → 检查缓存的请求/响应
├─ 快照 → Library/Caches/Snapshots/ 或 Library/SplashBoard/Snapshots/
│ └─ 是否包含敏感界面截图?
│ └─ ApplicationDidEnterBackground 是否清除?
└─ 备份数据
└─ iTunes/Finder 备份 → 检查敏感数据是否被排除
└─ NSURLIsExcludedFromBackupKey 是否正确设置?实际操作
# 定位应用目录(越狱设备 / objection env 命令)
find /private/var/containers -name "AppName*" 2>/dev/null
# 关键检查命令
cat .../Library/Preferences/com.target.app.plist # NSUserDefaults
find .../ -name "*.sqlite" -or -name "*.db" # SQLite
sqlite3 found.db "SELECT * FROM credentials;" # 查数据库
/usr/bin/keychain-dumper # Keychain dump
ls .../Library/Caches/Snapshots/ # 后台快照
grep -i "firebase" Info.plist # Firebase URL
curl https://target.firebaseio.com/.json # 未授权访问测试---
Phase 4: 网络通信安全
Burp 配置(iOS)
流量拦截配置?
├─ WiFi 代理设置
│ └─ 设置 → WiFi → HTTP 代理 → 手动 → Burp IP:8080
├─ Burp CA 安装
│ └─ Safari 访问 http://burp → 下载 CA
│ └─ 设置 → 通用 → VPN 与设备管理 → 安装
│ └─ 设置 → 通用 → 关于 → 证书信任设置 → 启用
├─ SSL Pinning 绕过(如果需要)
│ ├─ SSL Kill Switch 2 (Cydia)
│ ├─ objection: ios sslpinning disable
│ ├─ Frida 脚本 Hook
│ └─ Burp Mobile Assistant
└─ 非 HTTP 流量
└─ tcpdump 抓包
└─ Wireshark 分析SSL Pinning 绕过
# 方案 1: SSL Kill Switch 2 (Cydia,全局绕过)
# 方案 2: objection
objection --gadget com.target.app explore -s "ios sslpinning disable"
# 方案 3: Frida 脚本
frida -U -f com.target.app -l ios_ssl_bypass.js
# 方案 4: Burp Mobile Assistant (自动配置)
# 主机名验证: Burp 生成不同主机名证书 → 应用仍工作 = 验证缺失---
Phase 5: URL Scheme / Universal Links
自定义 URL Scheme
# 从 Info.plist 提取
grep -A 10 "CFBundleURLTypes" Info.plist
# 测试 URL Scheme
# Safari 输入: myapp://action?param=value
# 或通过命令:
xcrun simctl openurl booted "myapp://auth?token=test"URL Scheme 测试点?
├─ 是否通过 URL 传递敏感数据(Token/密码)?
│ └─ 任何应用可注册相同 scheme 截获
├─ 参数是否做输入验证?
│ └─ 路径穿越: myapp://page/../admin
│ └─ JavaScript 注入(如果打开 WebView)
├─ WebView 是否将 URL 直接传给 openURL / UIApplication.open?
│ └─ 可能导致外部 App 跳转、deep link 路由绕过或参数注入
└─ Open Redirect?
└─ myapp://redirect?url=https://evil.comUniversal Links
# 检查 apple-app-site-association
curl https://target.com/.well-known/apple-app-site-association
curl https://target.com/apple-app-site-association
# 验证配置是否正确限制路径---
Phase 6: 保护机制绕过
越狱检测绕过
越狱检测机制?
├─ 文件系统检查
│ ├─ /Applications/Cydia.app
│ ├─ /Library/MobileSubstrate/MobileSubstrate.dylib
│ ├─ /bin/bash, /usr/sbin/sshd
│ └─ 绕过: Hook NSFileManager fileExistsAtPath → 返回 NO
├─ 沙箱违规检查
│ ├─ 尝试写入 /private/
│ └─ 绕过: Hook 写入函数返回失败
├─ API 检查
│ ├─ fork() 是否成功
│ ├─ system() 是否可用
│ └─ 绕过: Hook 返回预期的受限值
├─ 进程检查
│ ├─ 检测 Cydia/Substrate/sshd 进程
│ └─ 绕过: Hook 进程列表函数
├─ URL Scheme 检查
│ ├─ canOpenURL("cydia://")
│ └─ 绕过: Hook canOpenURL 返回 NO
└─ 环境变量/动态库检查
├─ DYLD_INSERT_LIBRARIES
├─ 加载的 dylib 列表
└─ 绕过: Hook 相关检查函数# objection 一键绕过
objection --gadget com.target.app explore -s "ios jailbreak disable"
# Frida 手动 Hook
frida -U -f com.target.app -l jailbreak_bypass.js
# Liberty Lite (Cydia 插件)
# 按应用启用越狱隐藏反调试绕过
反调试机制?
├─ sysctl 检查调试器
│ └─ Hook sysctl 返回无调试器
├─ ptrace(PT_DENY_ATTACH)
│ └─ Hook ptrace NOP
├─ 计时检查(检测断点导致的延迟)
│ └─ Hook 时间函数返回合理值
├─ 内存检查(检测调试器痕迹)
│ └─ Hook 内存读取函数
├─ Mach Port 检查
│ └─ Hook mach exception port 查询
└─ 多层联合检查
├─ 自签名状态检测 (csops)
├─ 完整性校验 (CRC32/MD5)
├─ kill-on-attach (abort/exit)
├─ Jetsam 内存压力终止
└─ 心跳定时器延迟执行生物认证绕过
# objection 绕过
objection --gadget com.target.app explore -s "ios ui biometrics_bypass"
# Frida 脚本绕过 evaluatePolicy
# Hook LAContext.evaluatePolicy → 强制 callback 返回 success=1
frida -U -f com.target.app -l fingerprint_bypass.js---
Phase 7: 其他检查项
补充检查清单?
├─ 键盘缓存 → /var/mobile/Library/Keyboard/*dynamic-text*
│ └─ 第三方键盘可窃取击键; secureTextEntry 是否设置
├─ 日志泄露 → idevicesyslog -u <id> | grep app
│ └─ NSLog/print 是否记录敏感信息
├─ 备份安全 → iTunes/Finder 备份中是否包含敏感数据
│ └─ NSURLIsExcludedFromBackupKey 是否排除关键文件
├─ Hot Patching → JSPatch / RN 热更新可被恶意 SDK 滥用
└─ 第三方 SDK → otool -L AppName → 权限是否超出必要---
自动化工具速查
| 工具 | 类型 | 用法 |
|---|---|---|
| MobSF | 静态+动态 | Docker 部署,上传 IPA |
| objection | 动态 | objection --gadget AppName explore |
| Frida | 动态 | frida -U -f com.target.app -l script.js |
| Keychain-Dumper | 数据提取 | 越狱设备直接运行 |
| class-dump | 静态 | class-dump AppName > headers.h |
| Malimite | 反编译 | GUI 工具,支持 Swift/ObjC |
| r2frida | 内存分析 | r2 frida://usb//AppName |
---
参考资源
iOS Frida/Objection 动态 Hook 与认证绕过
Frida 环境配置
越狱设备
# Cydia 添加 Frida 源
# https://build.frida.re
# 或手动安装
# 从 GitHub Releases 下载 frida-server-xx.x.x-ios-arm64.deb
dpkg -i frida-server.deb
# frida-server 自动以 root 启动
# PC 端验证
frida-ps -Uai非越狱设备 (Frida Gadget)
# 使用 objection 注入 Gadget 到 IPA
objection patchipa --source target.ipa --gadget-version 16.x.x
# 输出: target-frida-codesigned.ipa
# 签名(需开发者证书或自签)
ios-deploy --bundle target-frida-codesigned.ipaObjection 完整操作手册
连接与基础信息
# 连接到应用
objection --gadget "com.target.app" explore
# 获取环境路径
env
# Name Path
# BundlePath /var/containers/Bundle/Application/<UUID>/App.app
# CachesDirectory .../Library/Caches
# DocumentDirectory .../Documents
# LibraryDirectory .../Library
# 二进制信息
ios info binary数据存储审计
# NSUserDefaults(所有键值对)
ios nsuserdefaults get
# 检查: 是否包含 token / session / password / pin
# Keychain 完整 dump
ios keychain dump
# 输出每条 Keychain 项的:
# Service / Account / Data / AccessControl / Protection Class
# 特定 Keychain 搜索
ios keychain dump --json | python3 -m json.tool
# NSURLCredentialStorage
ios nsurlcredentialstorage dump
# Cookie
ios cookies get --json
# 检查: domain / value / isHTTPOnly / isSecure
# Plist 文件读取
ios plist cat /path/to/com.target.app.plistHook 与方法跟踪
# 列出所有 ObjC 类
ios hooking list classes
# 搜索类名
ios hooking search classes "Auth"
ios hooking search classes "Login"
ios hooking search classes "Keychain"
# 列出类的所有方法
ios hooking list class_methods "LoginViewController"
# 监控方法调用(参数 + 返回值)
ios hooking watch method "-[LoginViewController validatePassword:]" --dump-args --dump-return
# 监控整个类的所有方法
ios hooking watch class "LoginViewController"
# 设置方法返回值
ios hooking set return_value "-[JailbreakDetector isJailbroken]" false安全机制绕过
# SSL Pinning 禁用
ios sslpinning disable
# Hook TrustManager / URLSession delegate / NSURLConnection 等
# 越狱检测禁用
ios jailbreak disable
# Hook 文件检查 / URL Scheme / fork / 进程列表等
# 生物认证绕过
ios ui biometrics_bypass
# Hook evaluatePolicy → 强制返回 success = true
# 输出:
# Localized Reason for auth requirement: Please authenticate yourself
# OS authentication response: false
# Marking OS response as True instead
# Biometrics bypass hook complete
# 加密操作监控
ios monitor crypt
# 捕获所有 CommonCrypto / Security.framework 调用
# 显示: 算法 / 密钥 / IV / 输入输出数据Frida 自定义脚本
生物认证绕过 (evaluatePolicy)
// bypass_biometrics.js
if (ObjC.available) {
var LAContext = ObjC.classes.LAContext;
var hook = LAContext["- evaluatePolicy:localizedReason:reply:"];
Interceptor.attach(hook.implementation, {
onEnter: function(args) {
var block = new ObjC.Block(args[4]);
const callback = block.implementation;
block.implementation = function(error, value) {
console.log("[*] Biometric auth intercepted, forcing success");
const result = callback(1, null); // success = true, error = nil
return result;
};
},
});
console.log("[+] Biometric bypass installed");
}frida -U -f com.target.app -l bypass_biometrics.js越狱检测通用绕过
// jailbreak_bypass.js
if (ObjC.available) {
// Hook NSFileManager fileExistsAtPath
var NSFileManager = ObjC.classes.NSFileManager;
var fileExists = NSFileManager["- fileExistsAtPath:"];
var jailbreakPaths = [
"/Applications/Cydia.app",
"/Library/MobileSubstrate/MobileSubstrate.dylib",
"/bin/bash", "/usr/sbin/sshd", "/etc/apt",
"/usr/bin/ssh", "/private/var/lib/apt",
"/private/var/lib/cydia", "/private/var/stash"
];
Interceptor.attach(fileExists.implementation, {
onEnter: function(args) {
this.path = ObjC.Object(args[2]).toString();
},
onLeave: function(retval) {
for (var i = 0; i < jailbreakPaths.length; i++) {
if (this.path.indexOf(jailbreakPaths[i]) !== -1) {
console.log("[*] Hiding: " + this.path);
retval.replace(0); // false
return;
}
}
}
});
// Hook canOpenURL (cydia://)
var UIApplication = ObjC.classes.UIApplication;
var canOpen = UIApplication["- canOpenURL:"];
Interceptor.attach(canOpen.implementation, {
onEnter: function(args) {
this.url = ObjC.Object(args[2]).toString();
},
onLeave: function(retval) {
if (this.url.indexOf("cydia") !== -1) {
console.log("[*] Hiding canOpenURL: " + this.url);
retval.replace(0);
}
}
});
// Hook fork()
var fork = Module.findExportByName(null, "fork");
if (fork) {
Interceptor.attach(fork, {
onLeave: function(retval) {
console.log("[*] fork() blocked");
retval.replace(-1);
}
});
}
console.log("[+] Jailbreak detection bypass installed");
}SSL Pinning 绕过
// ssl_bypass_ios.js
if (ObjC.available) {
// Method 1: NSURLSession delegate
try {
var NSURLSessionConfiguration = ObjC.classes.NSURLSessionConfiguration;
// ... Hook URLSession:didReceiveChallenge:completionHandler:
} catch(e) {}
// Method 2: Hook SecTrustEvaluate
try {
var SecTrustEvaluate = Module.findExportByName("Security", "SecTrustEvaluate");
Interceptor.attach(SecTrustEvaluate, {
onLeave: function(retval) {
retval.replace(0); // errSecSuccess
}
});
} catch(e) {}
// Method 3: Hook SecTrustEvaluateWithError
try {
var SecTrustEvaluateWithError = Module.findExportByName("Security", "SecTrustEvaluateWithError");
Interceptor.attach(SecTrustEvaluateWithError, {
onLeave: function(retval) {
retval.replace(1); // true
}
});
} catch(e) {}
}内存分析
Fridump 内存提取
# 安装
pip install fridump
# dump 内存
fridump -U "AppName"
# 或使用 PID
fridump -U <PID>
# 搜索敏感数据
strings dump/* | grep -i "password\|token\|bearer\|session"
# 使用 r2frida 实时分析
r2 frida://usb//AppName
[0x00000000]> /\ password
[0x00000000]> /x 414141414141 # 搜索十六进制radare2 分析
# 打开 memory dump
r2 memdump.bin
# 搜索字符串
/ password
/ token
/ BEGIN RSA
# 搜索 hex
/x 504b0304 # ZIP header (PK..)
# 使用 rabin2 提取所有字符串
rabin2 -ZZ memdump.bin > all_strings.txtiOS IPA 静态分析与二进制安全检查
IPA 结构详解
IPA 文件本质是 ZIP 包,解压后结构如下:
Payload/
AppName.app/
Info.plist # 应用配置核心(权限/ATS/URL Scheme)
_CodeSignature/ # 代码签名(验证所有文件完整性)
Assets.car # 压缩资源(图标等)
Frameworks/ # 动态库 (.dylib / .framework)
PlugIns/ # 应用扩展 (.appex)
en.lproj/ # 语言包
AppName # 主二进制(Mach-O 格式)
PkgInfo # 应用类型和创建者代码二进制安全检查详细步骤
编译保护检查
# 1. PIE(Position Independent Executable)
# 随机化加载地址,增加利用难度
otool -hv AppName | grep PIE
# 期望: 包含 PIE flag
# 缺失: 二进制在固定地址加载,可预测布局
# 2. Stack Canaries(栈金丝雀)
# 检测栈缓冲区溢出
otool -I -v AppName | grep stack_chk
# 期望: 包含 stack_chk_guard 和 stack_chk_fail
# 缺失: 栈溢出可能不被检测
# 3. ARC(Automatic Reference Counting)
# 防止内存管理错误
otool -I -v AppName | grep objc_release
# 期望: 包含 _objc_release
# 缺失: 可能存在内存管理漏洞
# 4. 加密状态
otool -arch all -Vl AppName | grep -A5 LC_ENCRYPT
# cryptid = 1: App Store 加密版本(需脱壳)
# cryptid = 0: 未加密(可直接分析)
# 5. 使用的框架(判断认证方式)
otool -L AppName
# 包含 LocalAuthentication.framework → 使用生物认证
# 包含 Security.framework → 使用 Keychain不安全函数扫描
# 弱哈希算法
otool -Iv AppName | grep -w "_CC_MD5" # MD5
otool -Iv AppName | grep -w "_CC_SHA1" # SHA1
# 不安全随机数生成
otool -Iv AppName | grep -w "_random"
otool -Iv AppName | grep -w "_srand"
otool -Iv AppName | grep -w "_rand"
# 应使用 SecRandomCopyBytes
# 不安全字符串/内存操作
otool -Iv AppName | grep -w "_gets" # 无边界检查读取
otool -Iv AppName | grep -w "_memcpy" # 可溢出
otool -Iv AppName | grep -w "_strncpy" # 可截断
otool -Iv AppName | grep -w "_strlen" # 无终止符风险
otool -Iv AppName | grep -w "_sprintf" # 格式化字符串
otool -Iv AppName | grep -w "_vsprintf" # 格式化字符串
otool -Iv AppName | grep -w "_sscanf" # 解析风险
otool -Iv AppName | grep -w "_strtok" # 不可重入
otool -Iv AppName | grep -w "_alloca" # 栈分配风险Info.plist 深度审计
App Transport Security (ATS)
<!-- 危险: 完全禁用 ATS -->
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
<!-- 较安全: 仅对特定域禁用 -->
<key>NSAppTransportSecurity</key>
<dict>
<key>NSExceptionDomains</key>
<dict>
<key>legacy-api.target.com</key>
<dict>
<key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
<true/>
</dict>
</dict>
</dict>URL Scheme 声明
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLSchemes</key>
<array>
<string>myapp</string>
<string>myapp-auth</string>
</array>
</dict>
</array>检查点:
- URL Scheme 是否传递敏感数据(Token/密码)
- 其他应用可注册相同 Scheme 进行劫持
- 参数是否做输入验证
Universal Links 配置
# 检查 Associated Domains
grep -A 5 "com.apple.developer.associated-domains" AppName.entitlements
# 验证服务端配置
curl https://target.com/.well-known/apple-app-site-association权限声明审计
# 所有 Usage Description(系统权限说明)
grep -n "UsageDescription" Info.plist
# 常见权限:
# NSCameraUsageDescription → 相机
# NSMicrophoneUsageDescription → 麦克风
# NSLocationWhenInUseUsageDescription → 位置
# NSPhotoLibraryUsageDescription → 照片库
# NSContactsUsageDescription → 通讯录
# 检查: 应用申请的权限是否超出功能需要ObjC/Swift 类分析
class-dump 提取
# 生成所有类的头文件
class-dump AppName > all_headers.h
# 搜索认证相关
grep -n "login\|auth\|password\|credential\|token" all_headers.h
# 搜索加密相关
grep -n "encrypt\|decrypt\|AES\|RSA\|hash\|digest" all_headers.h
# 搜索网络相关
grep -n "NSURLSession\|URLRequest\|HTTPClient\|API" all_headers.h
# 搜索存储相关
grep -n "NSUserDefaults\|Keychain\|CoreData\|Realm\|SQLite" all_headers.h
# 搜索越狱检测
grep -n "jailbreak\|jailbroken\|root\|cydia\|substrate" all_headers.hGhidra/Hopper 反编译
适用于需要深入分析具体方法实现的场景:
# Ghidra 命令行分析
ghidraRun
# 导入 Mach-O 二进制 → 自动分析 → 查看反编译结果
# Hopper(商业,但试用可用)
# 直接拖入 Mach-O 文件
# 支持 ObjC 方法名还原
# 重点关注:
# 1. 加密密钥硬编码
# 2. 认证逻辑缺陷
# 3. 越狱检测实现细节
# 4. SSL Pinning 实现方式应用数据路径
系统应用
/Applications/ # 系统应用
/User/Applications/ # App Store 安装的应用
/User/Library/ # 用户级数据
/User/Library/Notes/notes.sqlite # 系统备忘录用户应用沙箱
/var/mobile/Containers/Bundle/Application/<UUID>/AppName.app/
# 应用 Bundle(只读,包含二进制和资源)
/var/mobile/Containers/Data/Application/<UUID>/
Documents/ # 用户生成数据(会备份)
Library/
Preferences/ # NSUserDefaults(<BundleID>.plist)
Caches/ # 缓存(Cache.db 等)
Application Support/ # CoreData / SQLite
Cookies/ # cookies.binarycookies
tmp/ # 临时文件
/var/mobile/Containers/Shared/AppGroup/<GroupID>/
# App Group 共享数据定位应用目录
# objection
env
# 返回 BundlePath / CachesDirectory / DocumentDirectory / LibraryDirectory
# 命令行
find /private/var/containers -name "AppName*" 2>/dev/null
# 通过进程
ps -ef | grep -i AppName
lsof -p <pid> | grep "/containers" | head -1Related skills
Testing & QAtesting