Skip to content

Command Line Cheat Sheet for iOS Penetration Testing

Preparation

Install Brew, which simplifies package installation on macOS. Use the following command in the Terminal (Finder -> Applications -> Utilities -> Terminal):

$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Install XCode to get essential developer tools. In the Terminal, execute:

$ xcode-select --install

Alternatively, XCode can be downloaded manually from the Apple Website.

Register your Apple ID as an Apple Developer Account. No need for a paid Apple Developer Program membership at this stage, as you only need a certificate for signing IPA files in XCode or other tools.

SSH Over USB (iPROXY)

Guide and tools for establishing SSH connections over USB can be found on the iPhoneDevWiki.

Download .ipa file from the App Store or iPhone/iPad device

For Jailbroken Devices

Clutch: A tool for decrypting iOS apps. Detailed information and downloads can be found on GitHub.

Frida Script:

To use frida-ios-dump, set up port forwarding with iProxy first:

$ iproxy 2222 22
Then dump the app:
$ ./dump.py BundleID

iOS Binary Analysis

ios-Analysis

Download and setup:

$ git clone https://github.com/IAIK/ios-analysis
$ cd ios-analysis
$ git submodule update --init --recursive
If encountering an error like: error: RPC failed; curl 56 LibreSSL SSL_read: SSL_ERROR_SYSCALL, errno 60, try:
$ git config http.postBuffer 524288000

Sign & Install .ipa using Windows

  • Download AltSigner.
  • Install the latest version of iTunes directly from Apple (not from the Microsoft Store).
  • Open iTunes, connect your device, and copy the UDID from the device summary page.
  • Open AltSigner, input your Apple ID, password, UDID, and the path to the .ipa file. AltSigner GUI
  • Click Sign to sign the .ipa file, and Install to install it on your device.

Signing IPA File with Our Provisioning Profile

For a GUI-based approach, use iOS App Signer. This tool simplifies the process of signing IPA files using your own provisioning profiles, which you can generate via XCode when installing an application.

Troubleshoot

Ensure that you always check the console for error messages and refer to online resources or communities if specific errors arise during installation or operation of the tools mentioned.