Current location - Quotes Website - Personality signature - IOS: hook injection on non-jailbreak phones
IOS: hook injection on non-jailbreak phones
1. Prepare an app written by yourself and package it with an adhoc certificate.

2. After packaging, it can be installed on the test mobile phone.

3. Unzip this ipa to get an app file (rename. Ipa is compressed first, and then decompressed to get one. App file).

4. Display the contents of the package and view the contents of the original package.

5. You can use the command line to view it (note the current path). $otool -L YoungTest

6. Install iOSOpenDev

7. Write the hook, only in the Hook 1 file, and nothing else has been changed.

OSOpenDevDevice sets the IP of your device (for example:192.168.1.10).

By default, the IOSOpenDevInstallOnProfiling Boolean value is YES, indicating whether it is directly installed remotely on the device when compiling for analysis.

IOSOpenDevPath Do not modify this item, it is the installation path of iOSOpenDev.

IOSOpenDevRespringOnInstall Boolean value defaults to YES, whether to restart the springboard after installation.

By default, IOSOpenDev is installed in /opt/iOSOpenDev, where you can find the header file of the undocumentapi.

8. put Hook 1 and yollib into the package (this tool called yollib can help us inject dylib directly).

9. inject hook into the app with yololib.

$./yolo lib young test hook 1 . dylib

10. Check and find that the injection was successful.

1 1. After successful injection, delete yololib and delete _CodeSignature, and replace embedded.mobileprovision with your own configuration file. (Generate a set of application certificates in the developer account)

12. Generate the configuration information of the original app (note the current path).

$ code sign-d-entitlements:-/Users/iOS/Desktop/ad hoc/Payload/young test . app & gt; sss.plist

13. signature hook 1, young test, embedded.mobileprovidence file.

Youngstardemacbook-pro: Payload IOS $ codesign-f-s "iPhone distribution: YoungTest.app/Hook1.dylib Yang Mingxing (AX6366456P)"

Youngstardemacbook-pro: Payload IOS $ codesign-f-s "iPhone distribution: Yang Mingxing, YoungTest.app/Sengled.mobileprovision (AX6366456P)"

Youngstardemacbook-pro: Payload IOS $ codesign-f-s "iPhone distribution: Yang Mingxing, YoungTest.app/YoungTest (AX6366456P)"

As shown in the figure

14. Sign the entire application file according to the newly generated configuration file.

Code sign-f-s "iphone distribution: Yang Mingxing (ax6366456p)"-authorized SSS. plist YoungTest.app/.

15. Hook injection has been completed. We will go back to the previous file and find the application.

16, generate ipa through iTunes, and then install it on the mobile phone with iTool.

There are also many detours, mainly the confusion of certificates. It is best to delete all other useless certificates in the keychain and package this certificate. I have explained it in detail as much as possible. If you have any questions, you can leave a message!