--- name: android-frida-objection-instrumentation description: Dynamic instrumentation of Android apps with Frida and objection — enumerate/hook classes and methods, trace auth/crypto/validation, dump process memory for secrets, and force return values to bypass client-side checks. Tier 1. Use for any runtime hooking/tracing/memory task. Aligns to OWASP MASTG MASVS-RESILIENCE. --- # Android Dynamic Instrumentation (Frida / objection) Hook the running app to read arguments, dump secrets from memory, and override client-side decisions. The engine behind pinning/root/biometric bypasses. ## Trigger phrases `frida, objection, frida hooking, frida-trace, fridump, memory dump, hook method, force return, android instrumentation, objection explore` ## Method 1. **Device prep:** push + run `frida-server` matching device arch: - `adb push frida-server /data/local/tmp/ && adb shell "chmod 755 /data/local/tmp/frida-server"` - `adb shell "su -c /data/local/tmp/frida-server &"`; `frida-ps -Uai` 2. **objection explore:** ``` objection -g explore android > android hooking list classes android > android hooking search methods android > android hooking watch class_method . --dump-args --dump-return --dump-backtrace android > memory search --string "secret" ``` 3. **Frida method tracing:** `frida-trace -U -i "*login*" -f ` 4. **Memory dump:** `python3 fridump.py -U ` then `strings`/grep the dump for secrets. 5. **Force return values** to bypass client-side checks (feature flags, license, "isPremium", local auth) — hook the method and return the desired value. ## Modern / rare techniques - **Spawn-gating** (`frida -U -f --no-pause`) to hook checks that run at startup before you can attach. - **Hook decrypt routines** to recover secrets that are encrypted at rest (feeds `android-insecure-storage`, `android-secrets-hardcoded`). - **Native hooks** via `Interceptor.attach(Module.findExportByName(...))` for logic in `.so` (chain `android-native-lib-analysis`). ## Bypass / evasion If the app detects Frida/root and exits, apply `android-root-antidebug-bypass` hooks first (or Magisk DenyList/Zygisk/Shamiko), then instrument; resolve stripped symbols by offset when names are hidden. ## Escalation / chaining This is the primitive layer for `android-ssl-pinning-bypass`, `android-biometric-bypass`, `android-root-antidebug-bypass`, `android-crypto-keystore`, and `android-native-lib-analysis` — secret extraction and client-side control bypass across the board. ## Backend & tooling Preferred Kali path (native Kali / WSL+Kali / Kali-SSH / Kali-MCP / HexStrike). Needs the user's rooted device/emulator (frida-server matching arch) + Kali tooling (Frida/objection/Fridump/Medusa). Windows-local last resort. See `zazy-orchestrator`. ## Verification (background, before reporting) Confirm the hook genuinely altered behavior or revealed data (reproduce the bypass/secret extraction), and that the finding reflects a real control gap, not an artifact of your instrumentation, before marking CONFIRMED. ## Evidence The hook/script used, the altered behavior or dumped secret (redacted), and backtrace/args proving the path. Remediation: Frida/debugger detection, integrity checks, and — crucially — server-side enforcement (client-side checks are advisory only).