Import nmap results into Metasploit

It is very helpful to scan your target with nmap and then import the results into Metasploit. All you have to do is scan your target using the -oX option to generate an XML file that will contain the results.

To do this, execute the following command

nmap -Pn -sS -A -oX scan.xml 192.168.1.5

Launch the msfconsole, if you haven’t already, and import the results,

import scan.xml

To verify that the import was succesfull, use the hosts command to list all targeted hosts.

You can also run nmap through msfconsole and have the results automatically stored into database. Run from msfconsole,

db_nmap -Pn -sS -A 192.168.1.5

To verify that the results from the scan are stored in the database, we run

hosts

or

services

Categories: Metasploit, NMAP
%d bloggers like this: