Communitygithub.com

使用 Objection 分析 iOS 应用安全性

此技能指导如何使用 Objection 框架对 iOS 应用进行运行时安全评估,包括数据存储检查、网络通信分析、身份验证机制审查以及二进制保护绕过等。

使用 Objection 分析 iOS 应用安全性 是什么?

该技能旨在帮助安全测试人员在授权渗透测试中,利用 Objection(基于 Frida 的动态移动探索工具包)对 iOS 应用进行深入的运行时安全分析。技能涵盖了从环境准备、应用附加到七步核心工作流程的完整过程:包括数据存储安全评估(Keychain、SQLite、NSUserDefaults)、网络安全评估(SSL Pinning 绕过)、身份验证与授权机制审查(方法钩子)、二进制保护评估(越狱检测绕过)、平台交互审查(URL Scheme 钩子)等。技能支持越狱设备(通过 Frida Server)和非越狱设备(通过 Frida Gadget 重打包 IPA)两种测试场景。关键概念包括 Objection、Frida Gadget、Keychain、SSL Pinning 绕过和方法钩子。测试者需要注意常见陷阱,如应用崩溃(需要早期钩子)、Keychain 访问范围限制、Swift 方法名混淆以及所有修改的临时性。适用平台包括 macOS(推荐)、iOS 设备,并依赖 Python、Frida、Objection 和 Burp Suite 等工具。

兼容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/mukul975/Anthropic-Cybersecurity-Skills/tree/main/skills/analyzing-ios-app-security-with-objection

在你喜欢的 AI 中提问

打开一个已预加载此 Agent Skill 的新对话。

文档

使用 Objection 分析 iOS 应用安全性 是做什么的?

使用时机

在以下情况下使用此技能:

  • 在授权渗透测试期间对 iOS 应用进行运行时安全评估
  • 检查 iOS Keychain、文件系统和内存是否存在敏感数据泄露
  • 在安全测试中绕过客户端安全控制(SSL Pinning、越狱检测)
  • 在无源代码的情况下评估 iOS 应用的运行时行为

请勿在未获得明确授权的情况下在生产设备上使用此技能——Objection 会修改应用的运行时行为,可能触发安全监控。

前提条件

  • Python 3.10+ 并安装 pip
  • 安装 Objection:pip install objection
  • 安装 Frida:pip install frida-tools
  • 目标 iOS 设备(已越狱并安装 Frida Server,或未越狱但已重打包 IPA)
  • 对于未越狱设备:使用 objection patchipa 将 Frida Gadget 注入 IPA
  • 建议使用 macOS 进行 iOS 测试(Xcode、ideviceinstaller)
  • 通过 USB 连接目标设备,或使用网络 Frida Server

工作流程

步骤 1:准备测试环境

针对已越狱设备:

# 通过 Cydia/Sileo 在设备上安装 Frida Server
# SSH 到设备并启动 Frida Server
ssh root@<device_ip> "/usr/sbin/frida-server -D"

# 验证 Frida 连接
frida-ps -U  # 列出 USB 连接设备上的进程

针对未越狱设备(授权测试):

# 使用 Frida Gadget 重打包 IPA
objection patchipa --source target.ipa --codesign-signature "Apple Development: [email protected]"

# 安装重打包后的 IPA
ideviceinstaller -i target-patched.ipa

步骤 2:将 Objection 附加到目标应用

# 通过 Bundle ID 附加到正在运行的应用
objection --gadget "com.target.app" explore

# 或者全新启动应用
objection --gadget "com.target.app" explore --startup-command "ios hooking list classes"

附加成功后,Objection 会提供一个交互式 REPL 用于运行时探索。

步骤 3:评估数据存储安全性 (MASVS-STORAGE)

# 导出应用可访问的 iOS Keychain 条目
ios keychain dump

# 列出应用沙盒中的文件
ios plist cat Info.plist
env  # 显示应用环境路径

# 检查 NSUserDefaults 中的敏感数据
ios nsuserdefaults get

