Skip to content

Instantly share code, notes, and snippets.

@khapota
Created February 13, 2015 02:17
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save khapota/1058b8ad6a1d0f99ba80 to your computer and use it in GitHub Desktop.
Save khapota/1058b8ad6a1d0f99ba80 to your computer and use it in GitHub Desktop.
/etc/pf.anchors/mitm
rdr pass on en0 inet proto tcp to any port 80 -> 127.0.0.1 port 8080
rdr pass on en0 inet proto tcp to any port 443 -> 127.0.0.1 port 8080
@khapota
Copy link
Author

khapota commented Jun 6, 2017

Reload by: sudo pfctl -ef /etc/pf.anchors/mitm

@khapota
Copy link
Author

khapota commented Jun 6, 2017

Other way:

echo "
rdr pass inet proto tcp from any to any port 80 -> 127.0.0.1 port 8080
" | sudo pfctl -ef -

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment