News for hackers. Stuff that matters.
Re:Httptap: View HTTP/HTTPS requests made by any Linux program by adtac on Monday February 03, 2025 @04:58PM (#42923824)
How would hooking on write(2) solve TLS? You'll be able to read and modify the ciphertext, but the process will never call write(2) with the plaintext bytes, so you can't actually read the HTTP request. You'll just see the encrypted bytes that go on the wire, but so does the NSA :)

You need the kind of CA certificate trick that httptap uses. It comes with its own set of caveats (e.g. certificate pinning), but it can be made to work reliably in most practical scenarios.

I've spent an unjustifiable amount of time thinking about this specific problem building Subtrace [1], so I'm genuinely very interested in a simpler / more elegant approach.

[1] https://github.com/subtrace/subtrace

Re:Httptap: View HTTP/HTTPS requests made by any Linux program by jeroenhd on Tuesday February 04, 2025 @03:49AM (#42929856)
I believe that's how https://github.com/gojue/ecapture works. I don't know the details, but it seems to work!
Re:Httptap: View HTTP/HTTPS requests made by any Linux program by ddelnano on Tuesday February 04, 2025 @10:24AM (#42933483)
Yep, that's correct. It uses eBPF upprobes to attach to the SSL_write/SSL_read functions.
Re:Httptap: View HTTP/HTTPS requests made by any Linux program by ranger_danger on Tuesday February 04, 2025 @09:26AM (#42932717)
My understanding is that typically a TLS library provides a socket interface for the application to write() to, which can be intercepted by an eBPF program.