I am trying to set up a proxy on OSX to intercept traffic. I found that the native way to do it is using pfctl and using a transparent proxy tool like mitmproxy or Burp Suite. Mitmproxy has a chapter in their docs about how to set up the Mac with pfctl and for Burp Suite you can find this instruction. However, none of these are showing traffic in mitmproxy or burp.
My /etc/pf.conf
scrub-anchor "com.apple/*"
nat-anchor "com.apple/*"
rdr-anchor "com.apple/*"
rdr-anchor "forwarding"
dummynet-anchor "com.apple/*"
anchor "com.apple/*"
load anchor "com.apple" from "/etc/pf.anchors/com.apple"
load anchor "forwarding" from "/etc/pf.anchors/forwarding"
and my /etc/pf.anchors/forwarding (en0 is my working wifi adapter)
rdr log (all) on en0 inet proto tcp to any port 80 -> 127.0.0.1 port 8080
rdr log (all) on en0 inet proto tcp to any port 443 -> 127.0.0.1 port 8080
I am also setting
▶ sudo sysctl -w net.inet.ip.forwarding=1
▶ sudo sysctl -w net.inet6.ip6.forwarding=1
and these commands work without throwing an error
▶ sudo pfctl -vnf /etc/pf.conf
▶ sudo pfctl -evf /etc/pf.conf
Here is another related question, but as I am on Sierra, the answer does not apply to me.