Tomas' Labroratory

Sniffing Android x86 HTTPs traffic with BurpSuite

The task of sniffing traffic from an app on Android x86 ranges from trivial, to very complicated. The difference comes down to the various anti-sniffing techniques employed by the app and or the Android OS itself. This guide will walk you through the process starting with the most trivial scenario, all the way to the most complex.

Scenario 1: ProxyDroid

Before diving into the complexities of sniffing encrypted HTTPs traffic, it’s always good to do a sanity check to make sure that the packets are flowing into BurpSuite

  1. Install ProxyDroid app on Android. In case you are wondering why not use built in proxy settings, it’s because some apps ignore the built in proxy setting. By using ProxyDroid, it eliminates the guesswork and every single request is proxied
  2. Set host and port in ProxyDroid to match settings in BurpSuite
  3. Sniff HTTP traffic, it should be successful
  4. Sniffing HTTPs traffic will fail at this point, but you should at least see connection attempt errors showing up in BurpSuite event log. Those prove that it’s trying. See Scenario 2 on how to fix this.

Scenario 2: Simple HTTPs

When the application established HTTPs connection, the minimum it needs is a valid SSL certificate to prevent man in the middle attacks. By installing BurpSuite root certificate on Android, most applications will accept BurpSuite proxy as a trustworthy server.

  1. Download BurpSuite cert to Android by visiting http://burpsuiteproxyip:8080
  2. Steps to install it depend on exact Android version and sometimes the certificate has to be converted from der format to cer
  3. Sniff HTTPs traffic in BurpSuite
    1. If it works, congratulations!
    2. If you get other errors try Scenario 3

Scenario 3: HTTPs protected with pinning

Some applications aren’t satisfied with any old valid certificate, they are pinned to a specific certificate. Luckily there is a way to bypass this

  1. Android: Install frida-server on Android in /data/local/tmp
  2. Android: Run frida-server -l IPofAndroid (ex. 192.168.1.100)
  3. Windows: Run frida-ps -aiH IpofAndoid to find out application identifier ex: com.company.myapp
  4. Windows: download bypass.js into current directory
  5. Windows: frida -H IpofAndroid -f com.company.myapp -l bypass.js –no-pause (this will start the app)
  6. Windows: Watch HTTPs requests come in in plain text into BurpSuite, if you’re still gettting errors, especially “Remote host terminated the handshake” in BurpSuite and “CERTIFICATE_VERIFY_FAILED: self signed certificate in certificate chain” in logcat chances are you need to go deeper and look at Scenario 4 (if the app is build on Flutter)

Scenario 4: HTTPs inside Flutter