Identifying Nmap SYN Stealth Scan Flags
Short answer
B The -sS flag initiates a SYN stealth scan, and -p- directs Nmap to probe all 65,535 TCP ports on the target subnet.
Question
nmap -sS -p- -T4 192.168.1.0/24. What type of scan is being performed?Key Takeaways
The -sS flag in Nmap configures a SYN stealth scan, while -p- expands the scope to all 65,535 ports. This combination distinguishes the technique from TCP connect scans (-sT) or UDP scans (-sU) in reconnaissance phases.
Expert Analysis
The
-sSflag specifies a SYN stealth scan (also known as half-open scan), which sends SYN packets and analyzes responses without completing the TCP three-way handshake. The-p-flag means scan all 65,535 ports. This is a common stealth scanning technique.
To determine the correct classification of this Nmap command, we must dissect each flag provided in the scenario: nmap -sS -p- -T4 192.168.1.0/24. The core of the question rests on identifying the scan type dictated by the protocol behavior specified by -sS, while the other flags define the scope and speed of that action.
The option B correctly identifies this as a SYN stealth scan on all ports. The decisive factor here is the -sS flag. In Nmap syntax, -sS explicitly triggers a TCP SYN scan. Unlike a standard connection attempt, this method sends a SYN packet to the target port. If the target responds with a SYN-ACK, the scanner knows the port is open but does not complete the handshake by sending an ACK; instead, it sends a RST packet to tear down the connection immediately. This prevents the service from logging the full connection, making it "stealthy" compared to a full connect scan. The second critical component is -p-. In Nmap, specifying ports usually involves listing ranges (e.g., -p 1-1000). However, the hyphen alone (-p-) is a shorthand directive that instructs Nmap to scan every single valid TCP port, ranging from 1 to 65,535. Therefore, combining -sS and -p- results in a SYN stealth scan across the entire port spectrum, which matches Option B perfectly.
Let us analyze why the remaining options are incorrect based on these specific flags:
Option A suggests a TCP connect scan. This would require the -sT flag. A TCP connect scan completes the full three-way handshake (SYN, SYN-ACK, ACK) for every port checked. It is less stealthy because the operating system's network stack logs the full connection. Since the command uses -sS, not -sT, this option is invalid. Furthermore, even if the scan type were misidentified, the port range definition remains the same, but the fundamental mechanism described in A contradicts the -sS instruction.
Option C proposes a UDP scan on common ports. This is incorrect on two counts. First, UDP scanning in Nmap requires the -sU flag. The command in the scenario uses -sS, which targets TCP. Second, scanning "common ports" typically implies omitting the -p flag entirely or using a default list, whereas -p- explicitly forces a scan of all ports, not just the well-known or common ones. There is no -sU flag present, so no UDP activity is initiated.
Option D claims a Version detection scan on all ports. Version detection is enabled via the -sV flag. While version detection can be combined with other scan types (e.g., nmap -sSV), the base scan type defined by -sS remains a SYN scan. The presence of -T4 affects timing templates (setting a moderate-aggressive speed), but it does not change the protocol interaction from SYN to version probing. Without -sV, Nmap will not attempt to identify software versions, only port states. Thus, describing this primarily as a version detection scan is factually wrong regarding the active flags.
The -T4 flag is a timing parameter that sets the template to "aggressive," speeding up the scan by reducing wait times and increasing parallelism. While it influences performance, it does not alter the fundamental nature of the scan (SYN vs Connect vs UDP). The target 192.168.1.0/24 indicates a subnet sweep, meaning this command applies the SYN-all-port logic to every IP in that local network segment. The key takeaway for certification exams is recognizing that -sS equals SYN stealth and -p- equals all ports. Misremembering -sS as a full connect or confusing it with -sU leads directly to distractors A and C. Understanding that -sV is required for version detection eliminates D. This precise mapping of flags to behaviors is essential for accurate reconnaissance analysis in penetration testing scenarios.
Exam Strategy
When analyzing Nmap commands in exam scenarios, isolate the scan type flag first (e.g., -sS for SYN, -sT for Connect, -sU for UDP) before evaluating port ranges or timing. Memorize that -p- specifically means 'all ports' rather than a default set. If version detection is mentioned, look strictly for the -sV flag; its absence means the scan is focused purely on port state discovery, not service fingerprinting.
Related Analysis
Practice All PT0-003 Questions
Access 120 questions with complete answers and detailed explanations.
View Full PT0-003 Practice Test →