Friday, July 5, 2013

using telnet to check multiple network ports

بسم الله

There might be "smarter" ways to do check multiple open port on the other side but sometime we don't have access to cool tools. Thus we a left with the ol' good "telnet" :) . The following kung-fu requires the shell ability to loop it self. The gist of the trick is actually to terminate the telnet session by piping "exit" :)

In the following example I want to check whether port 22, 80 and 2017 are accessable at server 10.11.12.13



for i in 22 80 2017 30216; do echo; echo $i; echo quit |  telnet 10.11.12.13 $i; sleep 1; done;

No comments:

Post a Comment