Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
wgpsec avatar

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-pentesting

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs26
repo stars1.6k
Last updatedJuly 19, 2026
Repositorywgpsec/aboutsecurity

What it does

Helps with testing & qa tasks during AI-assisted development.

Files

SKILL.mdMarkdownGitHub ↗

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
objectionFrida 自动化封装pip install objection
otool / jtool2二进制分析macOS 内置 / brew
class-dumpObjC 类信息提取brew install class-dump
Ghidra / IDA / Hopper反汇编/反编译各自官网
Burp Suite流量拦截PortSwigger
MobSF自动化静态+动态分析Docker 部署
ideviceinstallerIPA 安装/管理brew install ideviceinstaller
ios-deploy设备部署brew install ios-deploy
Keychain-DumperKeychain 数据提取GitHub (越狱设备)
SSL Kill Switch 2SSL 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
CFBundleURLTypesURL 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.js

Objection 核心功能

# 连接到应用
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.com

Universal 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

---

参考资源

Related skills

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.