Skip to content

Instantly share code, notes, and snippets.

@takahirom
Last active December 1, 2022 10:54
Show Gist options
  • Save takahirom/e96938e5edbf17f1872d5fe9bbff3ede to your computer and use it in GitHub Desktop.
Save takahirom/e96938e5edbf17f1872d5fe9bbff3ede to your computer and use it in GitHub Desktop.
Setup mitm
# You will need to take full responsibility for your action.
# only once
brew install mitmproxy
ifconfig|grep 192.168 |awk '{print $2}'|xargs -IIPADDRESS adb shell settings put global http_proxy IPADDRESS:8083
mitmweb -p 8083
adb shell am start -a android.intent.action.VIEW -d "http://mitm.it"
# download and install pem
# each time you want to do mitm
ifconfig|grep 192.168 |awk '{print $2}'|xargs -IIPADDRESS adb shell settings put global http_proxy IPADDRESS:8083
mitmweb -p 8083
# reset
adb shell settings delete global http_proxy
adb shell settings delete global global_http_proxy_host
adb shell settings delete global global_http_proxy_port
# it looks like applying this configuration needs reboot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment