← Beginner Android Penetration Testing
Task 1
Lab Setup
▾
Introduction
A pentester is only as good as their tools. In this room, we'll build a safe, isolated, and legal environment to hack Android apps. We will use an emulator so we don't break our own phones.
Lab Setup Steps
1. Install Java Development Kit (JDK)
- Why? Android tools are built on Java.
- Action: Download JDK 8 or 11 from Oracle or OpenJDK. Install it and set the
JAVA_HOMEenvironment variable. - Verification:
java -version
2. Install Android Studio & SDK
- Why? It provides
adb(Android Debug Bridge),emulator, and other platform tools. - Action: Download Android Studio from developer.android.com/studio. Install it. During installation, ensure the "Android SDK Platform-Tools" and "Android Emulator" are selected.
3. Install Genymotion (Faster Emulator)
- Why? The default AVD is slow. Genymotion is much faster for testing.
- Action:
- Create a free account on genymotion.com.
- Download Genymotion with VirtualBox.
- Install it.
- Create a new virtual device (e.g., Google Nexus 5 - Android 9.0 or 10.0).
4. Install APKTool
- Why? For reverse engineering and repackaging APKs.
- Action:
- Download the
apktool.jarand a wrapper script from the official website. - Place them in a folder (e.g.,
C:\tools\apktool) and add it to yourPATH.
- Download the
5. Install Burp Suite Community Edition
- Why? To intercept, view, and modify network traffic between the app and the internet.
- Action:
- Download from portswigger.net.
- Install it.
6. Configure Emulator to use Burp Proxy
- Action in Genymotion:
- Start your Genymotion emulator.
- Go to
Settings->Wi-Fi. - Long-press on the connected network (
WiredSSIDor similar) and selectModify network. - Select
Show advanced options. - Set
ProxytoManual. - Enter your computer's local IP address (e.g.,
192.168.1.x) and Burp's port (default8080). - Save.
7. Test ADB Connection
-
Action on your computer's terminal:
adb devices -
Expected Output: You should see your running emulator's serial number (e.g.,
192.168.56.101:5555 device).
Your First ADB Commands
# See connected devices
adb devices
# Get an interactive shell on the device
adb shell
# Inside the shell, list installed packages
pm list packages
# Exit the shell
exit
# Install an APK
adb install your_app.apk
# Pull a file from the device to your computer
adb pull /sdcard/Download/somefile.txt .
Summary
- You have a functional testing lab: Emulator + ADB + APKTool + Burp Suite.
adbis your primary command-line tool to interact with the device.- Your emulator's traffic now routes through Burp, allowing you to intercept it.