Skip to content

Scripts to force an Android app to route all its traffic through Burp Suite by applying per-app or global proxy rules using iptables.

Notifications You must be signed in to change notification settings

patarisac/android_proxy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

android_proxy

Scripts to force an Android app to route all its traffic through Burp Suite by applying per-app or global proxy rules using iptables.

Files

  • android_proxy.sh : enable proxy for a specific app or globally
  • android_unproxy.sh : remove the proxy and restore normal routing

Requirements

  • Android device or AVD must be rooted
  • Android device must be on the same network as the host (laptop/PC running Burp Suite)

Tested

  • Android Emulator (AVD) up to Android 15
  • Physical Android device up to Android 14

This approach should work on all (rooted) Android versions that support iptables.

Setup

chmod +x android_proxy.sh android_unproxy.sh

Usage

Enable proxy (specific app):

./android_proxy.sh -u <package_id> -p <burp_port>

Disable proxy (specific app):

./android_unproxy.sh -u <package_id> -p <burp_port>

Enable proxy (all Android traffic):

./android_proxy.sh -p <burp_port>

Disable proxy (all Android traffic):

./android_unproxy.sh -p <burp_port>

Example

./android_proxy.sh -u com.example.app -p 8083 # route all com.example.app traffic to host's 8083 port
./android_unproxy.sh -u com.example.app -p 8083 # undo

./android_proxy.sh -p 8083 # route all Android apps' traffic to host's 8083 port
./android_unproxy.sh -p 8083 # undo

Notes

  • This script modifies iptables rules on the device. Network connectivity may break if rules are not reverted properly.
  • All modifications are temporary and will be automatically cleared after the Android device reboots.
  • Always run android_unproxy.sh after testing to restore the original network state without rebooting.

About

Scripts to force an Android app to route all its traffic through Burp Suite by applying per-app or global proxy rules using iptables.

Topics

Resources

Stars

Watchers

Forks

Languages