CompTIA PenTest+ (PT0-001) — Question 48

A consultant wants to scan all the TCP ports on an identified device. Which of the following Nmap switches will complete this task?

Answer options

Correct answer: A

Explanation

The correct option is A, as the '-p-' switch in Nmap scans all ports from 1 to 65535. Option B is incorrect because '-p ALL' is not a valid Nmap syntax. Option C specifies a range but does not cover all ports, while option D uses an incorrect flag format for specifying ports.