GNU/Linux Desktop Survival Guide
by Graham Williams |
|||||
Port Listening |
To list hosts on the local network (e.g., 192.168.178.0/24
)
listening to particular ports (e.g., the secure shell port which is
port number 22) we can use nmap. In the example here each
host found in the specified IP address range reports the latency and
the open port, checking just the port specified. Five hosts are
identified each with an open port 22.
$ nmap --open -p T:22 192.168.178.0/24 Starting Nmap 7.60 ( https://nmap.org ) at 2019-11-21 21:09 AEDT Nmap scan report for tenh (192.168.178.83) Host is up (0.0015s latency). PORT STATE SERVICE 22/tcp open ssh Nmap scan report for nuho (192.168.178.84) Host is up (0.079s latency). PORT STATE SERVICE 22/tcp open ssh Nmap scan report for yogh (192.168.178.90) Host is up (0.00018s latency). PORT STATE SERVICE 22/tcp open ssh Nmap scan report for yoghe (192.168.178.91) Host is up (0.000092s latency). PORT STATE SERVICE 22/tcp open ssh Nmap scan report for olia (192.168.178.92) Host is up (0.073s latency). PORT STATE SERVICE 22/tcp open ssh Nmap done: 256 IP addresses (12 hosts up) scanned in 4.66 seconds |