Saturday, February 19, 2022

Check if remote port is open

 ref. 

https://www.fosslinux.com/35730/5-ways-to-check-if-a-port-is-open-on-a-remote-linux-pc.htm

$ nc -zvw10 192.168.0.1 22
$ nmap 192.168.0.2 -p 103
$ telnet [IP or Hostname] [PortNumber]
echo > /dev/tcp/[host]/[port] && echo "Port is open"
echo > /dev/udp/[host]/[port] && echo "Port is open"
netstat -tuplen

netstat -tuplen will output the whole list of the IP addresses. The entries that have “Listen” in the “State” column are the open ports.