droe / sslsplit

Transparent SSL/TLS interception
https://www.roe.ch/SSLsplit
BSD 2-Clause "Simplified" License
1.73k stars 327 forks source link

intercept localhost traffic #316

Open GuinGuinGuin opened 1 year ago

GuinGuinGuin commented 1 year ago

Hi, I am trying to use sslsplit as a transparent proxy to intercept localhost traffic. I tried to send outgoing traffic (en0) to lo0 and subsequently redirect to sslsplit, but it didn't work. Anyone has any advice?

pf.conf:

scrub-anchor "com.apple/" nat-anchor "com.apple/" rdr-anchor "com.apple/" rdr pass log on lo0 proto tcp from en0 to any port 443 -> 127.0.0.1 port 8080 dummynet-anchor "com.apple/" anchor "com.apple/*" load anchor "com.apple" from "/etc/pf.anchors/com.apple" pass out on en0 route-to lo0 proto tcp from en0 to any port 443 keep state

sslsplit:

sudo sslsplit -D -k ca.key -c ca.crt https 127.0.0.1 8080

sonertari commented 1 year ago

On OpenBSD/pf I'd try the following divert rule:

pass out log quick on en0 proto tcp to port www divert-to lo port 8080

But,