NMAP, also known as Network Mapper, is a free and open-source tool used for network discovery and security auditing. NMAP gathers information about hosts and services available on a network and can generate reports in different formats, which are useful for network inventory, managing service upgrade schedules, and monitoring host or service uptime.
After running an NMAP scan, you can generate a report in three formats: Normal, XML, and Grep-friendly.
The Normal output format is the default and writes to standard output. It tries to present the output in a friendly format like:
```
Nmap scan report for 192.168.1.1
Host is up (0.00083s latency).
Not shown: 993 closed ports
PORT STATE SERVICE
22/tcp open ssh
80/tcp open http
443/tcp open https
3389/tcp open ms-wbt-server
```
You can save the normal output in a file using the “-oN” option followed by the file name:
```
nmap -oN outputfile.txt target
```
The XML format is machine-friendly. It allows you to parse results with XML processors. The XML output option is activated by “-oX”:
```
nmap -oX outputfile.xml target
```
The Grep output is a text format similar to the interactive one but is more grep-friendly. It presents the results in a format more suitable for processing by UNIX tools. This option is activated by “-oG”:
```
nmap -oG outputfile.gnmap target
```
Moreover, you can get all three reports simultaneously using -oA option:
```
nmap -oA outputfile target
```
There is also an option to format the results in HTML using xsltproc tool that converts XML output into readable HTML report:
```
xsltproc outputfile.xml -o outputfile.html
```
For an in depth overview of generating reports after NMAP analysis, you might refer to these resources:
1. “Nmap Network Scanning: The Official Nmap Project Guide to Network Discovery and Security Scanning” by Gordon Lyon, the Original creator of Nmap.
2. The official website of Nmap (nmap.org) has extensive documentation and examples.
3. “Mastering Nmap Scripting Engine” by Paulino Calderon demonstrates developing scripts for NMAP’s Scripting Engine to perform network scans.
Keep it in mind that whilst Nmap is a powerful tool, it should be used responsibly, and you should always have permission to scan the network.
Sources:
1. Lyon, G. F. (2009). Nmap network scanning: the official Nmap project guide to network discovery and security scanning. Insecure.Com LLC.
2. Official Nmap Documentation from nmap.org
3. Calderon, P. (2015). Mastering the Nmap Scripting Engine. Packt Publishing Ltd.
4. SANS Institute Reading room: Generating HTML with xsltproc (https://www.sans.org/reading-room/whitepapers/tools/paper/34455)