Listing open ports on a target
This recipe describes how to use Nmap to determine the port states of a target, a process used to identify running services commonly referred to as port scanning. This is one of the tasks Nmap excels at, so it is important to learn about the essential Nmap options related to port scanning.
How to do it...
To launch a default scan, the bare minimum you need is a target. A target can be an IP address, a hostname, or a network range:
$ nmap scanme.nmap.org
The scan results will show all the host information obtained, such as the IPv4 (and IPv6 if available) address, reverse DNS name, and interesting ports with service names. All listed ports have a state. Ports marked as open or filtered are of special interest as they represent services running on the target host:
Nmap scan report for scanme.nmap.org (45.33.32.156) Host is up (0.16s latency). Other addresses for scanme.nmap.org (not scanned): 2600:3c01::f03c:91ff:fe18:bb2f Not shown: 995...