{:title "Nmap usage" :layout :post :tags "Networking" }
nmap hostname
does a basic TCP SYN scan for the first 1000 ports open on the host, which doesn't show much besides the ports. nmap -sn hostname/24
. /24 tells nmap to scan all the addresses from 192.168.100.0 to 192.168.100.255, or rather 256 hosts on the network. IPv4 addresses are 32 bits, every period signifies a section of an IP address, so the /24 tells nmap to only vary the last 8 bits of an address when scanning.nmap -p 1-65535 localhost
scans every port. You can also write this as nmap -p- localhost
, which produces the same output. You can specify ports using ranges, or with single ports, as shown here: