Live data from Hacker News

Show HN: Privaxy – Adblocking / tracker blocking by MITMing HTTPS traffic

github.com

31–40 of 63 posts

Re: Show HN: Privaxy – Adblocking / tracker blocking by MITMing HTTPS traffic

#31
I said it before and I will say it again, MITM for ad blocking is not a way forward.

Cert pinning defeats this on 99% of consumer devices and introduces a security hole in the browser by subverting the trust model. Unless the proxy is doing 100% of the same thing the browser is doing, and it isn’t, you are weakening browser security too.

Instrument the endpoint (browser plug-in) or control name resolution (filtering DNS server that uses DoH to prevent upstream filtering).

Re: Show HN: Privaxy – Adblocking / tracker blocking by MITMing HTTPS traffic

#32
post #2

I fear that MITMing ads is a dead end: 1. IIUC, when SNI is encrypted (in TLS 1.3?) almost everything is out the window. 2. Local devices can do DNS over HTTPS (DoH) and DNS over QUIC (DoQ) to look up their stuff, so DNS-based blocking will soon be obsolete. 3. The browser itself is controlled by the biggest ad-vendor around (Google), so you’ll probably get no help there. The only solutions are: A. Use browsers not c…

Run your own DoH filtering DNS server, I set this up a few months ago. DNS blocking is not obsoleted by transport encryption.

How do your force applications to use this server? I mean, even if you MITM the connection to the application’s preferred DoH server, the application probably checks the certificate of the DoH server and refuses to work at all if it can’t get a verified connection.

Re: Show HN: Privaxy – Adblocking / tracker blocking by MITMing HTTPS traffic

#33
post #15

This approach is a natural escalation step as DNS-based blocking is getting increasingly difficult. But it's not without its drawbacks. For example, browsers tend to have by far the best TLS implementations. By MITMing yourself, you essentially trust the proxy's TLS implementation instead, which will receive much less scrutiny. There's a lot of precedent for TLS vulnerabilities introduced by middleboxes. If browser e…

Why is DNS based blocking getting difficult? You run a bind server and tell it what it can and cannot resolve. It can even listen on DoH so you get transport security between peer and local dns server.

Re: Show HN: Privaxy – Adblocking / tracker blocking by MITMing HTTPS traffic

#34
post #32

Earlier quoted context omitted.

Run your own DoH filtering DNS server, I set this up a few months ago. DNS blocking is not obsoleted by transport encryption.

How do your force applications to use this server? I mean, even if you MITM the connection to the application’s preferred DoH server, the application probably checks the certificate of the DoH server and refuses to work at all if it can’t get a verified connection.

You don’t mitm the DoH, you substitute it with your own server.

I have yet to see DNS/DoH “pinning”, and apps (browsers) will let your override it. Embedding DNS entries in apps is a bad idea (as opposed to cert pinning, which is about fixed trust, and a good idea). Given that sometimes this is going to be blocked, even if they did it would fall to the host resolver.

Re: Show HN: Privaxy – Adblocking / tracker blocking by MITMing HTTPS traffic

#35
post #23

What are the potential benefits of a ‘MITM’ approach, compared to other approaches like acting as DNS (like pihole)? Edit: I should have read the About section more carefully: > Privaxy is also way more capable than DNS-based blockers as it is able to operate directly on URLs and to inject resources into web pages. Makes sense. So it potentially has the fine-grained control of a browser-based blocker but also has goo…

It’s been done for years and years but it’s considered a very bad idea these days. MITM https sessions is a trivial problem today. It’s just a bad idea as it breaks the entire trust model of the internet.

Most commercial firewalls for the last decade plus have such features.

Re: Show HN: Privaxy – Adblocking / tracker blocking by MITMing HTTPS traffic

#36

