Xavier Olive research teaching python blog til cli

Alternatives to telnet or netcat

2 November 2021

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://
➜ bash -c "cat < /dev/tcp/"  # 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.