ericpaulbishop / gargoyle

Gargoyle Router Management Utility
http://www.gargoyle-router.com
468 stars 221 forks source link

Add basic HTTPS sniffing capability to Gargoyle #725

Closed lantis1008 closed 6 years ago

lantis1008 commented 6 years ago

** This is achieved by leveraging the Server Name Indication (SNI) extension of the TLS1.2 standard in HTTPS authentication. The host name (e.g. example.com) is served in the clear in the packet so that the server knows which certificate to send back to the client. The path (e.g. /foo.html) is only sent once the transmission is fully encrypted. That is to say, we can only match the domain of HTTPS traffic. SNI is supported by all major browsers and has been gaining proliferation since the mid 2000's.

lantis1008 commented 6 years ago

@ericpaulbishop Am i crazy, or is there a missing REJECT statement here matching against 0xFF000000/0xFF000000: https://github.com/ericpaulbishop/gargoyle/blob/master/package/gargoyle-firewall-util/src/make_iptables_rules.c#L547 I'm not sure if the REJECT statement would replace 547 or just be inserted before. I think you still need 547

I think this is the missing piece of the puzzle to getting this module finished. I'm only just beginning to understand how all of the Gargoyle chains run together (thank you for your diagram/explanation).

lantis1008 commented 6 years ago

@ericpaulbishop This is now ready for merge. As to my previous comment, after testing i have concluded i am correct. Or at least, the behaviour is correct after adding in the proposed fix.

ericpaulbishop commented 6 years ago

Matching the domain on the (cleartext) SSL certificate is really clever -- I like that a lot. My thought is that we would handle the problem by matching DNS requests (and we may still add that at some point to block other types of traffic), but this is better in that it preserves the exact same functionality as before.