PT0-003 practice question 23 of 30

[Information Gathering and Vulnerability Scanning] A penetration tester needs to launch an Nmap scan to find the state of the port for both TCP and UDP services. Which of the following commands should the tester use?

Full set: 351 questions
Answer options
A: nmap -sU -sW -p 1-65535 example.com
B: nmap -sU -sY -p 1-65535 example.com
C: nmap -sU -sT -p 1-65535 example.com Correct answer
D: nmap -sU -sN -p 1-65535 example.com
Correct Answer:
C. nmap -sU -sT -p 1-65535 example.com
Explanation

The objective is to scan for both TCP and UDP port states. The Nmap command line allows for combining different scan types. The -sU flag is used to specify a UDP scan. The -sT flag specifies a TCP Connect scan, which is a reliable method to determine the state of TCP ports by completing the full three-way handshake. By using both -sU and -sT flags in the same command, the penetration tester instructs Nmap to scan for both UDP and TCP services on the specified port range for the target host, directly fulfilling the requirements of the task.

Why Incorrect

A. nmap -sU -sW -p 1-65535 example.com The -sW (TCP Window scan) is a more specialized scan that is not as universally reliable as a TCP Connect scan for determining port state.
B. nmap -sU -sY -p 1-65535 example.com The -sY flag initiates an SCTP INIT scan. The Stream Control Transmission Protocol (SCTP) is a different transport layer protocol, not TCP as required by the question.
D. nmap -sU -sN -p 1-65535 example.com The -sN (TCP Null scan) is a stealthy scan type. Its effectiveness is dependent on the target's adherence to RFC 793 and may not provide reliable results across all systems. ---

References

1. Nmap Project

Nmap Reference Guide. (2023). Port Scanning Techniques. Nmap.org.

Section: "Scan Types": The guide explicitly states

"UDP scan (-sU) can be combined with a TCP scan type such as SYN scan (-sS) to check both protocols during the same run." This principle applies equally to combining -sU with -sT.

Section: "-sT (TCP connect scan)": This section describes the -sT scan as the default TCP scan when a SYN scan isn't an option and notes its reliability due to using the operating system's network functions to establish a connection.

Section: "-sY (SCTP INIT scan)": This section clarifies that SCTP is "a relatively new alternative to the TCP and UDP protocols

" confirming that -sY does not scan for TCP.

2. Lyon

G. F. (2009). Nmap Network Scanning: The Official Nmap Project Guide to Network Discovery and Security Scanning. Insecure.Com LLC.

Chapter 5

"Port Scanning Techniques and Algorithms": This chapter details the various scan methods. It describes the TCP Connect scan (-sT) as a fundamental and highly reliable technique

while Null (-sN) and Window (-sW) scans are presented as more specialized techniques whose results can be ambiguous depending on the target system's configuration and OS. This supports -sT as the most appropriate general-purpose choice.

Scroll to Top