Use Burp Suite with Genymotion Desktop

May 7, 2024

Prerequisites

Step 1 – Setting up Burp Suite

1. In Burp Suite, go to the Proxy tab.

2. Click on Proxy Settings.

3. Here, we will choose to listen to port 8080 from all interfaces.

4. Click import/export CA certificate > Export > Certificate in DER format.

5. Choose a path and name it anything with a .der extension.

6. Click Next.

7. Note: We will use the name Burp_cert.der as an example for this tutorial.

Step 2 – Upload and install the Burp Suite Certificate

as user certificate

as system (root) certificate

Warning: This method alters the Android system significantly and may break the device. Use with extreme care and only if necessary!

Android 14

Android 12-13

Android 11 and below

Important

Installing System certificates on Android 14 requires Magisk 23.0 and a third party plugin.

1. Root the device

2. Install Magisk

3. Install the certificate as user certificate

4. Install the Cert-Fix plugin for Magisk

Warning: The Cert-Fix plugin will copy any user certificate as system certificate on boot. If you don’t need to install any other system certificates, make sure to disable the plugin to avoid installing system certificates by mistake.

3. Install the certificate (repeat for timeline variants)

Step 3 – Set Android global proxy to Burp Suite proxy

Note: It is possible to use Android settings, but we recommend using the ADB command line tool which is more reliable and easier to handle.

Note: If you do not have, or wish to install, Android SDK tools, you can use Genymotion ADB built-in tool. Please refer to Genymotion Desktop user guide for more information.

To set the global proxy, use the following adb command:

adb shell settings put global http_proxy <burp_proxy_ip>:<burp_listening_port>
Example:
adb shell settings put global http_proxy 192.168.1.84:8080

From then, Internet traffic should be redirected to Burp Suite.

Note: Though this setting is global, applications may have their own proxy settings which cannot be controlled this way. The only solution in this case is to use a third party Android application, such as ProxyDroid, to redirect all traffic from the device to Burp Suite proxy.

Disable global proxy

Important: If the proxy is still set after stopping the device, Wifi may be disabled the next time you start the device. To avoid this, make sure to unset the global proxy before stopping the device.

adb shell settings put global http_proxy :0

Extras

Genymotion Desktop and Burp Suite run on the same host

With VirtualBox

adb shell settings put global http_proxy 10.0.3.2:8080

With QEMU

adb shell settings put global http_proxy localhost:3333

adb reverse tcp:3333 tcp:8080

This binds the virtual device local TCP port 3333 to your host machine local TCP port 8080.

Script with gmtool to automate the process

Note: The following scripts require gmtool advanced commands which are only available with a paying license. You can use scripts to combine gmtool and adb to automatically set the proxy and start a device, and unset the proxy while stopping the device. See examples below.

Start script example

Shell script (Linux, macOS):

#!/bin/bash
## Start your device with gmtool.
## We assume Genymotion is installed in your Home folder.
$home/genymotion/gmtool admin start "your_device_name"

## Set Burp Suite proxy as global proxy to the device.
## We use proxy IP 10.0.3.2 and port 8080. Replace with your own settings.
## We use Genymotion built-in ADB.
$home/genymotion/tools/adb shell settings put global http_proxy 10.0.3.2:8080

Start script example (second variant)

#!/bin/bash
## Start your device with gmtool.
## We assume Genymotion is installed in "C:\Program Files".
"C:\Program Files\Genymobile\Genymotion\gmtool.exe admin start "your_device_name""

## Set Burp Suite proxy.
## We use proxy IP 10.0.3.2 and port 8080. Replace with your own settings.
## We use Genymotion built-in ADB
C:\Program Files\Genymobile\Genymotion\tools/adb shell settings put global http_proxy 10.0.3.2:8080

Stop script example

Shell script (Linux, macOS):

#!/bin/bash
## Remove the global proxy settings.
$home/genymotion/tools/adb shell settings put global http_proxy :0

## Stop the running device.
$home/genymotion/gmtool admin stop "your_device_name"

Batch script (Windows):

@echo off
REM Start your device with gmtool.
REM We assume Genymotion is installed in "C:\Program Files".
C:\Program Files\Genymobile\Genymotion\gmtool.exe admin start "your_device_name"

REM Set Burp Suite proxy.
REM We use proxy IP 10.0.3.2 and port 8080. Replace with your own settings.
REM We use Genymotion built-in ADB
C:\Program Files\Genymobile\Genymotion\tools adb shell settings put global http_proxy 10.0.3.2:8080

Stop script example (Windows)

@echo off
REM Remove the global proxy settings.
C:\Program Files\Genymobile\Genymotion\tools adb shell settings put global http_proxy :0

REM Stop the running device.
C:\Program Files\Genymobile\Genymotion\gmtool.exe admin stop "your_device_name"

Extras