iOS TrustKit SSL UnPinning

by
15 views 3aa4b901...

Description

Disable ssl pinning with TrustKit and an example of function replacement

How to Use

Download the script and run it with Frida CLI:

Download Script

Then run with Frida:

frida -U -f YOUR_PACKAGE_NAME -l ios-trustkit-ssl-unpinning.js

Replace YOUR_PACKAGE_NAME with the target app's package name.

Source Code

JavaScript
if (ObjC.available) {
    console.log("SSLUnPinning Enabled");
    for (var className in ObjC.classes) {
        if (ObjC.classes.hasOwnProperty(className)) {
            if (className == "TrustKit") {
                console.log("Found our target class : " + className);
                var hook = ObjC.classes.TrustKit["+ initSharedInstanceWithConfiguration:"];
                Interceptor.replace(hook.implementation, new NativeCallback(function() {
                    console.log("Hooking TrustKit");
                    return;
                }, 'int', []));
            }
        }
    }
} else {
    console.log("Objective-C Runtime is not available!");
}
Share this script:
Twitter LinkedIn

Comments

Login or Sign up to leave a comment.
Loading comments...