Showing posts with label OWASP. Show all posts
Showing posts with label OWASP. Show all posts

Monday, July 28, 2025

🔧 Intercepting Android API Traffic with Burp Suite and a Rooted Emulator

Testing the security and behavior of Android apps often requires intercepting and analyzing API requests and responses. In this guide, we’ll walk through setting up an Android emulator to work with Burp Suite, enabling interception of HTTPS traffic and performing advanced manipulations like brute-force attacks.

⚠️ Requirements:

  • Android Emulator (AVD)
  • Root access (via Magisk)
  • Burp Suite (Community or Professional Edition)


🛠 Step-by-Step Setup Guide

✅ 1. Install Burp Suite

  • Download Burp Suite Community Edition (2023.6.2) from PortSwigger.

  • Launch the app and navigate to:

    Proxy → Options → Proxy Listeners → Import/Export CA Certificate

✅ 2. Export and Install Burp CA Certificate

  1. Export the CA Certificate in DER format and save it with a .crt extension.

  2. Transfer this .crt file to your emulator (drag and drop works fine).

  3. On the emulator:

    • Open Settings → Security → Encryption & Credentials

    • Tap Install from SD card

    • Choose the transferred certificate.

  4. Confirm installation:

    • Go to Trusted Credentials → User and verify the certificate is listed.


🔓 3. Root the Emulator

To trust user-installed certificates at the system level (bypassing Android’s certificate pinning), you must root the emulator.

Tools You’ll Need:

Rooting Process:

  1. Ensure your AVD is running before executing the root script.

  2. Unzip rootAVD and run the following command in terminal:

./rootAVD.sh ~/Library/Android/sdk/system-images/android-33/google_apis/arm64-v8a/ramdisk.img

  1. ✅ For Play Store-enabled AVDs, use google_apis_playstore in the path.
  2. Your emulator will shut down automatically after patching.


⚙️ 4. Install Magisk & Trust Certificates

  1. Restart your emulator and open the Magisk app.

  2. Navigate to Modules → Install from Storage → Select AlwaysTrustUserCerts.zip

  3. The emulator will restart again.

  4. Verify the certificate now appears under System certificates, not just User.


🌐 5. Connect Emulator to Burp Suite

In Burp Suite:

  1. Go to Proxy → Options → Add Listener

  2. Choose an IP from the 172.x.x.x range.

  3. Set port to 8080 and click OK.

On the Emulator:

  1. Connect to Wi-Fi.

  2. Long press the connected Wi-Fi → Modify Network → Proxy: Manual

  3. Set:

    • Host: Burp Suite IP (e.g., 172.x.x.x)

    • Port: 8080

    • Save the changes.


🚀 6. Intercept Traffic

  • Launch your Android debug app.

  • Open HTTP History in Burp Suite to monitor incoming requests/responses.


🎯 Conclusion

You now have a fully configured Android emulator that allows you to:

  • Intercept and inspect HTTPS API traffic

  • Analyze request/response headers and payloads

  • Perform manual or automated security tests (e.g., brute force attacks)

This setup is ideal for mobile QA, security testing, or reverse engineering Android applications in a safe, isolated environment.


💬 Feel free to bookmark or share this guide with fellow testers or developers diving into mobile app traffic inspection.
Happy hacking!

My Profile

My photo
can be reached at 09916017317