# 列出 SQLite 数据库
sqlite connect app_data.db
sqlite execute query "SELECT * FROM credentials"

# 检查粘贴板中的敏感数据
ios pasteboard monitor

步骤 4:评估网络安全 (MASVS-NETWORK)

# 禁用 SSL/TLS 证书固定
ios sslpinning disable

# 通过在 Burp Suite 代理中观察流量来验证固定是否被绕过
# 监控网络相关类的方法调用
ios hooking watch class NSURLSession
ios hooking watch class NSURLConnection

步骤 5:检查身份验证和授权 (MASVS-AUTH)

# 列出所有 Objective-C 类
ios hooking list classes

# 搜索与身份验证相关的类
ios hooking search classes Auth
ios hooking search classes Login
ios hooking search classes Token

# 钩取身份验证方法以观察参数
ios hooking watch method "+[AuthManager validateToken:]" --dump-args --dump-return

# 监控生物认证调用
ios hooking watch class LAContext

步骤 6:评估二进制保护 (MASVS-RESILIENCE)

# 检查越狱检测实现
ios jailbreak disable

# 模拟越狱检测绕过
ios jailbreak simulate

# 列出已加载的框架和库
memory list modules

# 在内存中搜索敏感字符串
memory search "password" --string
memory search "api_key" --string
memory search "Bearer" --string

# 导出特定内存区域
memory dump all dump_output/

步骤 7:审查平台交互 (MASVS-PLATFORM)

# 列出应用注册的 URL Scheme
ios info binary
ios bundles list_frameworks

# 钩取 URL Scheme 处理程序
ios hooking watch method "-[AppDelegate application:openURL:options:]" --dump-args

# 监控剪贴板访问
ios pasteboard monitor

# 检查自定义键盘限制
ios hooking search classes UITextField

关键概念

术语定义
Objection基于 Frida 的运行时移动探索工具包,提供用于常见安全测试任务的预构建脚本
Frida Gadget注入到应用进程中的共享库,可在无需越狱的情况下启用 Frida 插桩
KeychainiOS 安全凭据存储系统;Objection 可以导出目标应用 Keychain 访问组中可访问的条目
SSL Pinning 绕过运行时修改证书验证逻辑,以允许代理拦截 HTTPS 流量
方法钩子在运行时拦截 Objective-C/Swift 方法调用,以观察参数、返回值并修改行为

工具与系统

  • Objection:基于 Frida 的高层移动安全探索工具包,提供预构建命令
  • Frida:动态插桩框架,支持将 JavaScript 注入原生应用进程
  • Frida-tools:Frida 的 CLI 工具集,包括 frida-ps、frida-trace 和 frida-discover
  • ideviceinstaller:跨平台工具,用于通过 USB 安装/管理 iOS 应用
  • Burp Suite:HTTP 代理,用于在 SSL Pinning 绕过之后拦截流量

常见陷阱

  • 附加时应用崩溃:某些应用实现了 Frida 检测。使用 --startup-command 在应用生命周期早期钩取反 Frida 检查。
  • Keychain 访问范围:Objection 只能导出应用访问组内的 Keychain 条目。系统 Keychain 条目需要单独的越狱级工具。
  • Swift 名称混淆:Swift 方法名在运行时会被混淆。使用 ios hooking list classes 配合 grep 查找非混淆名称。
  • 非持久性更改:所有 Objection 修改仅在运行时有效,应用重启后将重置。请立即记录发现。

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

abusing-dpapi-for-credential-access

Extract and decrypt Windows DPAPI-protected secrets (Credential Manager, browser logins/cookies, Wi-Fi credentials, KeePass keys) online or offline using SharpDPAPI, SharpChrome, Mimikatz, or Impacket

abusing-shadow-credentials-for-privesc

Take over Active Directory accounts by writing attacker-controlled public keys to msDS-KeyCredentialLink (Shadow Credentials) with pyWhisker, Whisker, or Certipy, then authenticate via PKINIT to recover the target

achieving-cmmc-level-2-compliance

>-

acquiring-disk-image-with-dd-and-dcfldd

