Last updated: April 29, 2026
This module walks through an Android pentest with the two tools that do most of the heavy lifting: Objection (Frida-powered dynamic analysis) and Frida (runtime hooking framework). Setup, SSL-pinning bypass, local-storage inspection, method hooking — in practice, not theory.
Lab prerequisites
- Rooted Android device or emulator (Genymotion + Magisk works reliably)
- Frida server binary for the device’s architecture on port 27042
- Python + pip install frida-tools objection
- The target APK installed on the device
- Burp Suite (or mitmproxy) with CA cert installed in the user or system cert store
Starting Frida server on the device
adb push frida-server-16.x-android-arm64 /data/local/tmp/frida-server
adb shell
su
chmod 755 /data/local/tmp/frida-server
/data/local/tmp/frida-server &
# From host — confirm
frida-ps -U | head
# Output shows running processes on the device
Attaching Objection
# Package name is what you see in the manifest / Play Store URL
objection --gadget com.target.app explore
# You're now in an interactive REPL on the running app
com.target.app on (Android: 13) [usb] # help
SSL pinning bypass
Apps that pin the server certificate reject Burp’s proxy cert unless you bypass. Objection has a one-liner:
android sslpinning disable
# This hooks OkHttp3, HttpsURLConnection, WebView, TrustManager, and more
# Most apps — traffic now flows through Burp after this single command
When the Objection bypass does not work — custom pinning library, native implementation, or WebView with strict client auth — write a custom Frida script. Example for a specific function:
// ssl-bypass.js
Java.perform(function() {
var CertificatePinner = Java.use('com.target.app.security.CertPinner');
CertificatePinner.validate.implementation = function() {
console.log('[+] cert validation called — forcing return true');
return true;
};
});
// Run: frida -U -l ssl-bypass.js com.target.app
Inspecting local storage
# Inside the objection REPL
env # shows app paths on device
ls /data/data/com.target.app # lists app's internal storage
cat /data/data/com.target.app/shared_prefs/AuthPrefs.xml
sqlite connect /data/data/com.target.app/databases/users.db
.tables
.schema users
SELECT * FROM users LIMIT 5;
What to look for: auth tokens in cleartext, user PII, API keys, crypto keys not in the Keystore, cached responses with sensitive data.
Runtime hooking — method logging
# Hook a specific class and log every method call
android hooking watch class com.target.app.auth.TokenManager --dump-args --dump-return
# Find which methods exist
android hooking list class_methods com.target.app.auth.TokenManager
This is the cheat code. Every method arg, every return value, printed to your terminal as the app runs. Auth flows, token refresh, data decryption — all visible.
Bypassing root detection
Many apps detect root and exit on launch. Objection’s generic bypass works for most:
android root disable
# Or more aggressive (hooks more methods)
android root simulate
# Custom detection → custom hook. Typical patterns to hook:
# - File.exists() checks for su binary
# - PackageManager.getInstalledPackages (checking for Magisk, Xposed)
# - System.getProperty("ro.debuggable")
# - exec("which su")
A complete testing workflow
- Install app fresh; start proxy + Frida server
- Attach Objection with SSL pinning + root detection bypass scripts running
- Run through every app function once — login, main flows, settings, logout
- Capture all HTTP traffic in Burp for later API review
- Dump local storage at key moments (post-login, post-payment, post-settings change)
- Hook suspicious-looking classes (anything named *Crypto*, *Auth*, *Token*, *License*)
- Document findings with screenshots, Frida logs, and Burp requests
Common findings
- API tokens written to SharedPreferences in plaintext
- Hardcoded API keys in BuildConfig or native strings
- Weak or missing SSL pinning
- Mobile-only API endpoints that skip auth checks (the mobile client was trusted to call them)
- Exported activities that can be invoked by other apps to bypass login
- Debug logs leaking PII
- Biometric auth that gates only UI, not server-side actions
Static companion: MobSF
Before you go dynamic, run MobSF (Mobile Security Framework) against the APK. It decompiles, scans for Android-specific issues, produces a scored report. Used as a first-pass, it highlights the high-value areas for your dynamic testing:
docker run -it --rm -p 8000:8000 opensecurity/mobile-security-framework-mobsf
# Open http://localhost:8000, upload APK, wait ~2 minutes for report
What the next module covers
Module 3 does the equivalent on iOS — Frida on a jailbroken iPhone, keychain inspection, class-dump, and the differences an Android tester needs to learn when crossing platforms.
Module Quiz · 15 questions
Pass with 80%+ to mark this module complete. Unlimited retries. Each question shows an explanation.
Custom team training + practitioner advisory
Beyond the free academy — we run private workshops, vCISO advisory, and red-team exercises tailored to your stack. For Indian SMBs scaling past their first hire.