Last active
August 29, 2015 14:26
-
-
Save grimen/84016d8f697767af2a9a to your computer and use it in GitHub Desktop.
$ ./mitmiproxy.sh
This file contains hidden or 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
port = 8085 |
This file contains hidden or 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 -x | |
sudo sysctl -w net.inet.ip.forwarding=1 | |
# sudo sysctl -w net.inet.ip.scopedroute=0 | |
## OSX can't change the net.inet.ip.scopedroute kernel flag in user space so I used: | |
## sudo defaults write "/Library/Preferences/SystemConfiguration/com.apple.Boot" "Kernel Flags" "net.inet.ip.scopedroute=0 | |
## and then rebooted | |
sudo defaults read /Library/Preferences/SystemConfiguration/com.apple.Boot | |
cat > pf.conf << _EOF_ | |
rdr on en0 inet proto tcp to any port 80 -> 127.0.0.1 port 8085 | |
rdr on en0 inet proto tcp to any port 443 -> 127.0.0.1 port 8085 | |
_EOF_ | |
cat pf.conf | |
sudo pfctl -d | |
sudo pfctl -f pf.conf | |
sudo pfctl -e | |
mitmproxy -T --host |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment