agentleFS
ivRodriguezCAivRodriguezCA/MobHunt/.claude/skills/ios-analysis/SKILL.md

ios-analysis

Skill37 starsChanged 3 months agoMITView on GitHub

Load when analyzing an iOS IPA or .app bundle, covering Mach-O and entitlements inspection, Info.plist and App Transport Security review, URL scheme enumeration, Keychain protection classes, WebView bridges, and embedded framework checks.

The file

We split this skill into the rules it gives an agent

6 rules. About 0 are common, 4 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Rule: Always analyze the arm64 slice.

    line 28
  2. Very specific:

    Look for ProvisionsAllDevices (enterprise) vs ProvisionedDevices (dev/ad-hoc) vs neither (App Store).

    line 89
  3. Very specific:

    Assessment: Check if the scheme is used for OAuth callbacks (oauth, auth, callback, login in scheme name or path).

    line 133
  4. Distinctive:

    Search for these symbols:

    line 162
  5. Distinctive:

    No content blocker support

    line 187
  6. Distinctive:

    Check the URL scheme handler code for URL validation.

    line 201

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

iOS Analysis: Platform-Specific Techniques

This skill defines iOS-specific analysis techniques for MobHunt hunter agents. It is loaded by /hunt-ios and /recon commands and used by iOS hunter agent instances.


Binary Format: Mach-O

iOS executables and frameworks use the Mach-O format. Key analysis points:

FAT (Universal) Binaries

Modern App Store binaries are typically arm64-only, but some include multiple architectures:

# Check architecture
lipo -info <binary>

# Extract arm64 slice for analysis
lipo <binary> -thin arm64 -output <binary>_arm64

Rule: Always analyze the arm64 slice. Ignore x86_64 (Simulator) slices; they may have different code paths and debug features.

Mach-O Headers and Load Commands

# View load commands (linked frameworks, RPATHs, encryption info)
otool -l <binary>

# Key load commands:
# LC_ENCRYPTION_INFO_64: cryptid field (0 = decrypted, 1 = encrypted)
# LC_LOAD_DYLIB: linked frameworks
# LC_RPATH: runtime search paths
# LC_CODE_SIGNATURE: code signature info

Symbol Analysis

# List all symbols
nm -gU <binary>

# Objective-C class list
otool -o <binary> | grep "name 0x"

# Swift symbols (mangled)
nm <binary> | grep "_$s"

# Imported symbols (external dependencies)
nm -u <binary>

Entitlements Analysis

Entitlements are the ground truth for iOS app capabilities. Extract with:

codesign -d --entitlements :- <app_bundle>

Dangerous Entitlements

EntitlementRiskFinding?
get-task-allowAllows debugging, code injectionYES if production build
com.apple.private.*Private API accessYES, Apple-only entitlements in a third-party app
com.apple.security.cs.disable-library-validationLoad unsigned dylibsYES
com.apple.security.cs.allow-dyld-environment-variablesDYLD injectionYES
keychain-access-groupsCross-app Keychain sharingCheck what groups
com.apple.developer.associated-domainsUniversal linksCheck AASA config
aps-environmentPush notificationsInformational

TestFlight vs Production Detection

TestFlight builds have get-task-allow = true and beta-reports-active = true. This is normal for TestFlight; only flag if the build is a production App Store release.

Check embedded.mobileprovision:

security cms -D -i embedded.mobileprovision

Look for ProvisionsAllDevices (enterprise) vs ProvisionedDevices (dev/ad-hoc) vs neither (App Store).


Info.plist Security Analysis

App Transport Security (ATS)

<!-- WORST: All HTTP allowed -->
<key>NSAppTransportSecurity</key>
<dict>
    <key>NSAllowsArbitraryLoads</key>
    <true/>
</dict>

<!-- BAD: Specific domain exceptions -->
<key>NSExceptionDomains</key>
<dict>
    <key>api.example.com</key>
    <dict>
        <key>NSExceptionAllowsInsecureHTTPLoads</key>
        <true/>
    </dict>
</dict>

Assessment: ATS bypass alone is informational. Only a finding when chained with evidence that sensitive data (tokens, credentials, PII) is sent over the excepted HTTP connection.

URL Schemes

<key>CFBundleURLTypes</key>
<array>
    <dict>
        <key>CFBundleURLSchemes</key>
        <array>
            <string>myapp</string>
            <string>myapp-auth</string>
        </array>
    </dict>
</array>

Assessment: Check if the scheme is used for OAuth callbacks (oauth, auth, callback, login in scheme name or path). URL scheme hijacking is standalone-reportable if the scheme carries sensitive data.

Queried URL Schemes

<key>LSApplicationQueriesSchemes</key>

These reveal which apps the target communicates with, which is useful for understanding the data flow.


Keychain Analysis

Protection Classes (Weakest to Strongest)

