Importing Nmap Scan Results Into MSF
Save Nmap Scan results in XML format
┌──(root㉿INE)-[~]
└─# nmap -sV -Pn -oX myscan.xml demo.ine.local
Starting Nmap 7.94SVN ( https://nmap.org ) at 2025-11-13 21:08 IST
Nmap scan report for demo.ine.local (10.5.31.165)
Host is up (0.0019s latency).
Not shown: 993 filtered tcp ports (no-response)
PORT STATE SERVICE VERSION
80/tcp open http HttpFileServer httpd 2.3
135/tcp open msrpc Microsoft Windows RPC
139/tcp open netbios-ssn Microsoft Windows netbios-ssn
445/tcp open microsoft-ds Microsoft Windows Server 2008 R2 - 2012 microsoft-ds
3389/tcp open ssl/ms-wbt-server?
49154/tcp open msrpc Microsoft Windows RPC
49155/tcp open msrpc Microsoft Windows RPC
Service Info: OSs: Windows, Windows Server 2008 R2 - 2012; CPE: cpe:/o:microsoft:windows
Service detection performed. Please report any incorrect results at https://nmap.org/submit/ .
Nmap done: 1 IP address (1 host up) scanned in 71.28 secondsStart postgresql database service
service postgresql startImporting results
Check the db status
msf6 > db_status
[*] Connected to msf. Connection type: postgresql.You can now import the Nmap scan result
msf6 > db_import myscan.xml
[*] Importing 'Nmap XML' data
[*] Import: Parsing with 'Nokogiri v1.13.10'
[*] Importing host 10.5.31.165
[*] Successfully imported /root/myscan.xmlWe can now view the results by running the following commands:
msf6 > hosts
Hosts
=====
address mac name os_name os_flavor os_sp purpose info comments
------- --- ---- ------- --------- ----- ------- ---- --------
10.5.31.165 demo.ine.local Unknown device
msf6 > services
Services
========
host port proto name state info
---- ---- ----- ---- ----- ----
10.5.31.165 80 tcp http open HttpFileServer httpd 2.3
10.5.31.165 135 tcp msrpc open Microsoft Windows RPC
10.5.31.165 139 tcp netbios-ssn open Microsoft Windows netbios-ssn
10.5.31.165 445 tcp microsoft-ds open Microsoft Windows Server 2008 R2 - 2012 microsoft-ds
10.5.31.165 3389 tcp ssl/ms-wbt-server open
10.5.31.165 49154 tcp msrpc open Microsoft Windows RPC
10.5.31.165 49155 tcp msrpc open Microsoft Windows RPCLast updated