Last active
March 31, 2022 10:34
-
-
Save frafra/6456939f7038f35b12d4221f1d720eb8 to your computer and use it in GitHub Desktop.
mitmproxy snippets and examples
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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