Create forensically sound bit-for-bit disk images with dd or dcfldd on a Linux forensic workstation, preserving evidence integrity through hash verification (MD5/SHA) during acquisition. Use when imaging a suspect drive, USB device, or memory card for investigation, preserving volatile disk evidence during incident response, or producing a verified copy for legal or law-enforcement proceedings before any destructive analysis.

analyzing-active-directory-acl-abuse

Detect dangerous ACL misconfigurations in Active Directory using ldap3

analyzing-android-malware-with-apktool

Perform static analysis of Android APK malware using apktool for resource decompilation, jadx for Java source recovery, and androguard for manifest inspection, dangerous permission-combination detection, and identification of obfuscated code, dynamic code loading, and reflection-based API calls. Use to statically triage a suspicious APK without executing it or to build mobile malware detection rules.

analyzing-api-gateway-access-logs

Parses API Gateway access logs (AWS API Gateway, Kong, Nginx) to detect

analyzing-apt-group-with-mitre-navigator

Query ATT&CK data with attackcti, mitreattack-python, and stix2, then build MITRE ATT&CK Navigator layers and multi-layer heatmap overlays mapping one or more APT groups

analyzing-azure-activity-logs-for-threats

Queries Azure Monitor activity logs and sign-in logs via azure-monitor-query

analyzing-bootkit-and-rootkit-samples

Analyzes bootkit and advanced rootkit malware infecting the Master

analyzing-browser-forensics-with-hindsight

Parse Chromium-based browser databases with Hindsight to extract and correlate browsing history, downloads, cookies, cached content, autofill data, saved passwords, and extensions from Chrome, Edge, Brave, Opera, and Vivaldi into a unified timeline (XLSX, JSON, or SQLite output). Use during incident response, insider-threat investigations, or criminal cases when you need to reconstruct a user

analyzing-campaign-attribution-evidence

Systematically evaluate cyber-campaign evidence to attribute an operation to a threat actor, using the Diamond Model and Analysis of Competing Hypotheses (ACH) to weigh infrastructure overlaps, TTP consistency, malware code similarity, and timing/language artifacts into confidence-weighted attribution assessments. Use when an incident investigation needs a defensible attribution confidence level.

analyzing-certificate-transparency-for-phishing

Monitor Certificate Transparency logs using crt.sh and Certstream to

analyzing-cloud-storage-access-patterns

Detect abnormal access in AWS S3, GCS, and Azure Blob Storage by analyzing CloudTrail Data Events, GCS audit logs, and Azure Storage Analytics for after-hours bulk downloads, new-IP access, and API-call spikes (e.g. GetObject) via statistical baselines and time-series anomaly detection. Use when investigating suspected cloud data exfiltration or building related detection rules.

analyzing-cobalt-strike-beacon-configuration

Extract and analyze Cobalt Strike beacon configuration from PE files

analyzing-cobaltstrike-malleable-c2-profiles

Parse and analyze Cobalt Strike Malleable C2 profiles with dissect.cobaltstrike (profiles and beacon-payload configs) and pyMalleableC2 (AST parsing) to extract HTTP/DNS transforms, URIs, headers, sleep/jitter, and injection behavior, then generate network detection signatures. Use when reverse-engineering a captured malleable profile or building detections against Cobalt Strike Beacon traffic.

analyzing-command-and-control-communication

Analyzes malware C2 communication over HTTP, HTTPS, DNS, and custom

analyzing-cyber-kill-chain

Analyzes intrusion activity against the Lockheed Martin Cyber Kill Chain

analyzing-disk-image-with-autopsy

Perform comprehensive forensic analysis of raw (dd), E01, or AFF disk images with Autopsy and The Sleuth Kit, recovering deleted files, examining metadata and embedded artifacts, keyword searching, and building investigation timelines with visual reports. Use for structured analysis of a forensic disk image or when stakeholders need visual reports from evidence.

analyzing-dns-logs-for-exfiltration

Analyzes DNS query logs to detect data exfiltration via DNS tunneling,

相关技能