Skip to content

Instantly share code, notes, and snippets.

@MrCoder
Last active January 27, 2021 05:03
Show Gist options
  • Save MrCoder/4a50c4aa37a85bcde7d5a72894c1455d to your computer and use it in GitHub Desktop.
Save MrCoder/4a50c4aa37a85bcde7d5a72894c1455d to your computer and use it in GitHub Desktop.
Test remote port with and without telnet
# bash: It requires no other tools
# cat < /dev/tcp/host/port or cat < /dev/udp/host/port
$ cat < /dev/tcp/127.0.0.1/22
SSH-2.0-OpenSSH_5.3
# telnet: telnet host port
$ telnet 127.0.0.1 22
# nc: nc -zv host port1 port2 or port3-port4
$ nc -zv 127.0.0.1 22
Connection to 127.0.0.1 22 port [tcp/ssh] succeeded!
# curl: curl host:port
$ curl localhost:22
SSH-2.0-OpenSSH_5.3
Protocol mismatch.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment