Alternatives to telnet or netcat
When nothing is available on a machine where you don’t have access and you want to test open ports on a local or remote machine, more basic commands like curl
or cat
can help:
➜ curl -v telnet://127.0.0.1:22
➜ bash -c "cat < /dev/tcp/127.0.0.1/22" # Bash only!
SSH-2.0-OpenSSH_8.2p1 Ubuntu-4ubuntu0.3
Note the second command only works with Bash, the kernels only gives access to /proc/net/{tcp,udp}
but without this cat
capability.