ClassRiskWhen Accessible
kSecAttrAccessibleAlwaysCRITICALAlways, even locked. Deprecated but still used.
kSecAttrAccessibleAlwaysThisDeviceOnlyHIGHAlways, but not in backups
kSecAttrAccessibleAfterFirstUnlockMEDIUMAfter first unlock until reboot. Available in background.
kSecAttrAccessibleAfterFirstUnlockThisDeviceOnlyMEDIUMSame, not in backups
kSecAttrAccessibleWhenUnlockedLOWOnly when device unlocked
kSecAttrAccessibleWhenUnlockedThisDeviceOnlySAFEUnlocked + not in backups
kSecAttrAccessibleWhenPasscodeSetThisDeviceOnlySAFESTRequires passcode set

Finding: kSecAttrAccessibleAlways or kSecAttrAccessibleAfterFirstUnlock for authentication tokens, passwords, or encryption keys. Must demonstrate the extraction path (backup, locked device access).

Keychain API Patterns in Binary

Search for these symbols:

  • SecItemAdd: storing items
  • SecItemCopyMatching: retrieving items
  • SecItemUpdate: modifying items
  • kSecClass: item class (generic password, internet password, certificate, key)
  • kSecAttrAccessible: protection class assignment

WebView Analysis

WKWebView (Modern)

PatternRisk
WKScriptMessageHandlerJS → Native bridge. What functions are exposed?
evaluateJavaScript:Native → JS execution. What data is passed?
loadRequest: / loadHTMLString:What URLs are loaded? User-controlled?
navigationAction.request.URLURL validation in navigation delegate?
WKWebViewConfiguration.preferences.javaScriptEnabledJS enabled? (default: YES)

UIWebView (Deprecated, Still Found)

UIWebView is inherently less secure:

  • stringByEvaluatingJavaScriptFromString: has no completion handler and runs synchronously
  • No content blocker support
  • JSContext bridge can expose all ObjC objects

Finding: UIWebView usage in production is itself a finding (Apple deprecated it and rejects new submissions).

Attack Pattern: Deep Link → WebView

1. App registers myapp:// URL scheme
2. URL scheme handler: myapp://webview?url=<URL>
3. Handler loads <URL> in WKWebView
4. If WebView has JS bridge → attacker controls native function calls

Check the URL scheme handler code for URL validation. If it loads arbitrary URLs in a WebView with native bridges, this is HIGH/CRITICAL.


Framework & SDK Analysis

Framework Location

Embedded frameworks live in AppName.app/Frameworks/:

Frameworks/
  FirebaseCore.framework/
  Alamofire.framework/
  CustomSDK.framework/

Version Extraction

SDK versions are typically in:

  • Info.plist inside the framework bundle (CFBundleShortVersionString)
  • Binary strings (search for version patterns like \d+\.\d+\.\d+)
  • Framework header comments

Debug Frameworks (Auto-Flag)

FrameworkPurposeFinding?
FLEX.frameworkRuntime debuggingYES, exposes all runtime internals
Flipper.frameworkFacebook debug toolYES, network/layout/prefs inspection
Reveal.frameworkUI debuggingYES, full view hierarchy access
CocoaDebug.frameworkNetwork loggingYES, logs all network traffic

Data Storage Locations

LocationProtectionRisk Assessment
NSUserDefaultsNone (plist in Library/Preferences/)HIGH if tokens/credentials stored
KeychainPer-item protection classDepends on protection class
Core Data (SQLite)File protectionMEDIUM if unencrypted with PII
Documents/File protection (backed up)MEDIUM, accessible in backups
Library/Caches/File protection (not backed up)LOW; cache, less sensitive
tmp/File protection (cleared on reboot)LOW, ephemeral

File Protection Levels

NSFileProtectionComplete                              best:    locked device means no access
NSFileProtectionCompleteUnlessOpen                    good:    can write while locked
NSFileProtectionCompleteUntilFirstUserAuthentication  default: accessible after unlock
NSFileProtectionNone                                  worst:   always accessible

Crypto Analysis Patterns

Secure Patterns (Not Findings)

  • SecKeyCreateEncryptedData / SecKeyCreateDecryptedData: Apple CryptoKit
  • CC_SHA256: SHA-256 hashing
  • CCCrypt with kCCAlgorithmAES128 + kCCModeCBC or kCCModeGCM: AES with a secure mode
  • SecRandomCopyBytes: secure random

Insecure Patterns (Potential Findings)

PatternIssue
CC_MD5MD5 for security-critical operations
kCCAlgorithmDES / kCCAlgorithm3DESWeak ciphers
kCCModeECBECB mode preserves patterns
kCCOptionECBModeSame issue, ECB mode
Hardcoded key or iv bytes near crypto callsHardcoded key material

Assessment: Weak crypto is only a finding if used for security-critical operations (authentication, token encryption, sensitive data protection). MD5 for cache checksums is not a finding.


Tool Reference

ToolPrimary UseKey Flags
otoolMach-O inspection, load commands, symbols-l (loads), -L (libs), -o (ObjC)
codesignEntitlements, signature verification-d --entitlements :-
plutilPlist parsing and conversion-p (print), -convert xml1
nmSymbol table listing-gU (global defined), -u (undefined)
lipoFAT binary manipulation-info, -thin arm64
stringsString extraction from binary-a (all sections)

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.