Intercepting Android traffic through a proxy for debugging


Introduction

Sometimes, you want to inspect network calls an Android app is making, for debugging purpose.

There are some requirements to intercept SSL traffic.

  • Windows can intercept SSL traffic and act as a proxy
  • Android allows Windows to act as a proxy

These are both allowed through installing certificates.

Note: Apps can ignore user certificates. So if you want to use this for inspecting 3rd party apps, it’s possible that it won’t work.

Intercepting traffic through Fiddler

Requirements

Howto

Windows as a proxy:

On Windows, allow Fiddler Classic to act as a proxy, so that it can intercept your Android traffic.

  1. Start Fiddler Classic
  2. Select: Tools - Options
  3. Tab: ‘Https’
  • Enable: ‘Capture HTTPS CONNECTS’ and Decrypt HTTPS traffic’ (*)
  1. Tab: ‘Connections’
  • Enable: Allow remote computers to connect

(*) Install a Root certificate if required.

Then you’ll need to know your IP for configuring it later. Use the command ‘ipconfig’ in a CMD or terminal window.

Configure Android to use your proxy

2 things are required todo:

  1. Configure the Wifi to the same network as the proxy and default it to use the proxy.
  2. Install the root certificate from Windows
Configure Android WIFI
  1. Go to your open wifi connections
  2. Connect to the same WIFI as your Windows Proxy
  3. Go to the settings of the WIFI network
  4. Click ‘More’ and fill in the Proxy fields:
  • Method: Manual
  • Proxy host name: {windows IP}
  • Port: 8888 ( the default in Fiddler)
Install the root certificate
  1. Open the browser
  2. Navigate to: ‘http://{windows-ip}:8888 Download the certificate.

Note: It’s not possible to install a certificate from a browser directly. So we’ll add a certificate through the android certificate store.

  1. Go to ‘Android Settings’
  2. Depending on your device, search for ‘User Certificates’ or ‘Certificates’
  3. ‘Install from device storage’
  4. Look for the downloads folder and install the certificate

Done

Now that the proxy is setup and the certificates are installed. You’ll need to restart the required android app ( if applicable) and you should see the network traffic in Fiddler on Windows.

See also

g