This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
howto:iosfrida [2017/10/21 01:23] czokie Building Frida |
howto:iosfrida [2017/11/18 22:21] czokie [3. Application Acquisition] |
||
---|---|---|---|
Line 62: | Line 62: | ||
Download this file to ~/Documents | Download this file to ~/Documents | ||
- | < | + | < |
{ | { | ||
" | " | ||
Line 73: | Line 73: | ||
</ | </ | ||
+ | Or, if you're ready to do some on-board hooking without any external comms, use this instead | ||
+ | <code java FridaGadget.config> | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | " | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | and create Tweak.js in the same directory with your required hooks. | ||
===== 2. Generate (or renew) signing credentials ===== | ===== 2. Generate (or renew) signing credentials ===== | ||
Line 89: | Line 102: | ||
It goes without saying you will need an IPA file to play with. Below, it is assumed you have downloaded your IPA file and saved it to " | It goes without saying you will need an IPA file to play with. Below, it is assumed you have downloaded your IPA file and saved it to " | ||
- | NB: This MUST be a decrypted Go4 app. these are available to download here [[howto:iosmod|IOSMOD]] | + | NB: This MUST be a decrypted Go4 app. these are available to [[howto:firmware# |
===== 4. Application Modification & Signing ===== | ===== 4. Application Modification & Signing ===== | ||
Line 95: | Line 108: | ||
rm -rf Payload | rm -rf Payload | ||
mkdir -p " | mkdir -p " | ||
- | cp FridaGadget.config " | + | cp FridaGadget.config |
zip -r "DJI GO 4.ipa" Payload | zip -r "DJI GO 4.ipa" Payload | ||
objection patchipa -s "DJI GO 4.ipa" --codesign-signature <your signature> | objection patchipa -s "DJI GO 4.ipa" --codesign-signature <your signature> | ||
Line 121: | Line 134: | ||
After launch is complete, you can disconnect the USB cable. Make sure you promptly launch Frida if you have it in " | After launch is complete, you can disconnect the USB cable. Make sure you promptly launch Frida if you have it in " | ||
==== 6.3 Launch in Springboard ==== | ==== 6.3 Launch in Springboard ==== | ||
- | Ideally, we want to be able to launch | + | We can now launch |
===== 7. Launch objection ===== | ===== 7. Launch objection ===== | ||
Line 198: | Line 211: | ||
So... What does the frida patch look like... (Thanks jezzab) | So... What does the frida patch look like... (Thanks jezzab) | ||
- | < | + | < |
//Terms and Conditions Bypass - jezzab | //Terms and Conditions Bypass - jezzab | ||
var hook = ObjC.classes.DJITermsNotificationController[" | var hook = ObjC.classes.DJITermsNotificationController[" | ||
Line 212: | Line 225: | ||
He provided the following as a replacement sample for our simple hook. | He provided the following as a replacement sample for our simple hook. | ||
- | < | + | < |
var DJITermsNotificationController = ObjC.classes.DJITermsNotificationController; | var DJITermsNotificationController = ObjC.classes.DJITermsNotificationController; | ||
Line 222: | Line 235: | ||
or if we want to see the original value... | or if we want to see the original value... | ||
- | < | + | < |
var DJITermsNotificationController = ObjC.classes.DJITermsNotificationController; | var DJITermsNotificationController = ObjC.classes.DJITermsNotificationController; | ||
Line 237: | Line 250: | ||
oleavr: method arguments follow self and sel (the first two implicit arguments). you can use var self = new ObjC.Object(handle); | oleavr: method arguments follow self and sel (the first two implicit arguments). you can use var self = new ObjC.Object(handle); | ||
+ | |||
+ | Lastly - If we need any intrusive hooks in our code - we can add the below if we need to have intrusive hooks for debugging. | ||
+ | if (Process.codeSigningPolicy === ' | ||
+ | |||
==== 9.4. First Standalone Patch ==== | ==== 9.4. First Standalone Patch ==== | ||
Good news. We accomplished this. Jezzab has packaged an earlier js file into an app, and launched in standalone mode. However, as per above notes - we had a limitation. We needed to launch with debug mode, otherwise we got code signing violations. Two things are needed to fix this... | Good news. We accomplished this. Jezzab has packaged an earlier js file into an app, and launched in standalone mode. However, as per above notes - we had a limitation. We needed to launch with debug mode, otherwise we got code signing violations. Two things are needed to fix this... | ||
- | | + | |
- | | + | |
+ | * The above change is now in Frida... To implement this, we need the following frida configuration | ||
+ | |||
+ | <code java> | ||
+ | { | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | " | ||
+ | }, | ||
+ | " | ||
+ | } | ||
+ | </ | ||
+ | * One more thing... The on_change config item. This is another mod that oleavr made to Frida - In IOS, we can upload a .js file to user space via iTunes or ifunbox etc. When frida loads up, it will look first in the documents location for a JS file. If found, it will use it. If not found, it will look for one in the app from build time. The advantage of this is that we can update the JS without a complete app rebuild. | ||
==== 9.4. Add more Standalone Patches ==== | ==== 9.4. Add more Standalone Patches ==== | ||
Create more hooks and package with a frida tweak' | Create more hooks and package with a frida tweak' | ||
Line 248: | Line 278: | ||
- Login " | - Login " | ||
+ | |||
+ | ==== 9.5. Persistant Configuration ==== | ||
+ | We need a way to store some persistent configuration that can be read by all of these hooks. At first glance, there is SQLite support, which will do the storage, but we really don't want to execute SQL code each time we want to test if a particular widget is enabled or disabled. Taking that forward, the next logical place to go would be to use **frida-compile**, | ||
+ | |||
+ | Some useful details are [[https:// | ||
+ | |||
+ | There are some Frida-specific modules as well - like frida-uikit for UI automation on iOS | ||
+ | |||
+ | ==== 9.6. UI Settings ==== | ||
+ | Having build a persistent configuration object, we now need to think about how we can build our own UI that will allow our custom settings to be changed. | ||
===== 10. General Notes ===== | ===== 10. General Notes ===== | ||
==== 10.1. Useful LLDB commands ==== | ==== 10.1. Useful LLDB commands ==== | ||
Line 296: | Line 336: | ||
This option will allow us to have a frida modified IPA that will run on our device, launched by springboard with no special debug startup sequences required. | This option will allow us to have a frida modified IPA that will run on our device, launched by springboard with no special debug startup sequences required. | ||
+ | |||
+ | ===== 11. Credits ===== | ||
+ | oleavr from Frida has been awesome through this process. Some of our needs were not readily possible in the existing Frida code. He has made changes throughout the process to the Frida-gadget which have been enormously helpful. In addition, he has provided guidance and coaching as we came up to speed with using Frida... so thanks oleavr. |