Live data from Hacker News

TIL: You can make HTTP requests without curl using Bash /dev/TCP

mareksuppa.com

121–130 of 255 posts

Re: TIL: You can make HTTP requests without curl using Bash /dev/TCP

#122
post #73

Earlier quoted context omitted.

Last century I would read and send personal email from work using telnet to pop3 and smtp respectively.

perhaps you meant "in previous millennium" ?

If someone referred to the "previous decade" in 2004, would you have said the same thing?

As the calendar rolled from 1999 to 2000, we entered a new millennium, century, decade, year, day, ...

Re: TIL: You can make HTTP requests without curl using Bash /dev/TCP

#123

As a kid in the late 90s my mind was blown when I realized I could telnet to port 80, 25, or 110 and interact with the servers manually. Simple get: GET / HTTP/1.1 Content-Type: text/html User-Agent: l33t hax0rs lol X-Funny-Monkey: farts For sending a mail message on port 25: HELO mail-from: whoever@whatever.com mail-to: sysadmin@yaya.com Body of the message yay. POP3 was so long ago I forgot but you could list the m…

Me too! Writing Winsock and learning WinAPI on XP then Vista. It took me a while to realise Linux was better / OSX was my gateway drug haha

Re: TIL: You can make HTTP requests without curl using Bash /dev/TCP

#125

As a kid in the late 90s my mind was blown when I realized I could telnet to port 80, 25, or 110 and interact with the servers manually. Simple get: GET / HTTP/1.1 Content-Type: text/html User-Agent: l33t hax0rs lol X-Funny-Monkey: farts For sending a mail message on port 25: HELO mail-from: whoever@whatever.com mail-to: sysadmin@yaya.com Body of the message yay. POP3 was so long ago I forgot but you could list the m…

Yep! It’s all just text files. Lots of acronyms in top of lots of ways to generate, send, and read structured text files.

One day I realized even databases were just text files and I had to sit down.

Re: TIL: You can make HTTP requests without curl using Bash /dev/TCP

#126
post #104
post #52

Earlier quoted context omitted.

It's pretty rough to learn I sound like Claude. Will need to do something about it then. (For what it's worth I did write the message above manually but I understand why no one would believe that now. At least I did not call netcat "load-bearing" [ https://mareksuppa.com/til/load-bearing/ ] or something...)

I did not think you sounded like claude. Then I looked again after the comment was made and then I saw some of the vibes. Like acknowledging a mistake you have done. Before that would just made you top 5% (or maybe top 1%) of the nicest people to talk too.. know ppl think you are Claude. We are all going crazy s a sibling comment said.

[deleted]

Re: TIL: You can make HTTP requests without curl using Bash /dev/TCP

#127

As a kid in the late 90s my mind was blown when I realized I could telnet to port 80, 25, or 110 and interact with the servers manually. Simple get: GET / HTTP/1.1 Content-Type: text/html User-Agent: l33t hax0rs lol X-Funny-Monkey: farts For sending a mail message on port 25: HELO mail-from: whoever@whatever.com mail-to: sysadmin@yaya.com Body of the message yay. POP3 was so long ago I forgot but you could list the m…

Back in those days not only was there was no DKIM or SPF, most SMTP servers would accept email from anyone anywhere to anyone anywhere (i.e. 'open relay').

Re: TIL: You can make HTTP requests without curl using Bash /dev/TCP

#129
post #113
post #45

Earlier quoted context omitted.

Sometimes you want to do something that curl cannot express, e.g. timing, protocol oddities, etc. For example you may want to issue a CONNECT to an echo server through a proxy and observe the bytes flowing back and forth. You may want to see what happens when conflicting hop-by-hop headers are specified without worrying about the client's (curl's) interpretation of them. A simple nc -c (or openssl s_client -crlf) let…

For what it's worth curl can do very detailed timing [1] and it can also do this using a proxy export http_proxy=http://your.proxy.server:port/ export HTTPS_PROXY=https://your.proxy.server:port/ curl -x http://proxy_server:proxy_port --proxy-user username:password or $socks-wrapper curl # [2] [1] - https://dev.to/gbhorwood/curl-getting-performance-data-with-... [2] - torsocks, tsocks, wireproxy, shadowsocks-rust, pro…

what I meant was a proxy that implements HTTP/1.1 CONNECT

and a server behind it like

``` mkfifo /tmp/myfifo cat /tmp/myfifo | nc -l 12345 > /tmp/myfifo ```

so if you manually type out

  CONNECT host:12345 HTTP/1.1
  host: host:12345

you can see exactly what's happening. To be fair you can hack curl to support that via

  curl -x proxy:3333 telnet://host:12345
but that's not exactly what you want and requires curl to have been compiled with telnet support.

Re: TIL: You can make HTTP requests without curl using Bash /dev/TCP

#130
post #129
post #113

Earlier quoted context omitted.

For what it's worth curl can do very detailed timing [1] and it can also do this using a proxy export http_proxy=http://your.proxy.server:port/ export HTTPS_PROXY=https://your.proxy.server:port/ curl -x http://proxy_server:proxy_port --proxy-user username:password or $socks-wrapper curl # [2] [1] - https://dev.to/gbhorwood/curl-getting-performance-data-with-... [2] - torsocks, tsocks, wireproxy, shadowsocks-rust, pro…

what I meant was a proxy that implements HTTP/1.1 CONNECT and a server behind it like ``` mkfifo /tmp/myfifo cat /tmp/myfifo | nc -l 12345 > /tmp/myfifo ``` so if you manually type out CONNECT host:12345 HTTP/1.1 host: host:12345 you can see exactly what's happening. To be fair you can hack curl to support that via curl -x proxy:3333 telnet://host:12345 but that's not exactly what you want and requires curl to have b…

Ah, I see what you mean. Aside from putting the proxy into debug logging one would have to use curl -vvv to get similar details but I suppose whatever works best with muscle memory is the right choice and one may not always have access to put the proxy into debug logging.

I need to try this with a Squid SSL Bump MitM proxy just dont have one up at the moment.

    curl -vvv -A Mozilla -H "Accept-Language: en_us" -H "Sec-Fetch-Mode: navigate" --url 'https://nochan.net/.env'
Post reply on HN