Skip to content

Capturing HTTP Requests from a non-proxy-aware Mobile Application

2 min read

UPDATE - This post has been updated to include a stable set of NAT rules for iptables.

Mobile applications are becoming increasingly popular, with many developers choosing to build them using frameworks such as Xamarin. However, there are times when these applications do not follow device proxy settings, making it difficult to capture the HTTP requests on Burp Suite or any other proxy tool.

In such cases, it is essential to find a solution that allows for the capture of this data. One effective solution is to create a custom OpenVPN. This process involves directing all traffic originating from the device to the VPN, which then routes it to the Burp Suite IP address. This method has been thoroughly tested and proven to be effective.

Detailed steps on setting up the environment:

  1. Setting up a custom OpenVPN. Here, we will be leveraging Digital Ocean (DO) to host our VPN. We will also use droplets with Ubuntu 22.04 installed. Set up two droplets - one for hosting our OpenVPN and the other, a private Certificate Authority (CA). Recommended droplets:

    • For hosting OpenVPN - $10 droplet
    • For hosting a private CA - $5 droplet
  2. Follow this documentation to setup OpenVPN on DO: (Please be careful and complete all the steps. Otherwise, the VPN will not work.)

  3. Create two clients for OpenVPN - one will be installed on a mobile device, and the other will be installed on the system where Burp is installed.

  4. After setting up the OpenVPN, we will need to create NAT rules for routing the traffic onto the Burp Suite. Create the following rules (the port number should be of the Burp):

iptables -t nat -A PREROUTING -p tcp --dport 443 -s -j DNAT --to-destination
iptables -t nat -A POSTROUTING -p tcp --dport 8081 -d -j SNAT --to-source

Here, is the local IP on the mobile device and is the local IP on which burp suite is installed.

  1. The NAT policy should look like this below: image

  2. Enable invisible proxy on the Burp Suite: image

  3. Now connect to the VPN on the mobile device and the system. This connection should capture the HTTP requests and responses.

Thank you for stopping by! If you have any questions, comments, or suggestions, please don't hesitate to reach out.

Share this post:

© 2024 Bhavuk Jain

Built with 💛 + Gatsby