setup/Skills/apk-bugbounty/SKILL.md
Android APK static analysis for bug bounty hunting. Decompiles APKs with BOTH Jadx AND Apktool for maximum coverage. Analyzes secrets, exported components, WebViews (Taint Analysis), deep links, Firebase, Native Libs, IPC abuse, and business logic flaws. Every finding MUST have concrete evidence and real exploit impact.
npx skillsauth add mswell/dotfiles apk-bugbountyInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Static analysis of decompiled Android APKs for bug bounty programs.
Rule #1: NO HALLUCINATION. Every finding MUST be backed by concrete code evidence (file path + line + snippet) and a clear, reproducible exploit path. Rule #2: No impact = not reported. Ignore theoretical issues without an attack vector. Rule #3: BRAIN DUMP MANDATE. Before listing vulnerabilities, output a Brain Dump documenting your reasoning, what you searched and failed to find, and why you discarded false positives. Rule #4: DUAL DECOMPILATION. ALWAYS run BOTH Jadx AND Apktool on every APK. Never skip one. Each tool reveals data the other misses.
Subagents MUST use Claude Code's dedicated tools for code analysis:
grep or rg via Bash)find or ls via Bash)cat/head/tail via Bash)jadx, apktool, strings, openssl, curl, adb, mkdir, unzip, bundletoolGoal: Validate tools, decompile with BOTH engines, create output directory, assess target.
which jadx && jadx --version || echo "FATAL: jadx not found in PATH"
which apktool && apktool --version || echo "FATAL: apktool not found in PATH"
If either tool is missing, STOP and inform the user immediately.
| Input | Action |
|---|---|
| .apk | Proceed to Step 3 directly |
| .xapk | unzip target.xapk -d xapk_contents/ → locate base.apk and split APKs → decompile base.apk |
| .aab | bundletool build-apks --bundle=target.aab --output=target.apks → unzip target.apks → decompile |
| Split APKs | Identify base.apk → decompile it; note split configs for reference |
| Already decompiled | Verify both Java sources AND smali*/ exist. If only one, run the missing tool |
mkdir -p .apk-audit
# ALWAYS run both tools
jadx -d out_jadx "$APK_FILE" --no-res --threads-count 4 2>&1 | tail -5
apktool d "$APK_FILE" -o out_apktool -f 2>&1 | tail -5
Why both:
out_jadx/sources/ — best for business logic, control flow, taint analysisout_apktool/ — catches obfuscated strings, resource values, and structures Jadx misses or decompiles incorrectly<workspace>/
├── out_jadx/
│ ├── sources/ ← Java source (PRIMARY for logic analysis)
│ └── resources/ ← Jadx-extracted resources
├── out_apktool/
│ ├── AndroidManifest.xml ← Properly decoded manifest (USE THIS ONE)
│ ├── smali*/ ← Bytecode (catches what Jadx misses)
│ ├── res/ ← Decoded XML (strings.xml, network_security_config, file_paths)
│ ├── assets/ ← Raw assets, configs, certs, proto files
│ ├── lib/ ← Native libraries (.so)
│ └── unknown/ ← Proto schemas, build artifacts
└── .apk-audit/
└── report.md ← Final report
Quickly determine using Grep/Read:
out_apktool/AndroidManifest.xmla.b.c style?Search paths for ALL subsequent phases: out_jadx/sources/, out_apktool/smali*/, out_apktool/assets/, out_apktool/res/, out_apktool/unknown/, out_apktool/lib/
Delegate to 3 parallel specialized subagents (balanced workload), then compile report.
Wave 1 (PARALLEL — launch all three in a single message):
├── mobile-security agent → Phases 1 + 4 (Manifest/Attack Surface + WebView/Taint)
├── security-automation agent → Phases 2 + 3 + 5 (Secrets + Network + Data Storage)
└── pentest agent → Phases 6 + 7 + 8 (IPC + Firebase + Business Logic/Native)
Wave 2 (SEQUENTIAL — after Wave 1 completes):
└── report-writer agent → Phase 9: Compile all findings into .apk-audit/report.md
Steps:
Agent calls in parallel. Provide each with:
out_jadx/, out_apktool/)references/secret-patterns.mdreferences/frida-templates.mdreport-writer with all findings and references/android-cwe-checklist.md.Phase 1: Manifest & Attack Surface → exports, deep links, permissions, Task Hijacking, tapjacking
Phase 2: Secrets & Certificates → keys, tokens, certs across ALL dirs (Jadx + Apktool)
Phase 3: Network Security → cleartext, cert pinning, MITM, WebSocket, TrustManager
Phase 4: WebView & Taint Analysis → JS bridges, file access, mandatory source-to-sink tracing
Phase 5: Data Storage → SharedPrefs, SQLite, logs, external storage, clipboard
Phase 6: IPC & Component Abuse → Intent injection, Provider traversal, FileProvider, PendingIntent
Phase 7: Firebase & Cloud → misconfig, exposed endpoints, unauthenticated access
Phase 8: Business Logic & Native → CmdInjection, ZipSlip, auth bypass, proto/gRPC, native libs
Phase 9: Report & PoC Generation → Confirmed findings with evidence + Frida scripts
Goal: Map the full attack surface from the manifest and component configuration.
Use out_apktool/AndroidManifest.xml as the source of truth (properly decoded by Apktool).
Core checks:
android:exported="true" — cross-reference with intent filtersandroid:scheme=, android:host=, android:pathPrefix=, android:pathPattern=uses-permission — flag: CAMERA, LOCATION, CONTACTS, SMS, STORAGE, PHONE, READ_LOGSandroid:allowBackup, android:fullBackupContent, android:dataExtractionRulesandroid:debuggable="true"android:grantUriPermissions, android:readPermission, android:writePermissionCommonly missed checks:
7. Task Hijacking: launchMode="singleTask" + taskAffinity set to empty string or another package → phishing via activity overlay
8. Custom permission protectionLevel: <permission with protectionLevel="normal" or "dangerous" without "signature" → any app can request it
9. Tapjacking: Search source for filterTouchesWhenObscured. Exported activities with sensitive UI lacking this are vulnerable to overlay attacks
10. Broadcast receivers with priority: android:priority in <intent-filter> — high priority on ordered broadcasts enables interception and abort
11. SDK versions: minSdkVersion < 28 → cleartext allowed by default. Low targetSdkVersion weakens many security defaults
For each exported component, document:
adb commandGoal: Find credentials, keys, and tokens with actual access potential.
Reference: Read references/secret-patterns.md for comprehensive regex patterns by provider.
Search strategy (prioritized):
BuildConfig.java, strings.xml, google-services.json, any .properties filesreferences/secret-patterns.md across BOTH out_jadx/sources/ AND out_apktool/smali*/.json, .xml, .properties, .cfg, .conf, .yaml files in out_apktool/assets/strings on each .so file in out_apktool/lib/, search for URLs, keys, tokensout_apktool/unknown/ for config files and build artifactsCertificate analysis:
# Find cert files (use Glob: *.pfx, *.p12, *.keystore, *.jks, *.pem, *.crt, *.key)
# Test common passwords
for pw in "" "password" "123456" "android" "changeit"; do
openssl pkcs12 -in <cert_path> -nokeys -passin "pass:$pw" 2>/dev/null && echo "CRACKED: $pw" && break
done
Validation for every secret found:
Goal: Identify MITM opportunities, cleartext exposure, and transport security flaws.
Checks:
Network security config: Read out_apktool/res/xml/network_security_config.xml
targetSdkVersion >= 28: cleartext blocked by default (good)targetSdkVersion < 28: cleartext allowed by default (report it)cleartextTrafficPermitted, <trust-anchors>, user-installed CA trust, custom pinsTrustAllCerts (CRITICAL): Search for X509TrustManager, checkServerTrusted, TrustManager — empty method body = disabled validation
HostnameVerifier bypass: Search for HostnameVerifier, ALLOW_ALL_HOSTNAME_VERIFIER, verify methods returning true unconditionally
HTTP URLs: Search for http:// across sources and assets — exclude schemas.android.com, www.w3.org, localhost, 127.0.0.1, 10.0.
WebSocket without TLS: Search for ws:// (not wss://) — unencrypted WebSocket traffic
Certificate pinning implementation: Search for CertificatePinner, sha256/, pin entries in network_security_config — note class names for Frida bypass PoC (see references/frida-templates.md)
Goal: Find XSS, arbitrary URL load, file access, and JS bridge abuse via source-to-sink tracing.
Step 1 — Identify Sinks & Configs (search both Jadx and Apktool output):
setJavaScriptEnabled(true) — JS execution enabledaddJavascriptInterface — JS-to-Java bridge (RCE on API < 17)setAllowFileAccess, setAllowFileAccessFromFileURLs, setAllowUniversalAccessFromFileURLsloadUrl, loadData, loadDataWithBaseURL, evaluateJavascript — URL loading sinkspostMessage, onMessage, WebMessageListener — JS-to-native bridge via postMessageshouldOverrideUrlLoading returning false for unvalidated URLs — allows navigation to attacker-controlled pagesStep 2 — Identify Sources:
getIntent().getData(), getIntent().getStringExtra()getQueryParameter, getPathSegmentsSharedPreferences, ContentProvider queriesStep 3 — MANDATORY Taint Analysis (for each sink found):
shouldOverrideUrlLoading filter domains? Is there a whitelist?Only report if: Untrusted data flows from Source → Sink WITHOUT adequate validation. Document the complete chain.
Goal: Find PII/secrets written to accessible or logged locations.
Checks:
SharedPreferences with sensitive data:
getSharedPreferences → identify preference file names.putString, .putInt in same class — flag tokens, passwords, PII stored without encryption (EncryptedSharedPreferences)SQLite databases:
openOrCreateDatabase, SQLiteDatabase, SQLiteOpenHelperExternal storage (world-readable):
getExternalStorageDirectory, getExternalFilesDir, Environment.EXTERNAL_STORAGELogging sensitive data:
Log.d, Log.v, Log.i, Log.w, Log.e across sourcesClipboard exposure:
ClipboardManager, setPrimaryClip — clipboard data is accessible to all appsGoal: Intent injection, ContentProvider path traversal, FileProvider abuse, broadcast interception.
Checks:
ContentProvider path traversal:
openFile, openAssetFile, ParcelFileDescriptor in sourcesUri path is validated against ../ traversalquery method for SQL injection potentialFileProvider paths (commonly missed, high impact):
out_apktool/res/xml/file_paths.xml and any *_paths.xml variants<root-path name="root" path="/" /> → exposes entire filesystem<external-path> with broad patterns → exposes external storageUnsafe Intent handling:
getStringExtra, getIntExtra, getBundleExtra, getParcelableExtraloadUrl, SQL queries, file operations, startActivitystartActivity(getIntent().getParcelableExtra("intent"))PendingIntent hijacking:
PendingIntent.getActivity, PendingIntent.getBroadcast, PendingIntent.getServiceFLAG_MUTABLE on implicit PendingIntents → hijackablenew Intent()) in PendingIntent → attacker controls destinationImplicit intents leaking data:
new Intent("action") without explicit component → data visible to all appsOAuth / SSO redirect abuse (mobile-specific):
redirect_uri, callback, sso, oauth, authorizeextra_data.startsWith("/accounts_center/") bypassed via double URL encoding (%252F..%252F)response_type=token with app-specific redirect schemes — token in URL fragment readable by any app intercepting the custom schemestate parameter generated and validated? Missing = CSRF in OAuth flowChecks:
google-services.json: Use Glob to find, then Read — extract project_id, api_key, storage_bucket, database_url
Firebase/Cloud URLs: Search for firebaseio.com, appspot.com, storage.googleapis.com, cloudfunctions.net
Unauthenticated access tests:
# Firebase Realtime Database
curl -s "https://<project_id>.firebaseio.com/.json" | head -c 500
# Cloud Storage bucket listing
curl -s "https://storage.googleapis.com/<bucket_name>/" | head -c 500
# Firestore documents
curl -s "https://firestore.googleapis.com/v1/projects/<project_id>/databases/(default)/documents" | head -c 500
# Test if key works for Maps API (common unrestricted key)
curl -s "https://maps.googleapis.com/maps/api/staticmap?center=0,0&zoom=1&size=100x100&key=<API_KEY>" -o /dev/null -w "%{http_code}"
Goal: Logic flaws, command injection, unsafe file handling, proto/gRPC leaks, native lib analysis.
Checks:
OS Command Injection:
Runtime.getRuntime().exec(, ProcessBuilder — trace if user input reaches command argumentsZipSlip (Path Traversal via Zip):
ZipEntry + getName() — check if entry name is validated against ../ before extractionAuthentication & payment logic:
isLoggedIn, checkAuth, verifyToken, payment, checkout, purchase, priceRoot/emulator detection:
isRooted, detectRoot, RootBeer, isEmulator, SafetyNet, Play Integrityreferences/frida-templates.md)Proto/gRPC schema files:
**/*.proto across out_apktool/assets/, out_apktool/unknown/, rootNative library analysis:
.so files with architectures in out_apktool/lib/strings on each .so → search for URLs, keys, hardcoded credentialsRegisterNatives, JNI_OnLoadObfuscation assessment:
a.a.a = obfuscatedPostMessage / WebView bridge security:
postMessage with targetOrigin: '*' in WebView bridges — tokens/codes sent to any originWebMessageListener / addWebMessageListener without origin validationwindow.name persistence across WebView navigations — cross-origin data leakageWebView.evaluateJavascript called with data from untrusted Intent extraswindow.name reuse in Android WebView (differs from Chrome browser behavior)Output: Write .apk-audit/report.md
References for report-writer agent:
references/android-cwe-checklist.md — CWE mapping, CVSS scoring guide, attack chain escalationsreferences/android-impact-matrix.md — Attacker position, P0/P1/P2 priority triage, SDK vs App scope guidance, report quality checklistreferences/frida-templates.md — Frida PoC scripts for client-side control bypassesOnly include confirmed findings with:
Frida PoC Requirement: For vulnerabilities involving client-side controls, MUST include a Frida script. See references/frida-templates.md.
CWE Reference: Use references/android-cwe-checklist.md for accurate CWE mapping and CVSS scoring.
# Brain Dump
## Target Overview
- **Package:** [from manifest]
- **Version:** [versionName + versionCode]
- **Min SDK:** X | **Target SDK:** Y
- **Obfuscation:** [none / ProGuard / R8 — observed pattern]
- **Decompilation:** Jadx [success/partial/failed] | Apktool [success/partial/failed]
## Attack Surface Summary
- **Exported components:** N total (X without permission protection)
- **Deep link schemes:** [list with hosts]
- **Dangerous permissions:** [list]
- **Native libraries:** [count and names]
- **Firebase/Cloud:** [project ID if found]
## Analysis Log
- [Key decisions made during analysis and reasoning]
- [Interesting patterns observed, potential attack chains identified]
## Dead Ends & False Positive Elimination
- [Searches that returned no actionable results and why]
- [Findings investigated and discarded — with specific reason]
- [Expected patterns not present in this app]
---
# APK Bug Bounty Report: [package_name]
## Executive Summary
- **Findings:** N total | Critical: X | High: X | Medium: X | Low: X
- **Scope:** Dual decompilation (Jadx + Apktool), [X] source files analyzed
---
## [VULN-001] Title — SEVERITY
**CWE:** CWE-XXX — [Title]
**CVSS 3.1:** X.X (AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N)
**Impact:** [What an attacker concretely achieves]
### Evidence & Taint Analysis
**Jadx:** `out_jadx/sources/com/example/TargetClass.java:42`
```java
[exact code snippet]
Apktool (corroboration): out_apktool/smali/com/example/TargetClass.smali:128
[relevant smali if it adds context]
Data flow: [Source] → [intermediate] → [Sink]
# Exact adb / curl / Frida commands
[Specific fix with code example]
development
Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
tools
Turn the current conversation context into a PRD and publish it to the project issue tracker. Use when user wants to create a PRD from the current context.
tools
Break a plan, spec, or PRD into independently-grabbable issues on the project issue tracker using tracer-bullet vertical slices. Use when user wants to convert a plan into issues, create implementation tickets, or break down work into issues.
development
Test-driven development with red-green-refactor loop. Use when user wants to build features or fix bugs using TDD, mentions "red-green-refactor", wants integration tests, or asks for test-first development.