skills/conducting-mobile-application-penetration-test/SKILL.md
对 Android 和 iOS 应用执行移动应用渗透测试,使用 Frida、Objection 和 MobSF 识别不安全的数据存储、证书固定绕过、API 漏洞、二进制保护缺陷和运行时操控问题。
npx skillsauth add killvxk/cybersecurity-skills-zh conducting-mobile-application-penetration-testInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
移动应用渗透测试遵循 OWASP 移动应用安全测试指南(MASTG)和移动应用安全验证标准(MASVS),评估 Android 和 iOS 应用的安全性。测试涵盖应用二进制文件的静态分析、动态运行时分析、API 通信安全、数据存储评估和逆向工程抵抗力。
# 使用 jadx 反编译 APK
jadx -d output_dir target.apk
# 搜索硬编码的密钥
grep -rn "api_key\|secret\|password\|token\|firebase" output_dir/sources/
# 检查 AndroidManifest.xml
# 查找:导出的组件、debuggable=true、allowBackup=true
grep -i "exported\|debuggable\|allowBackup\|android:permission" output_dir/resources/AndroidManifest.xml
# MobSF 自动化静态分析
# 上传 APK 到 MobSF Web 界面(http://localhost:8000)
# 或使用 REST API:
curl -F "[email protected]" http://localhost:8000/api/v1/upload \
-H "Authorization: <api_key>"
# 检查不安全的网络安全配置
cat output_dir/resources/res/xml/network_security_config.xml
# 查找:cleartextTrafficPermitted="true"、带用户证书的 trust-anchors
# 分析原生库
find output_dir/resources/lib -name "*.so" -exec strings {} \; | grep -i "key\|secret"
# 通过 adb 安装到设备
adb install target.apk
# 在设备上启动 Frida 服务器
adb push frida-server /data/local/tmp/
adb shell chmod 755 /data/local/tmp/frida-server
adb shell /data/local/tmp/frida-server &
# Objection — 运行时探索
objection -g com.target.app explore
# 在 Objection 内:
# 列出 Activity 和 Service
android hooking list activities
android hooking list services
# 绕过 Root 检测
android root disable
# 绕过 SSL 固定
android sslpinning disable
# 转储 Keystore
android keystore list
# 枚举 SharedPreferences
android hooking search classes SharedPreferences
# 监控剪贴板
android clipboard monitor
# 探索文件系统
env
ls /data/data/com.target.app/
file download /data/data/com.target.app/shared_prefs/
file download /data/data/com.target.app/databases/
# 检查 SharedPreferences 中的敏感数据
adb shell cat /data/data/com.target.app/shared_prefs/*.xml
# 检查 SQLite 数据库
adb pull /data/data/com.target.app/databases/app.db
sqlite3 app.db ".dump" | grep -i "password\|token\|session"
# 检查外部存储中的数据
adb shell ls /sdcard/Android/data/com.target.app/
# 检查日志中的敏感数据
adb logcat -d | grep -i "token\|password\|session\|api_key"
# 备份提取
adb backup -apk -shared com.target.app -f backup.ab
java -jar abe.jar unpack backup.ab backup.tar
tar xf backup.tar
# 在设备上配置 Burp 代理
# 设置 > WiFi > 代理 > 手动 > 192.168.1.100:8080
# 在设备上安装 Burp CA 证书
# 对于有证书固定的应用:
# 方法 1:Objection
objection -g com.target.app explore
android sslpinning disable
# 方法 2:Frida 脚本
frida -U -f com.target.app -l ssl_pinning_bypass.js --no-pause
# 方法 3:修补 APK
# 使用 apktool 反编译,修改 network_security_config.xml,重新打包
apktool d target.apk -o decompiled/
# 编辑 res/xml/network_security_config.xml 以信任用户 CA
apktool b decompiled/ -o patched.apk
jarsigner -keystore my.keystore patched.apk alias_name
# 解密 IPA(从越狱设备)
# 使用 frida-ios-dump
python3 dump.py com.target.app
# 或在设备上使用 Clutch
Clutch -d com.target.app
# 使用 class-dump 分析二进制文件
class-dump -H TargetApp -o headers/
grep -rn "password\|token\|secret\|apiKey" headers/
# 检查 Info.plist
plutil -p Payload/TargetApp.app/Info.plist
# 查找:ATS 例外、URL 方案、导出的 UTI
# 检查不安全的 API 连接
grep -i "http://" headers/*.h
grep -i "NSAllowsArbitraryLoads" Payload/TargetApp.app/Info.plist
# iOS 上的 Frida
frida -U -f com.target.app -l ios_bypass.js --no-pause
# iOS 的 Objection
objection -g com.target.app explore
# 在 Objection 内:
ios sslpinning disable
ios jailbreak disable
ios keychain dump
ios plist cat NSUserDefaults
ios cookies get
ios nsurlcredentialstorage dump
# 检查存储在钥匙串中的密钥
objection -g com.target.app explore --startup-command 'ios keychain dump'
# 检查数据保护类
objection -g com.target.app explore --startup-command 'ios info binary'
# 通过 Burp Suite 测试捕获的 API 调用:
# 认证绕过
# 修改 JWT 令牌,测试算法混淆(none、HS256 vs RS256)
# IDOR 测试
# 修改 API 请求中的用户标识符
# 速率限制
# 暴力破解 OTP/PIN 端点
# 输入验证
# 测试 API 参数中的注入
# 业务逻辑
# 在请求中操控价格、数量、订阅级别
| 类别 | 测试项 | 状态 | |----------|------|--------| | MASVS-STORAGE-1 | 系统日志中的敏感数据 | [ ] | | MASVS-STORAGE-2 | 备份中的敏感数据 | [ ] | | MASVS-STORAGE-3 | IPC 中的敏感数据 | [ ] | | MASVS-CRYPTO-1 | 适当的密码学 API | [ ] | | MASVS-AUTH-1 | 本地认证绕过 | [ ] | | MASVS-NETWORK-1 | 使用受信任 CA 的 TLS | [ ] | | MASVS-NETWORK-2 | 证书固定 | [ ] | | MASVS-PLATFORM-1 | 导出组件已安全保护 | [ ] | | MASVS-CODE-1 | 代码混淆 | [ ] | | MASVS-RESILIENCE-1 | Root/越狱检测 | [ ] |
testing
设计并执行社会工程学渗透测试,包括钓鱼、语音钓鱼、短信钓鱼和物理借口活动,以衡量人员安全韧性并识别培训差距。
testing
主持结构化的事件后审查,以识别根本原因、记录有效和无效的措施,并提出可操作的改进建议以提升未来的事件响应能力。
testing
通过分析举报的邮件、提取指标、评估凭据受攻陷情况、在全组织范围隔离恶意邮件并修复受影响账号来响应网络钓鱼事件。涵盖邮件头分析、URL/附件沙箱检测和邮箱范围清除操作。适用于网络钓鱼响应、邮件事件、凭据钓鱼、鱼叉式网络钓鱼调查或钓鱼修复相关请求。
tools
票据传递(Pass-the-Ticket,PtT)是一种横向移动技术,使用窃取的 Kerberos 票据(TGT 或 TGS)在不知道用户密码的情况下向服务进行认证。通过从已控制的主机内存中提取 Kerberos 票据,攻击者可以将这些票据注入自己的会话以模拟票据所有者。