privacy-tech-lab / gpc-android

Code and dynamic analysis scripts for GPC on Android
https://privacytechlab.org/
MIT License
5 stars 1 forks source link

Set up `mitmproxy` #65

Closed kasnder closed 1 year ago

kasnder commented 1 year ago

First do this, then address #64

kasnder commented 1 year ago

Explore Wireguard mode for this: https://docs.mitmproxy.org/stable/concepts-modes/#wireguard-transparent-proxy

kasnder commented 1 year ago

More explanation here: https://mitmproxy.org/posts/wireguard-mode/

n-aggarwal commented 1 year ago

I was able to setup the mitmproxy with WireGuard to intercept the network traffic from android. To do so:

  1. The user must first download the WireGuard app on the Phone through play store.
  2. Next, run the command mitmweb --mode wireguard in the terminal (on your computer) . Note this step assumes that mitmproxy has been installed and configured correctly on the users device.
  3. Now a new tab should open in your browser; this will contain a QR code. Scan the QR code using the WireGuard app you installed on your phone and save it.
  4. Now you can turn on this vpn tunnel in the WireGuard app, and all the traffic should be intercepted!

Note: I also had the mitmproxy certificate installed on my phone. If the above steps cause encryption/decryption errors that might be the issue. Make sure the certificate is of type .crt before installing it on Android.

Also, make sure that computer with mitmproxy and the android phone are both connected to the same network. If that is not the case, then mitm will not work.