Saving Nmap Scan Outputs

Learn how to save Nmap scan results and export them as XML and text.

To understand how scanning works, we’ll perform simplified versions of Nmap scans. But in the real world, scanning takes a while. If we try to scan all the 65,000+ ports of a single server, it’ll take us a minimum of 30 minutes to finish the scan. And when we scan a network of computers, it’ll only increase the overall scan time.

In addition to the time delays, network audits might take a few days or even weeks. So, it’s a waste of time to perform the same scans multiple times. To help with this, Nmap offers a few options to save the results. Let’s see how these work.

Saving scan results

We can save any Nmap scan result using the -o command. We can save the result as XML or text. Let’s look at each one of them.

Normal result (text)

We can use the -oN flag to save the output as a text file. This will give us the exact scan results saved in a .txt file. Here’s the command to save the result as a text file.

Get hands-on with 1200+ tech skills courses.