Skip to content

Lesson 11 of 13 · 13m

Frida, objection, and the Rooted Device

Frida hooks the live process — objection's `sslpinning disable` proves pinning is a speed bump — while Magisk, Gadget repacks, and jailbreaks decide how deep instrumentation goes.

Frida is the REPL for someone else's app

Static reading tells you what the code says. Instrumentation tells you what it does — with what arguments, in what order, and what it returns when you lie to it. The tool is Frida: frida-server runs on the rooted device, frida -U -f com.app spawns the app suspended under instrumentation, and JavaScript written against Java.perform() rewrites method behavior live:

Java.perform(function () {
  var T = Java.use('com.app.net.TokenStore');
  T.getToken.implementation = function () {
    var t = this.getToken();
    console.log('token ->', t);
    return t;
  };
});

frida-trace -U -j '*checkServerTrusted*' com.app auto-generates hooks matching a glob — the fast path to "does this app pin and where." objection packages the common exploits: inside objection -g com.app explore you get android sslpinning disable, android hooking watch class_method, android intent launch_activity, memory dump — and on iOS ios sslpinning disable, ios nsuserdefaults get, ios keychain dump. The unpinning scripts are why "we pinned it" was never the whole answer.

No rooted device? Repack the APK with the Frida Gadget injected (objection patchapk) — instrumentation inside an unrooted install, signature changed, anti-tamper checks included. The Gadget lands as a libfrida-gadget.so beside the app's own libs, which is also exactly what hardened apps grep their maps for. iOS instrumentation runs through frida packages from a jailbreak repo; palera1n gives you checkm8-based rootful access on A7–A11 hardware, Dopamine covers iOS 15–16.x on arm64e rootless.

Version discipline matters: frida client and frida-server must match, and frida-tools/objection releases lag frida core by a release or two — pin all three in the lab image.

The root stack

Magisk is systemless root: it overlays /system modifications via magic-mount so the real partition stays clean, and Zygisk runs modules inside zygote so every app inherits the hooks. DenyList (and forks like PlayIntegrityFix) hide root from specific apps — which is why the detection arms race exists: apps check, modules mask, apps add more checks. An emulator with -writable-system and adb root is the cheap lab; rootAVD magisks a stock AVD image. The iOS simulator is a different kind of lab — it isn't a device (no SEP, no real keychain backing, different TCC behavior), so treat it as UI-testing infrastructure, not security ground truth.

What detection actually checks

Apps that care look for: su binaries and magisk paths, world-writable or remounted partitions, frida-server's default TCP port 27042, frida-agent/libfrida strings in /proc/self/maps, TracerPid nonzero in /proc/self/status, Debug.isDebuggerConnected(), signature mismatches against the expected signing cert hash, installer provenance (getInstallSourceInfo vs com.android.vending), and emulator markers in Build.FINGERPRINT/HARDWARE (goldfish, ranchu). iOS detection reads /Applications/Cydia.app, calls fork() — sandboxed apps can't, jailbroken ones can — and probes canOpenURL against cydia:// and friends.

Every one of those checks is hookable by the same Frida session you're running. Detection is a cost dial, never a gate.

Evidence it matters

The bypass scripts aren't theoretical — android sslpinning disable has been a two-word command in objection for years, and public Frida code-shares cover TrustKit, OkHttp's CertificatePinner, and Conscrypt. On the other side, real-world "protected" apps fall the same way: every hardened game and banking app gets a public unpinning script within weeks of a change. If your threat model says "nobody can modify our client," it is already falsified; the honest model is "modification costs time, and we make the server not care."

Practice

Run instrumentation against your release build on a rooted device, because that's the build attackers instrument. Keep Frida versions matched client/server-side. Hook at the lowest layer that works — native SSL_CTX hooks beat Java-layer hooks that R8 renamed away. When you find your own anti-tamper checks, ask what they cost a Java.use overwrite — then decide what the server must verify anyway.

Was this lesson helpful?

Sign in to rate

Keep reading

Related articles from the SudoSecurity blog.