Step 1: Create a Virtual Device
- Open Genymotion and create a new virtual device.
- Select Android Version. ( In this blog i'm going to use Android 12 has a base )
- Start the newly created virtual device.
Step 2: Enable Root Access
Make sure ADB is installed and configured. Once the emulator starts, run the following command to enable root access:
adb shell setprop persist.sys.root_access 3
(This command needs to be executed every time you start the emulator. in order to maintain the root access inside the emulator)
Step 3: Install Magisk
- Drag and drop the Magisk.apk onto the emulator.
- Open the Magisk app and grant root access when prompted.
- Restart the Magisk app.
- Inside the Magisk app, install Magisk using the Direct Install method.
- Drag and drop the Magisk_rebuilt_1c8ebfac_x86_64.zip file into the emulator.
- Reboot the emulator.
-
Once the emulator restarts, run the root access command again:
sh adb shell setprop persist.sys.root_access 3(This command needs to be executed every time you start the emulator. in order to maintain the root access inside the emulator)
Step 4: Setting Up BurpSuite
- Ensure BurpSuite is running.
- Open BurpSuite and navigate to Proxy > Options to find the CA certificate.
-
Download the BurpSuite certificate from:
http://localhost:8080
Step 5: Install the BurpSuite Certificate
- Drag and drop the cacert.der file into the emulator.
- Install the certificate manually:
- Settings > Security > Encryption & Credentials > Install a certificate > CA certificate.
Step 6: Install AlwaysTrustUserCerts Module
- Drag and drop the AlwaysTrustUserCerts.zip file into the emulator.
- Open the Magisk app and install the AlwaysTrustUserCerts module.
- Restart the emulator.
- Verify the certificate installation:
- Settings > Security > Encryption & Credentials > Trusted Credentials.
- Check if PortSwigger is listed.
Step 7: Forward Emulator Traffic to BurpSuite
To capture network traffic from the emulator, forward its TCP:3333 port to BurpSuite's 8080 port:
adb shell settings put global http_proxy localhost:3333
adb reverse tcp:3333 tcp:8080
Step 8: Verify HTTPS Traffic Interception
- Open a browser on the emulator and visit a website.
- Check the BurpSuite Proxy History to confirm that requests are being captured.
Conclusion
By following these steps, you now have a rooted Genymotion emulator with Magisk installed and BurpSuite configured for HTTPS traffic interception. This setup is useful for security testing, app pentesting, and network analysis.
If you restart the emulator, remember to re-run:
adb shell setprop persist.sys.root_access 3
to regain root access.