I'm doing some usability testing of a web application and am attempting to debug and record some SSL sessions using mitmproxy
as a transparent proxy and for some reason pf
under Mac OS X Mountain Lion isn't setting up the transparent redirects.
First, I enable forwarding:
sudo sysctl -w net.inet.ip.forwarding=1
Next, I create a simple pf.conf
file with a single line on it:
rdr on {en1, en0} inet proto tcp to any port {80, 443} -> 192.168.1.40 port 3128
Where the 192.168.1.40 is the remote host that is currently running mitmproxy
and en1
and en2
are the main outgoing interfaces on the Mac.
Finally, I start up pf
with the following commands:
sudo pfctl -vf pf.conf
sudo pfctl -e
However, nothing happens. When I list the currently running rules for pf
with pfctl -sr
it doesn't show anything.
I've confirmed that pf
can work on the machine by giving it a dummy rule which blocks all outbound access to port 80 and that works.
Any hints about what else I need to do to enable pf
to redirect web traffic to a transparent proxy on Mac OS X Mountain Lion?