Using the Nmap Port Flag

We have the port flag (-p) to scan for specific ports. Let’s see how we can use the port flag more effectively to perform scans like single-port scans, multiport scans, wildcard scans, and service scans. We’ll also see how to scan for port ranges instead of a set of individual ports.

Scan a single port

To scan a single port, we can use the port number with the flag. This tells Nmap to scan for one specific port. The results will be much faster for these types of scans compared to our regular scans. Here is the syntax to scan for a single port using Nmap:

Get hands-on with 1200+ tech skills courses.