Android Pentesting
Android is the most open mobile platform and therefore the easiest to audit: apps ship as an APK (a ZIP with code compiled to DEX, resources, and the manifest), and with standard tools you can decompile them, read their code almost like the original, instrument them at runtime, and intercept their traffic. This card covers the Android-specific flow: getting the APK, static analysis, dynamic analysis, and the typical vectors.
The APK and its pieces
Section titled “The APK and its pieces”APK = ZIP with: AndroidManifest.xml permissions, components, deeplinks, exported, debuggable classes.dex Dalvik bytecode (the app's code) resources.arsc / res/ resources, strings, layouts lib/ native libraries (.so) assets/ embedded files (sometimes secrets/config)Obtain the APK
Section titled “Obtain the APK”# from the device (installed app)adb shell pm list packages | grep targetadb shell pm path com.target.app # APK pathadb pull /data/app/.../base.apk# or download it from a store/mirror (APKPure, etc.)Static analysis
Section titled “Static analysis”# decompile to smali + readable resourcesapktool d base.apk # manifest and smali# DEX -> Java (comfortable reading)jadx-gui base.apk # Java decompilerd2j-dex2jar base.apk ; jd-gui # alternative# all automatedmobsf # static+dynamic analysis with reportWhat to review:
android:debuggable="true" # debuggable app -> extract data easilyandroid:allowBackup="true" # extractable backup (adb backup)<activity ... android:exported="true"> # components reachable by other apps<data android:scheme="..."> # deeplinks (see mob-deeplinks)# secrets in code/resources/assetsgrep -riE 'api_key|secret|password|BEGIN RSA|http' ./ # keys, endpointsstrings lib/*/*.so # secrets in native codeDynamic environment
Section titled “Dynamic environment”# emulator or rooted deviceadb devices ; adb shell# proxy to intercept traffic (see mob-ssl)# set Burp as proxy + install its CA# runtime instrumentationfrida / objection (see mob-frida) # hooking, pinning/root-detection bypassTypical attack vectors
Section titled “Typical attack vectors”# exported components (Activities, Services, Content Providers, Broadcast Receivers)adb shell am start -n com.target/.AdminActivity # launch an exported activityadb shell content query --uri content://com.target.provider/users # Content Provider# deeplinks (see mob-deeplinks)adb shell am start -W -a android.intent.action.VIEW -d "targetapp://..."# insecure storage (see mob-storage)adb shell run-as com.target cat /data/data/com.target/shared_prefs/*.xml# insecure WebViews: JavaScript enabled, addJavascriptInterface -> RCE/XSS in WebView# backup: adb backup -f backup.ab com.target (if allowBackup=true)Content Providers and IPC
Section titled “Content Providers and IPC”Exported components are a key surface: an Activity/Service/Provider/Receiver with exported="true" (or with an intent-filter) can be invoked by any other app (or by adb), bypassing UI controls.
# enumerate exported components (from the decompiled manifest)# test SQL injection in Content Providers, path traversal, data accessdrozer # IPC/component analysis frameworkFor the defense
Section titled “For the defense”- Don’t hardcode secrets;
debuggable=false,allowBackup=falsein production. - Minimize exported components; protect the needed ones with permissions; validate all input (intents, Content Providers).
- Encrypted storage (see Insecure Storage), TLS + pinning (SSL Pinning and Bypass).
- Secure WebViews: no unnecessary
addJavascriptInterface, don’t load untrusted content. - RESILIENCE protections (root/tamper/debug detection, obfuscation with R8/ProGuard) — raise the cost, don’t replace backend security.
Testing checklist
Section titled “Testing checklist”- Obtain the APK (adb pull / store)
- Decompile (apktool/jadx) and review the manifest
- debuggable/allowBackup/exported in the manifest
- Secrets in code/resources/assets/.so
- Exported components and IPC (drozer, am/content)
- Deeplinks (Deeplinks and IPC)
- Insecure storage (Insecure Storage)
- Traffic + SSL pinning (SSL Pinning and Bypass); WebViews; backend