Welcome to the iOS-Pentesting wiki!
List identities
./applesign.js -L
Re-sign
./applesign.js -i ABCDEFGHIJKLMNOPQRST /blah/blah.ipa
Deploy with impactor or ios-deploy/ipa-deploy
https://slashedm.gitbook.io/xcode-app-signing/where-do-we-go-now/newer-versions
Objection
frida-ps -Uia
objection --gadget "com.apple.AppStore" explore
objection explore --startup-command 'ios jailbreak simulate'
Connect phone to Mac - run a test app in xcode and fix signing certificates. This should generate a provisioning file.
Find code sigs
security find-identity -p codesigning -v
Patch Frida dylib to ipa
objection patchipa --source blah.ipa --codesign-signature 1234BLAH
Deploy in debugging mode
ios-deploy --bundle blah.app -W -d
Run in debug mode without installing again
ios-deploy -b blah.app -W -m
##Cycript:
var app = [ UIApplication sharedApplication ] app.delegate !# you can also just use UIApp.delegate var delegate = new Instance(0x2315f0)
!#call delegate [ delegate pinLockControllerDidFinishUnlocking ] for bool values: [ UIApp.delegate userIsLogged: YES ]
cy# UIApp.keyWindow.rootViewController.topViewController.visibleViewController
cy# choose(UIViewController)
cy# [classname].messages or cy# function printMethods(className) { var count = new new Type("I"); var methods = class_copyMethodList(objc_getClass(className), count); var methodsArray = []; for(var i = 0; i < *count; i++) { var method = methods[i]; methodsArray.push({selector:method_getName(method), implementation:method_getImplementation(method)}); } free(methods); free(count); return methodsArray; } cy# printMethods("[classname]")
cy# function tryPrintIvars(a){ var x={}; for(i in a){ try{ x[i] = (a)[i]; } catch(e){} } return x; } cy# a=#0x15d0db80 cy# tryPrintIvars(a)
cy# [a pinCode] cy# [a setPinCode: @"1234"] cy# [a isValidPin] cy# a->isa.messages['isValidPin'] = function(){return 1;}
killall -HUP SpringBoard
iproxy 2222 22
For iOS 10 yalu JB run on device
dropbear -R -p 2222
/User/Media/Downloads or /var/mobile/Media
git clone https://github.com/mwrlabs/needle.git
apt-get install python2.7 python2.7-dev sshpass sqlite3 lib32ncurses5-dev
If kali has'nt been updated in a while will have to update apt source and gpg key
wget -q -O - https://archive.kali.org/archive-key.asc | apt-key add
In needle to install all dependencies on device:
use device/dependency_installer
Install lipo from org.coolstar.cctools
launchctl unload /Library/LaunchDaemons/dropbear.plist
launchctl load /Library/LaunchDaemons/dropbear.plist
/var/db/stash/_.cBfT4d/bin
dropbear -F -R -p 22
#!/bin/bash
launchctl unload /Library/LaunchDaemons/dropbear.plist
launchctl load /Library/LaunchDaemons/dropbear.plist
/var/db/stash/_.cBfT4d/bin/dropbear -F -R -p 22
Xcode + iOS App Signer
Install Xcode, open it, and agree to the license agreement.
Plug in your iOS device and select it as the build target.
Open Xcode and create a new iOS Application.
Type a name and identifier.
Xcode will complain about the lack of a provisioning profile. Click fix issue.
Sign into an Apple ID when prompted.
Download iOS App Signer
Download the latest version of unc0ver from above.
Open iOS App Signer.
Select the ipa you just downloaded as an input file.
Click start.
Return to Xcode. Go to the menu bar. Click Window → Devices.
Find your device, click the plus, and select the file created by iOS App Signer.