Become an Nmap pro in 30s ππ₯ Nmap is a port scanner, but it does...

Nmap is a port scanner, but it does much more including service/OS detection and even vuln scanning.
By default nmap does a standard TCP SYN scan on the top 1000 ports of host.
$ nmap host
For more verbosity use -v or -vv.
$ nmap -vv host
π
$ nmap hostname
$ nmap 123.123.123.123
$ nmap 123.123.123.1/24
$ nmap 123.123.123.1-255
If you just want to find which hosts are alive, you can perform a ping scan with -sn
$ nmap -sn 123.123.123.1/24
$ nmap -Pn host
To scan a list of hosts from a file, use -iL:
$ nmap -iL ./hosts.txt
TCP SYN (-sS)
UDP (-sU)
Default is SYN. To scan UDP ports use -sU. Other scan types can be useful for stealth or probing firewalls but may sacrifice accuracy or speed.
More about scan types here: nmap.org/book/man-port-β¦
To scan ports 1-5000:
$ nmap -p 1-5000 host
To scan all 65535 ports, you can use -p-
You can also specify a comma separated list with single ports, ranges and specific UDP ports:
$ nmap -p 23,23,25,110,80-90,U:53,1000-2000
$ nmap -sV --version-intensity 9
$ nmap -O host
It also has extensive firewall evasion functionality. I've never used them but they allow you to do some cool things including spoofing the source address.
$ nmap -oA outputfile host
Specific options include:
-oN Normal
-oX XML
-oS scr1pt k1dd13
-oG greppable
Higher speed means less accuracy, and vice versa.
$ nmap -T3 host
Location: <nmap directory>/share/nmap/scripts/*
$ locate *.nse
For example, to check if a host is vulnerable to Eternal Blue, you could run:
$ nmap --script=smb-vuln-cve-2017-7494 host
Some scripts require arguments, you can specify them with --script-args=n1=v1,n2=v2 etc.
$ nmap --script-help=scriptname
To upgrade your scripts to the latest and greatest, just run:
$ nmap --script-updatedb
$ nmap -A host
For a thorough scan of a single host, a decent go-to command is: $ nmap -A -p- -v host
We write blogs and manage social media platforms, specifically for cybersecurity orgs!
hackercontent.com