NMAP Output

dfredde's version from 2017-10-08 23:20


Question Answer
-oN Example: nmap -oN normal.fileNormal output to the file normal.file
-oX Example: nmap -oX xml.fileXML output to the file xml.file
-oG Example: nmap -oG grep.fileGrepable output to the file grep.file
-oA Example: nmap -oA resultsOutput in the three major formats at once
-oG - Example: nmap -oG -Grepable output to screen. -oN -, -oX - also usable
--append-output Example: nmap -oN file.file --append-outputAppend a scan to a previous scan file
-v Example: nmap -vIncrease the verbosity level (use -vv or more for greater effect)
-d Example: nmap -dIncrease debugging level (use -dd or more for greater effect)
--reason Example: nmap --reasonDisplay the reason a port is in a particular state, same output as -vv
--open Example: nmap --openOnly show open (or possibly open) ports
--packet-trace Example: nmap -T4 --packet-traceShow all packets sent and received
--iflist Example: nmap --iflistShows the host interfaces and route
--resume Example: nmap --resume results.fileResume a scan

Helpful Nmap Output Examples

Question Answer
nmap -p80 -sV -oG - --open | grep openScan for web servers and grep to show which IPs are running web servers
nmap -iR 10 -n -oX out.xml | grep "Nmap" | cut -d " " -f5 > live-hosts.txtGenerate a list of the IPs of live hosts
nmap -iR 10 -n -oX out2.xml | grep "Nmap" | cut -d " " -f5 >> live-hosts.txtAppend IP to the list of live hosts
ndiff scanl.xml scan2.xmlCompare output from nmap using the ndif
xsltproc nmap.xml -o nmap.htmlConvert nmap xml files to html files
grep " open " results.nmap | sed -r 's/ +/ /g' | sort | uniq -c | sort -rn | lessReverse sorted list of how often ports turn up