Skip to content
Pwnversity
MOB-IOSintermediate · 7 min · upd. 2026-10

iOS Pentesting

iOS is more closed than Android: sandboxing is strict, the filesystem is more protected, and without a jailbreak access is limited. Apps ship as an IPA (a ZIP with the Mach-O binary encrypted by the App Store, resources, and Info.plist). Still, with a jailbroken device —or no-jailbreak techniques— and Frida you can inspect, instrument, and audit an iOS app following the same MASVS.

flowchart TD
    IPA["IPA (Payload/App.app)"] --> ENC["Encrypted binary (FairPlay)"]
    ENC --> DUMP["frida-ios-dump / bagbak"]
    DUMP --> MACHO["Decrypted Mach-O"]
    MACHO --> STATIC["class-dump / otool / strings"]
    IPA --> PLIST["Info.plist"]
    PLIST --> URLS["URL schemes / ATS"]
    STATIC --> DYN["Dynamic: Frida / Objection"]
    URLS --> DYN
    DYN --> KC["Keychain + storage"]
    DYN --> BK["Backend / API"]

The iOS sandbox already protects a lot, so the realistic attacker usually holds the device (jailbreak) or targets the traffic and backend:

  • Jailbroken user: reads the app’s filesystem, dumps the Keychain and the decrypted binary.
  • Network attacker: MITM if ATS is relaxed or pinning is bypassable (see SSL Pinning and Bypass).
  • Another app / system: poorly validated URL schemes and Universal Links, shared pasteboard (see Deeplinks and IPC).
  • Physical/backup access: sensitive data without proper Data Protection, or included in iCloud backups.
Ventana de terminal
# an IPA is a ZIP; its structure:
unzip -l app.ipa
# Payload/App.app/
# <Mach-O binary> executable (encrypted by FairPlay if from the App Store)
# Info.plist config, URL schemes (deeplinks), ATS, permissions
# embedded.mobileprovision provisioning profile
# _CodeSignature/ signature
# resources (.plist, .db, assets)

App Store apps ship encrypted (FairPlay); for static analysis of the binary you must decrypt it first by dumping it from memory on a real device:

Ventana de terminal
# on a jailbroken device, dump the decrypted IPA
frida-ios-dump # AloneMonkey: extracts the already-decrypted IPA
# alternatives
bagbak com.target.app # modern Frida-based dump
# check whether a section is encrypted
otool -l App.app/App | grep -A4 LC_ENCRYPTION_INFO # cryptid 1 = encrypted
Ventana de terminal
# with jailbreak (full access), depending on iOS version
# checkra1n / palera1n (bootrom), unc0ver / Dopamine (rootless)
# SSH access to the device; Sileo/Cydia for tooling
# no jailbreak (more limited): re-sign with an injected Frida gadget and sideload
objection patchipa --source app.ipa # injects FridaGadget into the IPA
# then sideload with Sideloadly / AltStore and a developer account
Ventana de terminal
# on the decrypted Mach-O binary
class-dump App.app/App # classes, methods, Objective-C metadata
otool -L App.app/App # linked libraries
otool -l App.app/App # load commands (encryption, flags)
strings -a App.app/App | grep -iE 'https?://|key|secret|password'
# Info.plist (it's binary; plutil converts it)
plutil -p App.app/Info.plist
# look for NSAllowsArbitraryLoads (ATS disabled -> HTTP allowed)

For Swift, class-dump sees less; use the symbol panel in Hopper/Ghidra or jtool2 for Swift metadata.

Ventana de terminal
# instrumentation with Frida (see mob-frida)
frida -U -f com.target.app -l script.js --no-pause
objection -g com.target.app explore # explore, bypass, dump
# bypass jailbreak detection and SSL pinning (see mob-ssl)

Inside Objection:

Ventana de terminal
ios jailbreak disable # bypass jailbreak detection
ios sslpinning disable # bypass SSL pinning
ios keychain dump # dump the app's Keychain
ios nsuserdefaults get # NSUserDefaults (cleartext keys)

The Keychain is the “right” place for secrets, but with a jailbreak it can be dumped, and the protection class decides when it’s readable:

  • kSecAttrAccessibleWhenUnlocked — accessible only with the device unlocked (recommended).
  • kSecAttrAccessibleAfterFirstUnlock — accessible after the first unlock (common for background processes).
  • kSecAttrAccessibleAlways — deprecated and insecure: always readable.

Adding ThisDeviceOnly prevents the secret from travelling in backups or to another device.

Testing against an app you own or have permission to test:

  • Decrypt and read the binary: frida-ios-dump + class-dump/strings for endpoints and secrets.
  • Dump the Keychain and review overly permissive protection classes.
  • Review the container: /var/mobile/Containers/Data/Application/<UUID>/ — NSUserDefaults (.plist), SQLite, cache, logs (see Insecure Storage).
  • Bypass jailbreak detection and pinning with Objection/Frida, and attack the backend (Web Methodology).
  • Deeplinks/Universal Links: unverified URL schemes and weak validation (see Deeplinks and IPC).
Ventana de terminal
# locate the app's data container (inside objection)
env
ls /var/mobile/Containers/Data/Application/<UUID>/Library/Preferences/
  • Secrets in the Keychain with the right protection class (WhenUnlocked, ThisDeviceOnly), never in .plist/NSUserDefaults/code.
  • ATS enabled: no NSAllowsArbitraryLoads; TLS + pinning (SSL Pinning and Bypass).
  • Data Protection (encryption tied to unlock) for sensitive files; clear cache, pasteboard, and the background snapshot.
  • Validate URL schemes and Universal Links; prefer domain-verified Universal Links.
  • MASVS-RESILIENCE (jailbreak detection, anti-debug, obfuscation) raises the cost, it doesn’t replace backend security.
  • Get and decrypt the IPA (frida-ios-dump / bagbak)
  • Environment: jailbreak or Frida gadget (no jailbreak)
  • Static: class-dump, strings, Info.plist (URL schemes, ATS)
  • Dynamic: Frida/Objection, bypass jailbreak detection
  • Keychain dump and protection classes
  • Container storage (Insecure Storage)
  • SSL pinning bypass (SSL Pinning and Bypass)
  • Deeplinks / Universal Links (Deeplinks and IPC)
  • Backend/API (Web Methodology)