Back to skills
SKILL.md
Android App Pentesting
BSecurityAndroid app: APK recon, Frida hooks, SSL pinning bypass, deep links
- 2 stars
- 0 votes
- 0 copies
- 0 views
- Added November 29, 2026
Works with
Security analysis
76/100- Uses curl or wget to download content
- Accesses sensitive system or user directories
- Installs packages at runtime which could introduce malicious dependencies
Pro scans all 4 files and shows the line behind each finding
npx -y skills add blackfoxxx/kestrel --skill android-app-pentesting --agent claude-codeAre you the author of Android App Pentesting?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/blackfoxxx-android-app-pentesting)---
name: android-app-pentesting
description: "Android app: APK recon, Frida hooks, SSL pinning bypass, deep links"
metadata:
tags: "android,apk,frida,jadx,mobile-security,ssl-pinning,adb,component-security"
category: mobile
mcps: pentest mcp, autopen, context1337
---
# Android Application Penetration Testing Methodology
> **Phase flow**: Environment setup → APK static analysis → Dynamic analysis (Frida) → Component security testing → Data storage security → Network communication security → Protection bypass
## Deep Reference
- APK static analysis detailed commands and Manifest audit key points → [references/android-static-analysis.md](references/android-static-analysis.md)
- Frida Hook scripts and SSL Pinning bypass in practice → [references/android-frida-dynamic.md](references/android-frida-dynamic.md)
- React Native / Flutter / native so / RMS / Appium runtime analysis → [references/android-frameworks-and-runtime.md](references/android-frameworks-and-runtime.md)
---
## Phase 0: Environment Setup
### Device/Emulator Selection
```
Test device selection?
├─ Physical device (Pixel series recommended)
│ ├─ Flash Magisk → systemless root
│ ├─ Enable Zygisk + DenyList → hide root
│ └─ Keep original boot.img → OTA recovery
├─ Android Studio emulator
│ ├─ x86 image + ARM translation layer (speed priority)
│ └─ Google APIs image (when Play Store testing needed)
└─ Genymotion (free personal edition + VirtualBox)
└─ Bridge network mode → easy connection from other VMs
```
### Core Toolchain
| Tool | Purpose | Installation |
|------|---------|-------------|
| adb | Device communication/install/debug | Android SDK Platform Tools |
| ASC (`droidasc`) | On-demand decompilation + cross-reference search (locate before full decompile) | `pip install droidasc` |
| jadx / jadx-gui | APK decompilation to Java | `brew install jadx` |
| apktool | Decompile to Smali / extract resources | `brew install apktool` |
| Frida + frida-tools | Dynamic Hook / runtime analysis | `pip install frida-tools` |
| objection | Frida automation wrapper | `pip install objection` |
| Drozer | Component security testing | GitHub Release |
| Burp Suite | Traffic interception | PortSwigger |
| MobSF | Automated static + dynamic analysis | Docker deployment |
| APKiD | Identify compiler/packing/obfuscation | `pip install apkid` |
### APK Acquisition
```bash
# Extract from device
adb shell pm list packages | grep target
adb shell pm path com.target.app
adb pull /data/app/com.target.app-.../base.apk
# Merge split APKs
mkdir splits
adb shell pm path com.target.app | cut -d ':' -f 2 | xargs -n1 -I{} adb pull {} splits/
java -jar APKEditor.jar m -i splits/ -o merged.apk
java -jar uber-apk-signer.jar -a merged.apk --allowResign -o merged_signed
# Online download
# APKPure / APKMirror / APKCombo / apkd (GitHub)
# justapk: pip install justapk
justapk download com.target.app
justapk convert app.xapk -o output/
```
---
## Phase 1: APK Static Analysis
### Decompilation and Code Audit
For large APKs, don't jump straight to full decompilation. `jadx` is a full expansion (a 98MB package takes 27.8s and produces 1374 files), but most issues only require looking at a few classes or finding one reference. Start by locating the target, then decide whether full decompilation is needed.
```
Decompilation path selection?
├─ Know what you're looking for (class name/string/method name) → ASC on-demand (getclass / findrefs), no disk write
│ └─ After locating specific class, decide whether to jadx for full context
├─ Don't know what to look for, broad search → jadx -d output/ target.apk + grep
├─ Need to modify and repack → apktool d target.apk -o decoded/
├─ React Native app → extract assets/index.android.bundle
├─ Xamarin app → extract assemblies/ → dnSpy / ILSpy
└─ Packed app → APKiD to identify packer type → corresponding unpacking solution
```
```bash
# jadx decompilation
jadx -d jadx_output/ target.apk
# Search for sensitive information
grep -rn "password\|api_key\|secret\|token\|firebase" jadx_output/
# apktool decompilation (Smali level)
apktool d target.apk -o apktool_output/
# APKiD identify protection
apkid target.apk
```
### ASC On-Demand Search (Default Entry Point for Large APKs)
ASC treats the APK as a read-only database, decompiles single classes and resolves references at sub-second speed without pre-expanding. When you have a class name, method name, string, or base class as a lead, start here and decide later whether to do a full jadx. A second use case is **attack surface mapping by base class**: obfuscated class names are unsearchable, but system parent class names must be preserved — `findrefs extends` is more reliable than grepping class names.
```bash
droidasc getmanifest target.apk -o AndroidManifest.xml # no Android SDK needed
droidasc listclass target.apk --prefix com.target.pay # view package structure, avoid blind search
droidasc getclass target.apk com.target.pay.PayActivity -o PayActivity.java
droidasc findrefs target.apk string "sk-" # which classes contain this literal
droidasc findrefs target.apk extends android.app.Service # all subclasses
droidasc findrefs target.apk impl android.os.IInterface # all IPC implementations
```
Two limitations: `findrefs string` is fuzzy matching — exact strings may return empty (empty doesn't mean absent, switch to full grep); it outputs a list of reference points, not source code — reading code still requires `getclass` or `jadx`. See [references/android-static-analysis.md](references/android-static-analysis.md) for complete subcommands.
### Manifest.xml Audit Key Points
```bash
# Extract Manifest
aapt dump xmltree target.apk AndroidManifest.xml
```
Critical checks:
| Attribute | Risk | Impact |
|-----------|------|--------|
| `android:debuggable="true"` | High | Can attach debugger / read app data |
| `android:allowBackup="true"` | Medium | adb backup can extract app data |
| `android:exported="true"` | High | Component accessible externally |
| `android:usesCleartextTraffic="true"` | Medium | Allows plaintext HTTP |
| `targetSdkVersion < 24` | Low | Trusts user-installed CAs by default; ≥24 trusts system CAs only, check Network Security Config |
### String and Key Search
```bash
# URLs in APK
apkurlgrep -a target.apk
# Leaked keys/credentials
apkleaks -f target.apk
# Firebase database detection
grep -rn "firebaseio.com" jadx_output/
# Try accessing: curl https://xxx.firebaseio.com/.json
```
### Automated Static Analysis
```bash
# MobSF static analysis
docker run -it -p 8000:8000 opensecurity/mobile-security-framework-mobsf:latest
# Upload APK → auto-generate report
# mariana-trench (Facebook)
# Source-sink rule based vulnerability scanning
mariana-trench --apk-path target.apk --output results/
```
---
## Phase 2: Dynamic Analysis (Frida)
### Frida Basic Operations
```bash
# View running apps
frida-ps -Uai
# Attach to process
frida -U -f com.target.app
# Inject with script
frida -U -f com.target.app -l hook.js
```
### Common Hook Scenarios
```
Dynamic analysis target?
├─ SSL Pinning bypass → Phase 6 details
├─ Root detection bypass → Phase 7 details
├─ Encryption algorithm monitoring → Hook javax.crypto.Cipher
├─ Sensitive API monitoring → Hook file/network/SMS/location APIs
├─ Biometric auth bypass → Hook BiometricPrompt
└─ Memory sensitive data search → Fridump
```
### Memory Dump and Search
```bash
# Fridump memory extraction
python3 fridump3.py -u com.target.app
# Search for sensitive data
strings dump/* | grep -E "password|token|Bearer"
# Search for mnemonic phrases
strings dump/* | grep -E "^[a-z]+ [a-z]+ [a-z]+ [a-z]+ [a-z]+ [a-z]+ [a-z]+ [a-z]+ [a-z]+ [a-z]+ [a-z]+ [a-z]+$"
```
### Keystore Audit
```bash
# Hook Keystore operations
frida -U -f com.target.app -l tracer-cipher.js
# Script source: github.com/WithSecureLabs/android-keystore-audit
```
---
## Phase 3: Component Security Testing
### Component Exposure Enumeration
```bash
# Drozer enumeration
dz> run app.package.attacksurface com.target.app
# Output: X activities exported, Y services exported, ...
```
### Activity Security
```
Exported Activity testing?
├─ Direct launch → adb shell am start -n com.target.app/.SensitiveActivity
├─ Does it bypass auth to access sensitive page directly?
│ ├─ Yes → authentication bypass vulnerability
│ └─ No → check Intent parameter injection
├─ Does Activity return sensitive data? → setResult() leakage
└─ Tapjacking test → filterTouchesWhenObscured / onFilterTouchEventForSecurity / overlay touch handling
```
### Content Provider Security
```bash
# Enumerate providers
dz> run app.provider.info -a com.target.app
# SQL injection testing
dz> run app.provider.query content://com.target.app.provider/users --projection "* FROM sqlite_master--"
# Path traversal testing
dz> run app.provider.read content://com.target.app.provider/../../../../etc/hosts
# File provider check
dz> run scanner.provider.traversal -a com.target.app
```
### Service / Broadcast Receiver
```bash
# Service enumeration and interaction
dz> run app.service.info -a com.target.app
dz> run app.service.start --action com.target.app.ACTION --component com.target.app/.MyService
# Broadcast testing
dz> run app.broadcast.info -a com.target.app
dz> run app.broadcast.send --action com.target.app.CUSTOM_ACTION --extra string data "test"
```
### Deep Link / URL Scheme
```bash
# Enumerate schemes
grep -rn "android:scheme" apktool_output/AndroidManifest.xml
# Trigger deep link
adb shell am start -a android.intent.action.VIEW -d "scheme://hostname/path?param=value"
# Check points:
# 1. Does parameter accept path traversal → ../../unwanted-endpoint
# 2. Is sensitive data (password/token) passed via URL parameters
# 3. Is there Open Redirect
```
---
## Phase 4: Data Storage Security
### Checklist
```
Data storage location?
├─ SharedPreferences → /data/data/pkg/shared_prefs/*.xml
│ └─ Stores plaintext passwords/tokens?
├─ SQLite databases → /data/data/pkg/databases/*.db
│ └─ Encrypted? Key hardcoded?
├─ Internal storage → /data/data/pkg/files/
│ └─ MODE_WORLD_READABLE/WRITABLE?
├─ External storage → /sdcard/ (globally readable/writable)
│ └─ Stores sensitive data?
├─ Keystore → Android Keystore System
│ └─ Key bound to device? Auth required?
└─ Background screenshot → /data/system_ce/0/snapshots/
└─ FLAG_SECURE set?
```
```bash
# Check SharedPreferences
adb shell run-as com.target.app cat /data/data/com.target.app/shared_prefs/*.xml
# Check databases
adb shell run-as com.target.app ls /data/data/com.target.app/databases/
# Pull and check with sqlite3
adb pull /data/data/com.target.app/databases/app.db
sqlite3 app.db ".tables"
sqlite3 app.db ".schema users"
sqlite3 app.db "SELECT * FROM users;"
# Check file permissions
adb shell run-as com.target.app ls -la /data/data/com.target.app/files/
```
---
## Phase 5: Network Communication Security
### Traffic Capture Configuration
```
Traffic capture method?
├─ App targetSdkVersion < 24 → trusts user CAs by default; set WiFi proxy to Burp directly
├─ App targetSdkVersion >= 24 → doesn't trust user CAs by default; check/modify Network Security Config
│ ├─ Modify network_security_config.xml to trust user certificates
│ └─ Repack + sign + install, or install Burp CA into system certificate store (requires root)
├─ Flutter app → may use independent TLS/CA logic, needs extra handling
│ └─ See flutter SSL pinning bypass
└─ Non-HTTP traffic → tcpdump / iptables redirect
```
```bash
# Install Burp CA to system (requires root)
# Export Burp CA → DER format → convert to PEM
openssl x509 -inform DER -in cacert.der -out cacert.pem
# Calculate hash
HASH=$(openssl x509 -inform PEM -subject_hash_old -in cacert.pem | head -1)
cp cacert.pem /system/etc/security/cacerts/${HASH}.0
chmod 644 /system/etc/security/cacerts/${HASH}.0
# Modify network_security_config.xml (common for targetSdkVersion >= 24)
# In res/xml/network_security_config.xml add:
# <trust-anchors><certificates src="user" /></trust-anchors>
```
### SSL Pinning Detection and Bypass
```
SSL Pinning type?
├─ OkHttp CertificatePinner → Frida Hook
├─ Custom TrustManager → Frida Hook
├─ Network Security Config → modify XML and repack
├─ WebView SSL handling → Hook WebViewClient
└─ Unknown implementation → SSLPinDetect static scan to locate
```
```bash
# Static detection of Pinning implementation
python sslpindetect.py -f target.apk -a apktool.jar
# apk-mitm automatic bypass (no root needed)
npx apk-mitm target.apk
# objection bypass
objection --gadget com.target.app explore --startup-command "android sslpinning disable"
# Frida bypass (universal script)
frida -U -f com.target.app -l ssl-pinning-bypass.js
```
---
## Phase 6: Protection Bypass
### Root Detection Bypass
```
Root detection mechanism?
├─ File checks (/su, /system/xbin/su, Cydia, etc.)
│ └─ Magisk DenyList to hide
├─ SafetyNet / Play Integrity
│ └─ Hardware-level attestation is hard to bypass
│ └─ Basic attestation → Play Integrity Fix (Zygisk module)
├─ RootBeer / custom detection library
│ └─ Frida Hook return value
└─ System property checks (ro.debuggable, ro.secure)
└─ MagiskHide Props Config
```
```bash
# objection bypass root detection
objection --gadget com.target.app explore --startup-command "android root disable"
# Frida Hook generic root detection bypass
frida -U -f com.target.app -l anti-root.js
```
### Emulator Detection Bypass
```bash
# Detection points: Build.FINGERPRINT, Build.MODEL, CPU_ABI, /dev/qemu_pipe
# Frida Hook Build class attributes
```
### Anti-Debug / Anti-Frida Bypass
```
Anti-Frida detection methods?
├─ Check frida-server port (27042)
│ └─ Change listening port: frida-server -l 0.0.0.0:1234
├─ Check /proc/self/maps for frida libraries
│ └─ Use linjector for injection (no ptrace)
├─ Check D-Bus protocol characteristics
│ └─ Use self-compiled Frida gadget
└─ Suicide kill(getpid()) anti-analysis
└─ Hook Process.killProcess / exit
```
### Screenshot/Recording Protection Bypass
```bash
# Disable FLAG_SECURE for screenshots, screen recording, and dynamic analysis recording
objection --gadget com.target.app explore -s "android ui FLAG_SECURE false"
```
### Biometric Authentication Bypass
```bash
# Frida fingerprint bypass
frida --codeshare krapgras/android-biometric-bypass-update-android-11 -U -f com.target.app
```
---
## Phase 7: Client-Side Injection Vulnerabilities
### WebView Security
```
WebView configuration check?
├─ JavaScript enabled → setJavaScriptEnabled(true) → XSS risk
├─ File protocol access → setAllowFileAccess(true) → LFI risk
├─ addJavascriptInterface → RCE (API < 17)
└─ WebViewClient certificate handling → ignoring SSL errors?
```
### SQL Injection
- Content Provider query/insert/update/delete methods
- Whether custom database operations use parameterized queries
### Intent Injection
- Proxy Activity/Service receives Intent and directly calls `startActivity()`
- WebView URL parsed via `Intent.parseUri()` → malicious Intent construction
---
## Automated Analysis Tools Quick Reference
| Tool | Type | Usage |
|------|------|-------|
| MobSF | Static + Dynamic | Docker deployment, Web UI |
| Qark | Static | `qark --apk target.apk` |
| AndroBugs | Static | `python androbugs.py -f target.apk` |
| SUPER | Static | `super-analyzer target.apk` |
| Androwarn | Static (behavior) | `python androwarn.py -i target.apk -r html` |
| mariana-trench | Static (data flow) | `mariana-trench --apk-path target.apk` |
| ReverseAPK | Static | `reverse-apk target.apk` |
---
## Malware Analysis Key Points
When analyzing suspicious APKs rather than pentesting, additionally look for:
- Native so library load chain: `System.loadLibrary` → decrypt second-layer ELF → `InMemoryDexClassLoader` fileless DEX
- `InMemoryDexClassLoader` usage → memory-level DEX loading (Frida Hook to dump)
- `AccessibilityService` abuse → overlay attack / ACTION_SET_TEXT hijacking
- FCM as C2 channel → check Firebase message trigger conditions
- Foreground Service + MediaPlayer persistence → process keepalive
---
## References
- [OWASP Mobile Application Security](https://owasp.org/www-project-mobile-app-security/)
- [OWASP MASTG - Android Testing Guide](https://mas.owasp.org/MASTG/)
- [HackTricks - Android App Pentesting](https://book.hacktricks.wiki/mobile-pentesting/android-app-pentesting/)
- [Frida CodeShare](https://codeshare.frida.re/)
Files in this skill
- SKILL.md
- references/android-frameworks-and-runtime.md
- references/android-frida-dynamic.md
- references/android-static-analysis.md
Attribution
Related skills
View all in security →Comments
Loading comments…
Newsletter
Get the weekly list of safe new skills, and the ones we pulled.