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.
TIL: You can make HTTP requests without curl using Bash /dev/TCP
221–230 of 255 posts
Re: TIL: You can make HTTP requests without curl using Bash /dev/TCP
#222As 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…
You can't do that with HTTP/2 (but thankfully every server still talks HTTP/1). You also can't do that with TLS (and a lot of servers won't talk HTTP other than redirects). openssl s_client instead of telnet might allow you to tunnel text inside TLS, but that feels like a cheating. And many other modern protocols, sadly, prefer binary encoding, which makes it impossible to tinker with it on wire level, not without sp…
You're welcome. Works like netcat plus TLS. Kind of inconvenient though. Hey someone should write tlsnc.
Re: TIL: You can make HTTP requests without curl using Bash /dev/TCP
#223Earlier quoted context omitted.
Interesting. I have never heard kernel modules being regarded as non-linux, not in 30 years of LKM. Further compiling a monolithic Kernel is rather straight forward, in this day it is even possible to find wifi devices that do not require a an on device firmware blob uploaded from the kernel.
I don't know TBH. It's just that if you're going to have a 'pure' designation for a tech, it's going to be pretty strict (as per bash and adding modules). I've never heard of 'pure' linux, but 'pure' bash has a recognised meaning. If someone said 'pure Linux' and it meant the core without loaded modules I wouldn't be shocked. Not sure how useful it would be, though.
That probably wouldn't be a useful distinction because almost every module can be built in
Re: TIL: You can make HTTP requests without curl using Bash /dev/TCP
#224In Plan 9 you did have a real (synthetic) /net, and could do that and more from any program. You could even mount /net from another machine via 9P protocol and have an instant VPN... 9front lets you play with that on Linux. Some Plan 9 like /net things are visible in Go libraries... (Rob Pike legacy)
This is awesome.
Re: TIL: You can make HTTP requests without curl using Bash /dev/TCP
#225It's a TCP client
curl is an HTTP client
I prefer TCP clients to HTTP clients. Simpler, easier to modify, faster to compile
There are many to choose from. For example, I use a modified version of tcploop
For generating HTTP, I use own utilties. This is more flexible than curl. There are some things curl cannot do, even though it has too many options
Re: TIL: You can make HTTP requests without curl using Bash /dev/TCP
#226Why they didn't lock those down by using different creds per client in the computer lab I still don't know. Maybe it was a VAX limitation (at the time)?
Re: TIL: You can make HTTP requests without curl using Bash /dev/TCP
#227Earlier quoted context omitted.
[ Note: Anyone who has been a geek since the 90s, there's nothing you don't already know here ] > most SMTP servers would accept email from anyone anywhere to anyone anywhere (i.e. 'open relay'). to date that claim, I'd say that by the late 90s at least, true open relays ("from anyone to anyone") were still numerous but carried a huge assumption of being part of spam operations (willingly or through ineptitude), and…
The magic for me, to this day in fact, is knowing that mail is essentially anyone on the internet being allowed to write to a mail servers disk. There are rules now, but the concept is still almost intact, random people writing to the servers disk - to be later read by someone
Re: TIL: You can make HTTP requests without curl using Bash /dev/TCP
#228> As it turns out, bash can speak HTTP by itself. No, it can not. Bash lets you open TCP sockets. What you are doing here is trying to speak HTTP yourself, which is fine for testing and debugging, and hella cool for fun to do by hand, but you will shoot yourself in the foot if you try to use this pseudo http client unattended in reality. This toy code does not parse HTTP properly and will break. You could of course w…
it's not that insane. i've been manually typing http requests in since before http/1.1 and the mandatory host header. it is insane to use it for anything serious (also the opposite, implementing webservers in bash), but for quick testing it's pretty great!
Re: TIL: You can make HTTP requests without curl using Bash /dev/TCP
#229Re: TIL: You can make HTTP requests without curl using Bash /dev/TCP
#230As 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…
Cat homework.ps > /dev/lp0