List scan types with nmap -s*
In this step, you will explore how to list the available scan types in nmap
using the -s*
option. This option, combined with wildcard characters, allows you to quickly filter and identify scan types supported by nmap
. Understanding scan types is essential for choosing the appropriate technique for your network assessment goals.
Open the terminal in your LabEx VM. If you closed it after the previous step, you can find the terminal icon on the Xfce desktop. Now, type the following command and press Enter:
nmap -s*
This command will likely result in an error message from nmap
. This is because -s*
by itself is not a valid command. The -s
option in nmap
is used to specify a scan type, and it requires a specific scan type identifier (e.g., -sS
for TCP SYN scan, -sU
for UDP scan). The *
wildcard character is interpreted by the shell before being passed to nmap
. Since there's no valid scan type that is literally named "*", nmap
will complain.
However, we can use the output of nmap --help
from the previous step and grep
to filter for lines that describe scan types. Scan types are usually listed with the -s
option.
To list the scan types, we can use the following command, which combines nmap --help
with grep
:
nmap --help | grep " -s[A-Z]"
This command first executes nmap --help
and then pipes the output to the grep
command. The grep
command filters the output, searching for lines that contain " -s" followed by an uppercase letter. This pattern is commonly used to list the different scan types available in nmap
.
Example output:
-sL: List Scan - simply list targets to scan
-sS/sT/sA/sW/sM: TCP SYN/Connect()/ACK/Window/Maimon scans
-sU: UDP Scan
-sN/sF/sX: TCP Null, FIN, and Xmas scans
-sI <zombie host[:probeport]>: Idle scan
-sY/sZ: SCTP INIT/COOKIE-ECHO scans
-sO: IP protocol scan
-sV: Probe open ports to determine service/version info
-sC: equivalent to --script=default
The output shows a list of scan types, such as TCP SYN scan (-sS
), TCP Connect scan (-sT
), UDP scan (-sU
), and others. Each scan type uses a different technique to probe the target system and gather information.
This step demonstrated how to use grep
to filter the output of nmap --help
and list the available scan types. In the following steps, you will explore other useful nmap
options.