MITM: Sniffování HTTPS

Pro sniffování HTTPS komunikace se hodí program Charles Proxy.

Jeho kořenový certifikát je potřeba dostat do emulátoru mezi uznávané certifikáty, což se provede pomocí změny system.img romky. Postup funguje u verze 2.2, u verze 4.0 jsem nedošel do cíle, ale jít by to mělo taky.

Stručný postup:

  1. Make sure your android instance's sdcard partition is large enough to hold the entire /system (its ~100M) 200M will do.
  2. Pull out the cacerts.bks file
  3. Add the certificate to it
  4. Push it back
  5. Make it persistent (so it works when the instance reboots)

Pozn: xda22 je jméno emulátoru.

Podrobně:

nastavení charles proxy

HOST - Machine running Charles and hosting the proxy CLIENT – User’s machine generating the traffic you will capture

Host Machine

  1. Proxy → Proxy Settings → check “Enable Transparent HTTP Proxying”
  2. Proxy → Proxy Settings → SSL TAB → check “enable SSL Proxying”
  3. Proxy → Proxy Settings → SSL TAB → click Add button and input * in both fields
  4. Proxy → Access Control Settings → Add your local subnet (ex: 192.168.2.0/24) to authorize all machines on your local network to use the proxy from another machine
  5. It might be advisable to set up the “auto save tool” in charles, this will auto save and rotate the charles logs. http://www.charlesproxy.com/documentation/tools/auto-save/

Client Machine:

  1. Install and permanently accept/trust the charles SSL certificate http://www.charlesproxy.com/documentation/using-charles/ssl-certificates/

zdroj: