Mobile Bug Hunting (Android) Setup Walkthrough
Mobile application testing (Android & iOS) is a massive, highly lucrative frontier in bug bounty. Because setting up a mobile testing environment has a steeper learning curve than web testing, there is significantly less competition. Many targets that are hardened on their web app have completely unguarded APIs on their mobile endpoints.
This guide provides a click-by-click walkthrough to set up an Android pentesting lab on your local machine.
flowchart TD APK[Target APK File] --> Static[Static Analysis JADX] APK --> Dynamic[Dynamic Traffic Analysis] Static --> Decompile[Decompile APK via JADX-GUI] Decompile --> ScanSecrets[Search for API routes & hardcoded secrets] Dynamic --> EnvSetup[1. Rooted Android Emulator Setup] EnvSetup --> CertPush[2. Export & push Proxy System CA Certificate] CertPush --> FridaStart[3. Launch Frida-Server on Emulator] FridaStart --> FridaBypass[4. Run Frida SSL Bypass Script on Host] FridaBypass --> Intercept[5. Intercept decrypted HTTPS traffic in Proxy] style Static fill:#b3d9ff,stroke:#333,stroke-width:1px,color:#000 style Dynamic fill:#b3d9ff,stroke:#333,stroke-width:1px,color:#000 style Intercept fill:#99ff99,stroke:#333,stroke-width:2px,color:#000
1. Emulator Lab Setup
Section titled “1. Emulator Lab Setup”You need a rooted Android device. Using an emulator is the easiest path.
Setting Up Android Studio AVD (Recommended)
Section titled “Setting Up Android Studio AVD (Recommended)”- Download and install Android Studio.
- Open the Device Manager and click Create Device.
- Choose a device definition (e.g., Pixel 6). Click Next.
- Select a system image. Critical: Select an image WITHOUT Google Play APIs (choose “Google APIs” instead). Images with Google Play are pre-production and cannot be rooted via adb.
- Choose Android 10.0 (API 29) or Android 11.0 (API 30) for optimal compatibility.
- Click Finish and start the virtual device.
- Verify root access via terminal:
Terminal window adb rootadb shell whoami# Should return "root"
2. Installing System CA Certificates (Android 10+)
Section titled “2. Installing System CA Certificates (Android 10+)”Starting with Android 7.0, applications by default ignore user-installed CA certificates. To intercept HTTPS traffic, you must write your proxy’s CA certificate to the system trust store.
Step-by-Step Certificate Injection
Section titled “Step-by-Step Certificate Injection”- Export your proxy CA certificate from Burp/Caido as a DER file (e.g.,
cacert.der). - Calculate the subject hash of the certificate using openssl:
Terminal window # Convert DER to PEMopenssl x509 -inform DER -in cacert.der -out cacert.pem# Calculate the hashopenssl x509 -inform PEM -subject_hash_old -in cacert.pem | head -1# Example output: 9a5ba575 - Rename the PEM file to
[hash].0(e.g.,9a5ba575.0). - Push the certificate to the emulator:
Terminal window # Remount system partition as writeable.# On many Android 10+ images, start the emulator with a writable system first:# emulator -avd YOUR_AVD_NAME -writable-systemadb disable-verityadb reboot# (Wait for reboot)adb rootadb remount# Push certificate to system storeadb push 9a5ba575.0 /system/etc/security/cacerts/# Set correct permissionsadb shell chmod 644 /system/etc/security/cacerts/9a5ba575.0 - Reboot the emulator. The certificate will now show up under Settings → Security → Trusted Credentials → System.
3. Static Analysis with JADX
Section titled “3. Static Analysis with JADX”Before running the app, pull the APK and extract its source code to find hidden endpoints and hardcoded developer credentials.
Extracting the APK
Section titled “Extracting the APK”- List package names on the device:
Terminal window adb shell pm list packages | grep targetname# Example output: package:com.target.app - Find the path of the APK:
/data/app/com.target.app-xyz/base.apk adb shell pm path com.target.app - Pull the APK to your host machine:
Terminal window adb pull /data/app/com.target.app-xyz/base.apk target.apk
Reviewing Source Code
Section titled “Reviewing Source Code”- Install and launch JADX-GUI (https://github.com/skylot/jadx).
- Open
target.apkinside JADX. - Use global search (
Ctrl + Shift + F):- Endpoints: Search for
http://orhttps://or API routes (e.g.,/api/v). - Secrets: Search for keys like
aws_,firebase,google_api_key,secret,jwt,private_key. - Firebase: Check if they expose a Firebase URL (e.g.
*.firebaseio.com). If they do, verify if it is public by browsing tohttps://[instance].firebaseio.com/.jsonin your browser. If it returns the database contents, file a report immediately!
- Endpoints: Search for
4. Dynamic Hooking and SSL Pinning Bypass (Frida)
Section titled “4. Dynamic Hooking and SSL Pinning Bypass (Frida)”Many modern applications implement SSL Pinning, meaning the app hardcodes the certificate it expects and rejects your proxy certificate, even if it is installed in the system store. We bypass this by injecting a script into the application process at runtime using Frida.
Setting Up Frida-Server
Section titled “Setting Up Frida-Server”- Install Frida tools on your host machine:
Terminal window pip install frida-tools - Check the CPU architecture of your emulator:
Terminal window adb shell getprop ro.product.cpu.abi# Example output: x86_64 or arm64-v8a - Download the matching frida-server release from GitHub (https://github.com/frida/frida/releases) matching your architecture and host-side version (
frida --version). - Push and launch the server on the device:
Terminal window adb push frida-server-xxxx /data/local/tmp/frida-serveradb shell chmod 755 /data/local/tmp/frida-serveradb shell "/data/local/tmp/frida-server &"
Injecting SSL Pinning Bypass Script
Section titled “Injecting SSL Pinning Bypass Script”- Find the application package name (e.g.,
com.target.app). - Run the application through Frida while loading a universal SSL Pinning bypass script from the Frida Codeshare:
Terminal window frida --codeshare pcipolloni/universal-android-ssl-pinning-bypass-with-frida -f com.target.app -U - Type
%resumein the Frida console. - The application will launch, the SSL certificate verification libraries will be hijacked, and you will see the app’s traffic flowing cleanly through your Burp/Caido proxy history.
iOS Without a Mac
Section titled “iOS Without a Mac”You can unpack an IPA on Windows or Linux and read Info.plist, entitlements, strings, and class names. That work is useful when it feeds the API tests you already know how to run. It is a weak report by itself. Most programs treat a hardcoded URL or a suspicious string as informational until you show the behavior at runtime.
Dynamic iOS testing needs Apple hardware, a jailbroken or instrumented device, or a cloud lab. Corellium’s published Solo Explorer rate has been about $3 per device-hour, and enterprise contracts sit far above a beginner budget. Recheck the current price before you plan around it. Until then, spend the mobile hours on Android, where adb, JADX, and Frida already run on the machine you have.
When you do file a mobile bug, cite the MASVS v2 group and say whether the evidence is static, dynamic, or both. The group names are in Section 17. A root-detection bypass alone is not the finding.
Next step: for CLI pipelines, iOS, and cloud devices, read Section 25.
Open local graph around this page
Linked from here
Bug Hunting for BeginnersFor authorized testing only. Read the ethics note before you put a domain in scope.