Communitygithub.com

使用 Objection 分析 iOS App 安全性

此技能說明如何使用 Objection 工具對 iOS 應用程式進行執行時安全評估,包含資料儲存、網路通訊、身份驗證與二進位保護等層面的測試。

使用 Objection 分析 iOS App 安全性 是什麼?

此技能旨在指導安全研究人員與滲透測試工程師,使用 Objection 這款基於 Frida 的執行時行動應用程式探索工具,對 iOS 應用程式進行授權的安全測試。技能涵蓋從環境準備(越獄與非越獄裝置)、連接到目標應用程式,到執行七大類測試步驟:資料儲存安全(金鑰鏈、NSUserDefaults、SQLite)、網路安全(SSL Pinning 繞過)、身份驗證與授權(方法掛鉤)、二進位保護(越獄檢測繞過)、平台互動(URL Scheme、剪貼簿監控)等。Objection 提供互動式 REPL 與預先建置的命令,讓測試人員無需原始碼即可快速探索應用程式行為。技能也強調合法性,提醒僅在授權範圍內使用,並指出常見陷阱如 Frida 偵測、Swift 名稱修飾等。支援越獄裝置(Frida Server)與非越獄裝置(Frida Gadget)。

相容平台~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 App 安全性 是做什麼的?

使用時機

在以下情況使用此技能:

  • 在授權的滲透測試期間,對 iOS 應用程式進行執行時安全評估
  • 檢查 iOS 金鑰鏈、檔案系統與記憶體中的敏感資料外洩
  • 在安全測試中繞過客戶端安全控制(SSL Pinning、越獄檢測)
  • 在無原始碼的情況下評估 iOS App 的執行時行為

未經明確授權,請勿在正式環境裝置上使用此技能 — Objection 會修改 App 執行時行為,可能觸發安全監控機制。

先決條件

  • 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 附加到目標 App

# 透過 Bundle ID 附加到正在執行的 App
objection --gadget "com.target.app" explore

# 或重新啟動 App
objection --gadget "com.target.app" explore --startup-command "ios hooking list classes"

附加成功後,Objection 會提供一個互動式 REPL 以便進行執行時探索。

步驟 3:評估資料儲存安全性 (MASVS-STORAGE)

# 傾印 App 可存取的 iOS 金鑰鏈項目
ios keychain dump

# 列出 App 沙盒中的檔案
ios plist cat Info.plist
env  # 顯示 App 環境路徑

# 檢查 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)

# 列出 App 註冊的 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注入到 App 處理程序中的共享函式庫,無需越獄即可啟用 Frida 檢測
金鑰鏈 (Keychain)iOS 安全憑證儲存系統;Objection 可傾印目標 App 金鑰鏈存取群組內可存取的項目
SSL Pinning 繞過修改憑證驗證邏輯的執行時行為,允許代理程式攔截 HTTPS 流量
方法掛鉤 (Method Hooking)在執行時攔截 Objective-C/Swift 方法呼叫,以觀察引數、回傳值並修改行為

工具與系統

  • Objection:基於 Frida 的高階行動安全探索工具組,提供預先建置的命令
  • Frida:動態檢測框架,提供 JavaScript 注入至原生 App 處理程序
  • Frida-tools:Frida 的 CLI 工具,包含 frida-ps、frida-trace 與 frida-discover
  • ideviceinstaller:跨平台工具,用於透過 USB 安裝/管理 iOS App
  • Burp Suite:HTTP 代理程式,用於 SSL Pinning 繞過後攔截流量

常見陷阱

  • App 在附加時崩潰:某些 App 實作了 Frida 檢測。請使用 --startup-command 在 App 生命週期早期掛鉤反 Frida 檢查。
  • 金鑰鏈存取範圍:Objection 僅能傾印 App 所屬存取群組內的金鑰鏈項目。系統金鑰鏈項目需要額外的越獄級別工具。
  • Swift 名稱修飾:Swift 方法名稱在執行時會被修飾。請搭配 ios hooking list classes 與 grep 來找出未修飾的名稱。
  • 非持續性變更:所有 Objection 修改僅存在於執行時,App 重新啟動後即會重置。請立即記錄發現結果。

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,

相關技能