On This Page
Setting Up an Android Device for Root Access and HTTPS Traffic Interception via Burp Suite
Before getting started, I recommend creating a backup of your device and saving it on your computer.
This example is based on a Xiaomi Redmi 9A, but the approach will also work for other MIUI-based models that support bootloader unlocking and Fastboot ROMs.
This article guides you through configuring an Android emulator to intercept HTTPS traffic via Burp Suite in a typical MITM testing setup.
Enabling Developer Options and USB Debugging
First, enable developer mode and allow USB debugging:
- Go to Settings → About phone → tap MIUI version 5 times
- Then open Settings → Additional settings → Developer options and enable:
- USB debugging
- Install via USB
Bootloader Unlocking
The longest step is unlocking the bootloader — it's mandatory to get root access.
- Go to Settings → Additional settings → Developer options → Mi Unlock status
- Link your Mi account, insert a SIM card, and enable mobile data
- After successful binding, download the official Xiaomi Unlock Tool and log in
- Click Unlock
If everything is correctly configured, a message will appear saying that you need to wait 168 hours (7 days).
If your device isn’t detected, install MiUsbDriver (located in the same folder as the unlocker).
After 168 hours, re-run the unlock tool and proceed with unlocking.
Installing Magisk and Gaining Root Access
After unlocking the bootloader:
- Download Magisk (.apk) directly on the device and install it
- Open Magisk — if Superuser and Modules sections are inactive, you don't have root yet
Patching boot.img with Magisk
- Go to Settings → About phone and note your full MIUI version (e.g., 12.5.6.0 RCDMIXM)
- Visit Official HyperOS & MIUI ROM Download: latest version for Xiaomi, Mi, Redmi, POCO and search for your ROM version
- Download the Fastboot version of the firmware
- From the extracted firmware, copy the file images/boot.img to your device’s internal storage
- In Magisk → Install, check Patch a boot image file, and select boot.img
- The patched file will appear as magisk_patched-*.img in the Download folder
- Copy it from the device to your PC
Flashing the Patched Boot Image
- Extract both the firmware and the patched boot.img into the root of C:\
- You may also include the original boot.img in case you need to restore it later
- Reboot the phone into Fastboot mode:
-
Using ADB:
adb reboot bootloader
- Or manually: power off the phone, then hold Power + Volume Down
- Launch the Boot_Installer script:
- Choose 1 to flash magisk_patched.img
- Optional: 2 to restore the stock boot.img)
After that, the device will reboot automatically.
Verifying Root Access
- Open Magisk, go to settings (gear icon), enable Zygisk, and reboot
- In Magisk → Superuser, grant root access to the shell
- Connect the device to your PC and run:
adb shell
su
id
> uid=0(root) gid=0(root) groups=0(root) context=u:r:magisk:s0
Adding Burp's Certificate
- Convert the Burp certificate to the Android format:
- Copy the certificate to the device and add it to the trusted store:
openssl x509 -inform DER -in burp_cert.der -out burp_cert.pem
openssl x509 -inform PEM -subject_hash_old -in burp_cert.pem | head -1
Suppose the resulting hash is 1a2b3c4d, rename the file:
mv burp_cert.pem 1a2b3c4d.0
adb push 1a2b3c4d.0 /sdcard/
adb shell
su
mkdir -m 700 /data/certs
cp /system/etc/security/cacerts/* /data/certs/
mount -t tmpfs tmpfs /system/etc/security/cacerts
mv /sdcard/1a2b3c4d.0 /system/etc/security/cacerts/
mv /data/certs/* /system/etc/security/cacerts/
chown root:root /system/etc/security/cacerts/*
chmod 644 /system/etc/security/cacerts/1a2b3c4d.0
chcon u:object_r:system_file:s0 /system/etc/security/cacerts/*
Capturing Traffic with Burp
On your Android device, go to Wi-Fi settings, enable manual proxy, and enter the local IP address of your computer with port 8080.
In Burp Suite, set the proxy to listen on all interfaces.
If the certificate is installed properly and Magisk is working — you'll begin seeing full HTTPS traffic from your device inside Burp.
Published on Jul 23, 2025