Intercepting Android HTTP
Intercepting Android HTTP
Intercepting Android HTTP
Intercepting Android
HTTP
Help improve these docs on GitHub
For a quick demo and an outline of how this works, check out
the HTTP Toolkit for Android page, or read on for a detailed
guide.
2. This will take you to Google Play. Install & open the app
from there.
In future, just open the HTTP Toolkit app (or any other
barcode scanner), scan the code shown on your computer,
and interception will start again automatically. You can also
press 'Reconnect', to reuse the previous successful
configuration, which should work as long as the HTTP
Toolkit app is still running on the same port & IP as before.
If you do have running apps that don't trust the CA, you'll see
events in HTTP Toolkit like "Certificate rejected for
<domain>" and "HTTPS setup failed for <domain>". If you
see events like these related to apps you'd like to intercept,
you'll need to either configure those apps to trust user-
installed CA certificates, or use a rooted device or emulator
with ADB-based setup to install a system CA certificate. Each
of these cases are covered in more detail below.
2. Add android:networkSecurityConfig="@xml/network_security_c
onfig" to the <application> element in your application
manifest.
That's it!
You can include this in your config at all times, and it will
work with and without HTTP Toolkit. The only risk is that
your end users will be able to intercept their own HTTPS
traffic from your app, and potentially any users who are
tricked into trusting an attacker's CA could have their traffic
intercepted. For most applications that isn't a major concern.
If you'd like to enable this only for your debug builds, replace
base-config with debug-overrides in the XML above.
builds only).
Genymotion emulators
Any other ADB device where adb shell su or adb root are
available
In some of these cases you won't have the Google Play Store
available, which can be inconvenient for reverse engineering.
To fix that, you can use Open GAPPS to install Google tools
manually, or you can download individual APKs directly,
from sites such like ApkPure or APKMirror.
Once you have the APK, you'll need to edit the application to
trust user certificates and disable any certificate pinning. You
can do this using apk-mitm. Apk-mitm automatically opens
up the APK, makes the network security config
transformations described above, disables most standard
certificate pinning, and rebuilds the application ready to be
reinstalled.
Common Issues
"Android Device via ADB"
interception option is not available
This option is activated only when HTTP Toolkit can access
an ADB server which has at least one successfully connected
Android device attached.
$ adb devices
List of devices attached
<your device name> device
80
443
8000
8001
8080
8888
9000
TCP packets to other ports, all UDP packets, and ICMP ping
packets are sent on as normal, unchanged.
The VPN also remains registered, but inactive. The VPN can
also be removed manually from the device settings, if
necessary, and cannot activate silently. This is enforced by
Android's own VPN system, which kills the VPN service
within seconds if it is ever running without an attached
persistent notification, and also shows a separate key icon
and warning in your notification area whilst any VPN is active
on the device.
ADB interception
ADB interception is managed by the HTTP Toolkit server,
running on your computer as part of the desktop app.
Getting Started
1. Installing
2. Intercepting
3. Inspecting
4. Rewriting
Reference
The Intercept Page
The View Page
The Mock Page
The Settings Page
AmIUsing Test Site
Guides
Android
Docker
iOS
Subscriptions FAQ
Troubleshooting
Terms of Service
Privacy Policy
Comparisons
100% open-source
Dive in at github.com/httptoolkit