Live data from Hacker News

Httptap: View HTTP/HTTPS requests made by any Linux program

github.com

21–30 of 148 posts

Re: Httptap: View HTTP/HTTPS requests made by any Linux program

#21

httptap is a process-scoped http tracer that you can run without root priveleges. You can run `httptap ` where is a linux program and you get a trace of http/https requests and responses in standard output: httptap -- python -c "import requests; requests.get('https://monasticacademy.org')" ---> GET https://monasticacademy.org/ GET https://www.monasticacademy.org/ It works by running in an isolated network namespace.…

Do you know if it's possible to get this working on macos? I believe Tailscale uses gvisor's tcp/ip lib (as their netstack lib) on macos for certain things.

Re: Httptap: View HTTP/HTTPS requests made by any Linux program

#22
post #20

Using a TUN device for this is a really cool idea! And the "How it was made" section is one of the best things I've read in a Github README. I'm building something called Subtrace [1] but it can intercept both incoming and outgoing requests automatically. Looks like we converged on the same interface for starting the program too lol [2]. Subtrace's purpose is kinda different from httptap's though (more observability…

Reminds me of NetGuard, which uses Android's VPN service (instead of raw TUN) for packet filtering. https://github.com/M66B/NetGuard

Re: Httptap: View HTTP/HTTPS requests made by any Linux program

#24
Another tool that can be used by an unprivileged user for analysing network traffic is rootless Podman with Pasta.

Just add the podman run option

--network=pasta:--pcap,myfile.pcap

Pasta then records the network traffic into a PCAP file that could later be analysed.

I wrote a simple example where I used tshark to analyse the recorded PCAP file https://github.com/eriksjolund/podman-networking-docs?tab=re...

Re: Httptap: View HTTP/HTTPS requests made by any Linux program

#25

httptap is a process-scoped http tracer that you can run without root priveleges. You can run `httptap ` where is a linux program and you get a trace of http/https requests and responses in standard output: httptap -- python -c "import requests; requests.get('https://monasticacademy.org')" ---> GET https://monasticacademy.org/ GET https://www.monasticacademy.org/ It works by running in an isolated network namespace.…

can it modify requests or responses? with the current web getting increasingly user-hostile a need for tool like this was never more apparent especially if it doesn't require proxy configuration

You might find mitmproxy useful.

Re: Httptap: View HTTP/HTTPS requests made by any Linux program

#26

Why not use eBPF instead? Then you could see all http requests from all processes at once, including ones that are already running. Plus you wouldn't need to bother with TLS at all, just hook on e.g. write(2).

Wouldn't this require root? A big "selling point" of httptap seems to be that precisely it doesn't require root.

Anyway the more options we have, the better.

Re: Httptap: View HTTP/HTTPS requests made by any Linux program

#28

Why not use eBPF instead? Then you could see all http requests from all processes at once, including ones that are already running. Plus you wouldn't need to bother with TLS at all, just hook on e.g. write(2).

Presumably eBPF requires root privs?

Re: Httptap: View HTTP/HTTPS requests made by any Linux program

#29
post #20

Using a TUN device for this is a really cool idea! And the "How it was made" section is one of the best things I've read in a Github README. I'm building something called Subtrace [1] but it can intercept both incoming and outgoing requests automatically. Looks like we converged on the same interface for starting the program too lol [2]. Subtrace's purpose is kinda different from httptap's though (more observability…

Super cool! Connecting what you capture to Chrome DevTools is fascinating, as is using eBPF. Great work getting the devtools to run as a standalone web app. You won't believe it but I have a half-finished attempt of the same thing for the firefox network tab - in the "networktab" dir of the repo!

Very cool project, would love to learn more and happy to chat more about it.

Re: Httptap: View HTTP/HTTPS requests made by any Linux program

#30
post #22
post #20

Using a TUN device for this is a really cool idea! And the "How it was made" section is one of the best things I've read in a Github README. I'm building something called Subtrace [1] but it can intercept both incoming and outgoing requests automatically. Looks like we converged on the same interface for starting the program too lol [2]. Subtrace's purpose is kinda different from httptap's though (more observability…

Reminds me of NetGuard, which uses Android's VPN service (instead of raw TUN) for packet filtering. https://github.com/M66B/NetGuard

Wow, did not know about this!
Post reply on HN