Skip to content

Mobile Bug Hunting (Android) Setup Walkthrough

4 min readBug Hunting for Beginners

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

You need a rooted Android device. Using an emulator is the easiest path.

Section titled “Setting Up Android Studio AVD (Recommended)”
  1. Download and install Android Studio.
  2. Open the Device Manager and click Create Device.
  3. Choose a device definition (e.g., Pixel 6). Click Next.
  4. 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.
  5. Choose Android 10.0 (API 29) or Android 11.0 (API 30) for optimal compatibility.
  6. Click Finish and start the virtual device.
  7. Verify root access via terminal:
    Terminal window
    adb root
    adb 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.

  1. Export your proxy CA certificate from Burp/Caido as a DER file (e.g., cacert.der).
  2. Calculate the subject hash of the certificate using openssl:
    Terminal window
    # Convert DER to PEM
    openssl x509 -inform DER -in cacert.der -out cacert.pem
    # Calculate the hash
    openssl x509 -inform PEM -subject_hash_old -in cacert.pem | head -1
    # Example output: 9a5ba575
  3. Rename the PEM file to [hash].0 (e.g., 9a5ba575.0).
  4. 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-system
    adb disable-verity
    adb reboot
    # (Wait for reboot)
    adb root
    adb remount
    # Push certificate to system store
    adb push 9a5ba575.0 /system/etc/security/cacerts/
    # Set correct permissions
    adb shell chmod 644 /system/etc/security/cacerts/9a5ba575.0
  5. Reboot the emulator. The certificate will now show up under Settings → Security → Trusted Credentials → System.

Before running the app, pull the APK and extract its source code to find hidden endpoints and hardcoded developer credentials.

  1. List package names on the device:
    Terminal window
    adb shell pm list packages | grep targetname
    # Example output: package:com.target.app
  2. Find the path of the APK:
    /data/app/com.target.app-xyz/base.apk
    adb shell pm path com.target.app
  3. Pull the APK to your host machine:
    Terminal window
    adb pull /data/app/com.target.app-xyz/base.apk target.apk
  1. Install and launch JADX-GUI (https://github.com/skylot/jadx).
  2. Open target.apk inside JADX.
  3. Use global search (Ctrl + Shift + F):
    • Endpoints: Search for http:// or https:// 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 to https://[instance].firebaseio.com/.json in your browser. If it returns the database contents, file a report immediately!

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.

  1. Install Frida tools on your host machine:
    Terminal window
    pip install frida-tools
  2. Check the CPU architecture of your emulator:
    Terminal window
    adb shell getprop ro.product.cpu.abi
    # Example output: x86_64 or arm64-v8a
  3. Download the matching frida-server release from GitHub (https://github.com/frida/frida/releases) matching your architecture and host-side version (frida --version).
  4. Push and launch the server on the device:
    Terminal window
    adb push frida-server-xxxx /data/local/tmp/frida-server
    adb shell chmod 755 /data/local/tmp/frida-server
    adb shell "/data/local/tmp/frida-server &"
  1. Find the application package name (e.g., com.target.app).
  2. 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
  3. Type %resume in the Frida console.
  4. 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.

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.

Connections6 backlinks · 2 outgoing · 1 cross-guideFull graph →
Open local graph around this page
Open full graph →
Click a node to open · Drag to reposition · Scroll to zoom

Bug Hunting for BeginnersFor authorized testing only. Read the ethics note before you put a domain in scope.