- Ping Scan (SN, -sn):
The Ping Scan, also known as a simple network scan, is used for host discovery. It determines if the target hosts are online and reachable by sending ICMP echo requests (ping), TCP SYN/ACK packets, or ARP requests. Ping scans don't perform port scanning, making them relatively fast and stealthy.
- TCP Connect Scan (sT, -sT):
TCP Connect Scan is a basic port scanning technique that attempts to establish a full three-way TCP handshake (SYN, SYN-ACK, ACK) with each target port. If a connection is successfully established, the port is considered open. This scan is easily detected and logged but is widely supported, even in cases where other scan techniques may be blocked.
- SYN Scan (sS, -sS):
Also known as "half-open scan" or "stealth scan," SYN Scan is a faster and stealthier alternative to TCP Connect Scan. It sends a SYN packet to the target port, and if it receives a SYN-ACK packet in response, the port is considered open. However, unlike the TCP Connect Scan, it doesn't complete the handshake by sending the final ACK packet, making it less likely to be detected.
- FIN, NULL, and Xmas Scans (sF, -sF; sN, -sN; sX, -sX):
These scans are designed to bypass some firewall rules and intrusion detection systems. They exploit the behavior of closed ports in response to specific TCP flag combinations. A FIN scan sends a packet with the FIN flag set, while a NULL scan sends a packet with no flags set. An Xmas scan sends a packet with the FIN, URG, and PUSH flags set. If the target port doesn't respond, it's considered open, while a RST response indicates a closed port.
- ACK Scan (sA, -sA):
The ACK Scan is primarily used to map firewall rulesets and determine which ports are filtered or unfiltered. It sends an ACK packet to the target port, and if it receives a RST response, the port is considered unfiltered. However, no response or an ICMP error message suggests that the port is filtered.
- UDP Scan (sU, -sU):
UDP Scan targets the User Datagram Protocol (UDP) and is used for discovering open UDP ports. It sends a UDP packet to the target port. If it receives an ICMP Port Unreachable message, the port is considered closed, while no response or a UDP response indicates an open port. This scan can be slower and less reliable than TCP scans due to the rate-limiting and packet loss nature of the UDP protocol.
- Version Detection Scan (-sV):
The Version Detection Scan aims to identify the software and version running on open ports. It starts by performing a service probe, sending crafted packets to the target port and analyzing the responses. This scan is useful for gathering information about potential vulnerabilities in running services.
- OS Detection Scan (-O):
The OS Detection Scan attempts to identify the target's operating system by analyzing various characteristics of its responses to crafted packets. This information can be useful for understanding the target environment and identifying potential vulnerabilities specific to the OS.
- Script Scan (-sC):
The Script Scan utilizes the Nmap Scripting Engine (NSE) to perform more advanced scanning, such as vulnerability detection, exploitation, and additional data gathering. NSE scripts can be customized or downloaded from the extensive library provided by the Nmap community. By using the -sC flag, Nmap will run the default set of scripts against the target, while specific scripts can be executed using the --script flag followed by the script name or a category.
- IP Protocol Scan (sO, -sO):
The IP Protocol Scan is used to determine which IP protocols (e.g., ICMP, IGMP, TCP, UDP) are supported by the target host. It sends raw IP packets with the target protocol field set to the desired value and analyzes the responses. If an ICMP Protocol Unreachable message is received, the protocol is considered unsupported, while no response or a different response indicates that the protocol is supported.
- SCTP INIT Scan (sY, -sY):
The SCTP (Stream Control Transmission Protocol) INIT Scan targets the SCTP protocol, which is an alternative to TCP and UDP. It sends an SCTP INIT chunk to the target port, and if it receives an INIT-ACK chunk in response, the port is considered open. A packet with an ABORT chunk indicates a closed port. This scan is useful for discovering open SCTP services and their associated applications.
- SCTP COOKIE ECHO Scan (sZ, -sZ):
The SCTP COOKIE ECHO Scan is a stealthier alternative to the SCTP INIT Scan. It sends an SCTP COOKIE ECHO chunk to the target port, and if it receives a COOKIE ACK chunk in response, the port is considered open. An ABORT chunk indicates a closed port. This scan is less likely to be detected, as it doesn't establish a full SCTP association.
- Host Discovery Scan:
Host discovery is the process of identifying live hosts on a network. Nmap uses various techniques for host discovery, including ICMP echo requests, TCP SYN or ACK packets, and ARP requests. By default, Nmap combines these methods to maximize the chances of discovering live hosts. However, you can specify a particular technique using flags like -PE (ICMP Echo), -PS (TCP SYN), -PA (TCP ACK), and -PR (ARP).
These are the most common Nmap scans, each with its unique features and use cases. By understanding their differences and applications, you can choose the best scan type for your specific needs, whether it's host discovery, port scanning, service and OS detection, or vulnerability assessment.
- Idle Scan (sI, -sI):
The Idle Scan, also known as "Zombie Scan," is a stealthy scanning technique that allows attackers to perform port scanning while hiding their IP addresses. It involves using a "zombie" host with a predictable IP ID sequence to send spoofed packets to the target. Based on the zombie's responses, the attacker can infer the state of the target's ports. This scan is challenging to detect and trace back to the attacker but requires finding a suitable zombie host.
- Maimon Scan (sM, -sM):
The Maimon Scan, named after its creator Uriel Maimon, is another stealthy scanning technique that sends a TCP packet with both the FIN and ACK flags set. The assumption is that open ports will ignore the packet, while closed ports will respond with an RST packet. This scan is less popular than other stealth scans like SYN, FIN, NULL, and Xmas scans, but it may be useful in specific scenarios.
- Window Scan (sW, -sW):
The Window Scan is a more advanced and less common TCP scan technique that exploits the TCP window size field in the response packet. When a target system responds to a probe, it includes a window size value, which may be different for open and closed ports. This scan sends an ACK packet to the target port and analyzes the window size value in the RST packet received. If the value is non-zero, the port is considered open, while a zero value indicates a closed port.
- FTP Bounce Scan (b, -b):
The FTP Bounce Scan exploits a vulnerability in some FTP servers that allows proxying of port scanning traffic, effectively using the FTP server to scan other hosts. The attacker sends a PORT command to the FTP server, instructing it to connect to the target and transfer data. If the server complies, it can be used to scan the target system, making it challenging to trace the attacker. However, this technique is less effective today, as most modern FTP servers have fixed this vulnerability.
- IPv6 Scans:
Nmap also supports IPv6 scanning, which is essential for scanning networks using the IPv6 addressing scheme. Most Nmap scan types, including SYN, UDP, and SCTP scans, can be performed over IPv6 using the -6 flag (e.g., -sS -6).
- Reverse DNS Resolution (-R, --resolve-all):
While not a scanning technique, the reverse DNS resolution option in Nmap allows you to gather information about the target hosts by querying their DNS PTR records. This can provide valuable information about the domain names associated with the target IP addresses, which may be helpful in understanding the target environment and planning further attacks.
Hope you enjoyed and found this useful
By: Deluxo