Live data from Hacker News

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

github.com

31–40 of 148 posts

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

#31

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...

Very good to know about. But you still have the problem of decrypting TLS traffic.

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

#32

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?

I'm having a hard time coming up with a use case where I want to use a tool like that but I'm also lacking root privileges

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

#33

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

if the program doesn't pin certificates, you should be able to intercept them by telling your machine to trust a certificate authority of your own creation and performing a mitm attack on the process's traffic. if it does do certificate pinning, then it won't trust your home issued cert, and will refuse to send data through your proxy.

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

#34

Earlier quoted context omitted.

Presumably eBPF requires root privs?

I'm having a hard time coming up with a use case where I want to use a tool like that but I'm also lacking root privileges

Inside most production environments. I could use this today inside a Pod that isn't allowed root privs.

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

#36
post #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.

Does Darwin have network namespaces like the Linux kernel does? I get the impression that's an important component of this approach

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

#37
post #19
post #11

Earlier quoted context omitted.

To be honest: This sounds like just another of the many many other yoga/spiritual cults that currently exist all over the western world. EDIT: typos and slight wording changes

There is absolutely nothing in their README to suggest that you are using the word "cult" properly.

Did you visit their website? https://www.monasticacademy.org/

While I cannot judge them outright, their article "Cyborgs Need a Trustworthy Religion" can appear cultist as they try to intertwine technology and religion.

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

#38

Earlier quoted context omitted.

I'm having a hard time coming up with a use case where I want to use a tool like that but I'm also lacking root privileges

Inside most production environments. I could use this today inside a Pod that isn't allowed root privs.

In production environments that won't give you root access, you won't be exec'ing inside of a pod if you aren't an operator or sysadmin.

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

#39
It's a genius idea to run the process in a isolated network namespace!

I'm more interested in the HTTPS part. I see that it sets some common environment variables [1] to instruct the program to use the CA bundle in the temporary directory. This seems to pose a similar issue like all the variants of `http_proxy`: the program may simply choose to ignore the variable.

I see it also mounts an overlay fs for `/etc/resolv.conf` [2]. Does it help if httptap mounts `/etc/ca-certificates` directory with the temporary CA bundle?

[1] https://github.com/monasticacademy/httptap/blob/cb92ee3acfb2...

[2] https://github.com/monasticacademy/httptap/blob/cb92ee3acfb2...

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

#40

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...

Very good to know about. But you still have the problem of decrypting TLS traffic.

I don't know if it's a standard but I believe a lot of tls libraries honor the SSLKEYLOGFILE env-var https://wiki.wireshark.org/TLS#:~:text=and%20curl%20when-,th...
Post reply on HN