I said it before and I will say it again, MITM for ad blocking is not a way forward. Cert pinning defeats this on 99% of consumer devices and introduces a security hole in the browser by subverting the trust model. Unless the proxy is doing 100% of the same thing the browser is doing, and it isn’t, you are weakening browser security too. Instrument the endpoint (browser plug-in) or control name resolution (filtering…

The problem with browser plug ins is that they only work in browsers. I read most html or other "web pages" in programs other than browsers (mail client, RSS readers, Electron apps, etc)

Re: Show HN: Privaxy – Adblocking / tracker blocking by MITMing HTTPS traffic

#37
post #15

This approach is a natural escalation step as DNS-based blocking is getting increasingly difficult. But it's not without its drawbacks. For example, browsers tend to have by far the best TLS implementations. By MITMing yourself, you essentially trust the proxy's TLS implementation instead, which will receive much less scrutiny. There's a lot of precedent for TLS vulnerabilities introduced by middleboxes. If browser e…

Why is DNS based blocking getting difficult? You run a bind server and tell it what it can and cannot resolve. It can even listen on DoH so you get transport security between peer and local dns server.

Your browser (or your tv) can just skip your entire dns infra and make its own lookups over https- which you won’t see.

That’s the evil genius of doh- you can’t block 443 and their “dns server” could be the same hostname as the site you visit … and now we’re discussing mitm’ing ourselves…

Sigh.

Re: Show HN: Privaxy – Adblocking / tracker blocking by MITMing HTTPS traffic

#38

I said it before and I will say it again, MITM for ad blocking is not a way forward. Cert pinning defeats this on 99% of consumer devices and introduces a security hole in the browser by subverting the trust model. Unless the proxy is doing 100% of the same thing the browser is doing, and it isn’t, you are weakening browser security too. Instrument the endpoint (browser plug-in) or control name resolution (filtering…

It's not about this being some end-all solution, it's about it being an option. Personally, I love it. I used to use Privoxy, back when nothing was encrypted, and it was wonderful. A central place to store all my ad-blocking config that could be connected to at will by most devices on my network. I mostly have that now with DNS blocking, but once ad networks stop putting ads on separate domains, that's done.

Keep in mind that ad-blocking browser plugins aren't exactly secure either. They have access, not only to every network request, but every keystroke, mouse wiggle, etc. And all it takes to all fall down is for whoever is maintaining it to cash out and sell to a bad actor: you'll helpfully be automatically updated to the new, state-owned version.

Re: Show HN: Privaxy – Adblocking / tracker blocking by MITMing HTTPS traffic

#39
post #2

I fear that MITMing ads is a dead end: 1. IIUC, when SNI is encrypted (in TLS 1.3?) almost everything is out the window. 2. Local devices can do DNS over HTTPS (DoH) and DNS over QUIC (DoQ) to look up their stuff, so DNS-based blocking will soon be obsolete. 3. The browser itself is controlled by the biggest ad-vendor around (Google), so you’ll probably get no help there. The only solutions are: A. Use browsers not c…

Run your own DoH filtering DNS server, I set this up a few months ago. DNS blocking is not obsoleted by transport encryption.

Very curious about how you went about this as I would like to do the same.

Re: Show HN: Privaxy – Adblocking / tracker blocking by MITMing HTTPS traffic

#40
post #16
post #2

I fear that MITMing ads is a dead end: 1. IIUC, when SNI is encrypted (in TLS 1.3?) almost everything is out the window. 2. Local devices can do DNS over HTTPS (DoH) and DNS over QUIC (DoQ) to look up their stuff, so DNS-based blocking will soon be obsolete. 3. The browser itself is controlled by the biggest ad-vendor around (Google), so you’ll probably get no help there. The only solutions are: A. Use browsers not c…

I wouldn't write it off - one possible trick here is to also MITM the DoH/DoQ server and disable ECH by removing the relevant records from the DNS response. We've just added DNS support to mitmproxy and this is a natural follow-up. :)

Oh? Do you guys have a blog writeup? I would LOVE to read more about this! I want to eliminate the small amount of ads that make it through my PiHole.
Post reply on HN