Skip to content

Instantly share code, notes, and snippets.

@frafra
Last active March 31, 2022 10:34
Show Gist options
  • Save frafra/6456939f7038f35b12d4221f1d720eb8 to your computer and use it in GitHub Desktop.
Save frafra/6456939f7038f35b12d4221f1d720eb8 to your computer and use it in GitHub Desktop.
mitmproxy snippets and examples
#!/bin/bash -xeu
path="/usr/local/share/ca-certificates/mitmproxy"
mkdir -p "$path"
curl -x mitmproxy:8080 mitm.it/cert/pem > "$path/mitmproxy.crt"
# System
update-ca-certificates
# Java
if $(which keytool &>/dev/null)
then
keytool \
-noprompt -importcert -keystore $JAVA_HOME/jre/lib/security/cacerts -storepass changeit \
-alias mitmproxy -file "$path/mitmproxy.crt"
fi
version: '3.0'
services:
# ...
mitmproxy:
image: mitmproxy/mitmproxy
command: mitmweb --web-host 0.0.0.0 # regular proxy
#command: mitmweb --web-host 0.0.0.0 --mode reverse:https://website.com # reverse mode
ports:
- 8080:8080 # proxy
- 8081:8081 # web interface
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment