Monday, December 29, 2014

Test if a port on a remote system is reachable (without telnet)


  • Netcat is a useful tool:

  • nc 127.0.0.1 123 < /dev/null; echo $?
  • Nice and verbose

           Single port:
  • nc -zv 127.0.0.1 80
    
    Multiple ports:
    nc -zv 127.0.0.1 22 80 8080
    
    Range of ports:
    nc -zv 127.0.0.1 20-30