CompTIA CySA+ Exam CS0-002: Web Server Vulnerability Assessment using Nmap

Web Server Vulnerability Assessment using Nmap

Question

A security analyst needs to assess the web server versions on a list of hosts to determine which are running a vulnerable version of the software and output that list into an XML file named webserverlist.xml.

The host list is provided in a file named webserverlist.txt.

Which of the following Nmap commands would BEST accomplish this goal?

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D.

B.

The BEST command to assess the web server versions on a list of hosts and output that list into an XML file named webserverlist.xml is option B:

nmap -iL webserverlist.txt -sV -p 443 -oX webserverlist.xml

Here is a detailed explanation of the command:

  • nmap: This is the command that initiates the Nmap tool.
  • -iL webserverlist.txt: This option specifies the input file that contains the list of hosts to scan. In this case, it is webserverlist.txt.
  • -sV: This option enables version detection. With this option, Nmap will attempt to determine the version of the software running on the target hosts. This will help identify which hosts are running a vulnerable version of the web server software.
  • -p 443: This option specifies the port to scan. In this case, it is port 443, which is commonly used for HTTPS web traffic.
  • -oX webserverlist.xml: This option specifies the output file format as XML and specifies the filename to save the output. In this case, it is webserverlist.xml.

Option A is incorrect because the -sC option enables the use of Nmap's default script scan, which is not needed for this specific task. It is better suited for a general security scan that may require running multiple scripts.

Option C is incorrect because the -F option specifies a fast scan mode that does not include version detection. This option is better suited for quickly identifying open ports, but not for determining which versions of web server software are running.

Option D is incorrect because the "--takefile" and "--outputfileasXML" options are not valid Nmap options. Additionally, the "scanports" command is not a valid Nmap command.