Create
Learn
Share

NMAP Output

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

Switch

Question Answer
-oN Example: nmap 192.168.1.1 -oN normal.fileNormal output to the file normal.file
-oX Example: nmap 192.168.1.1 -oX xml.fileXML output to the file xml.file
-oG Example: nmap 192.168.1.1 -oG grep.fileGrepable output to the file grep.file
-oA Example: nmap 192.168.1.1 -oA resultsOutput in the three major formats at once
-oG - Example: nmap 192.168.1.1 -oG -Grepable output to screen. -oN -, -oX - also usable
--append-output Example: nmap 192.168.1.1 -oN file.file --append-outputAppend a scan to a previous scan file
-v Example: nmap 192.168.1.1 -vIncrease the verbosity level (use -vv or more for greater effect)
-d Example: nmap 192.168.1.1 -dIncrease debugging level (use -dd or more for greater effect)
--reason Example: nmap 192.168.1.1 --reasonDisplay the reason a port is in a particular state, same output as -vv
--open Example: nmap 192.168.1.1 --openOnly show open (or possibly open) ports
--packet-trace Example: nmap 192.168.1.1 -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
memorize

Helpful Nmap Output Examples

Question Answer
nmap -p80 -sV -oG - --open 192.168.1.1/24 | 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
memorize