Importing scan results

Alternatively, we can also use a third-party tool to perform enumeration. Then, the result from the tool can be imported into MSF. Follow these steps to import the scan result:

  1. It's always better to perform a port scan and service enumeration before performing exploitation via Metasploit. Instead of using the built-in port scanner for Metasploit, you can use Nmap separately and save the scanning result in XML format using the -oX switch:

  1. Just like the db_import command that was used in msfconsole, you can use the same feature in the Metasploit web interface by clicking on the Import button:

  1. On clicking the Import button, you'll be redirected to the Import Data page, where you'll be given the option to import your data.
  2. You can import data from Nexpose, Sonar (Project Sonar is a security research project by Rapid7 that conducts internet-wide surveys across different services and protocols to gain insights into global exposure to common vulnerabilities) and supported files from third-party scanning tools such as Acunetix, Nessus, Nmap, and many more. In this case, we performed a full port scan and saved the Nmap result in XML format:

  1. As an optional feature, you can enable Automatic Tagging, which will tag the hosts as os_windows, os_linux, and os_unknown, based on their OS. When you click Import Data, the scan will be imported:

  1. You can go back to the Project Overview menu to see the updated project space:

  1. As shown in the preceding screenshot, a new host was added with 15 services running on it. On clicking the 15 services detected hyperlink, you will see that the Services page is displayed.
  2. You can view the same page by clicking on Project menu -> [WORKSPACE] -> Services:

In the next section, you will be introduced to the Metasploit modules, which will be used for further enumeration and exploitation of the target host.

Note: The following are all the supported third-party scan reports that can be imported:  Foundstone Network Inventory XML, Microsoft MBSA SecScan XML, nCircle IP360 XMLv3 and ASPL, NetSparker XML, Nessus NBE, Nessus XML v1 and v2, Qualys Asset XML, Qualys Scan XML, Burp Sessions XML, Burp Issues XML, Acunetix XML, AppScan XML, Nmap XML, Retina XML, Amap Log, Critical Watch VM XML, IP Address List, Libpcap Network Capture, Spiceworks Inventory Summary CSV,  and  Core Impact XML.