Friday, October 13, 2017

How to use Nmap command line

Guide how to use Nmap command line

Nmap (Network Mapper) is the best network scanning tool ever made and it can do much more than just scanning an ip address, nmap has so many parameters that can be use. So i thought i made this separate guide on how to use nmap and explain some parameter it has.

First i'm going to show list of parameters that supported by nmap and what they are for, so you can learn and understand it easily, after that i'm going to show some nmap example command.

Parameter What for?
-sSuse TCP SYN scan
-sTuse TCP connect scan
-sUuse UDP scan
-sYuse SCTP init scan
-sNuse TCP NULL scan
-sFuse FIN scan
-sXuse Xmas scan
-sAuse TCP ACK scan
-sWuse TCP Window scan
-sMuse TCP Maimon scan
-sZuse SCTP Cookie echo scan
-sIuse Zombie host scan
-s0use IP protocol scan
-bFTP relay host ( FTP bounce scan)
-pSpecify port range, this option specifies which ports you want to scan and overrides the default.
-FLimit the port to scan, specifies that you wish to scan fewer ports than the default. Normally Nmap scans the most common 1,000 ports for each scanned protocol. With -F, this is reduced to 100.
-rDon't randomize ports
-sVEnables version detection
-OEnables OS detection
-sCPerforms a script scan using the default set of scripts.
-vverbose mode
-AThis option enables additional advanced and aggressive options
-Vshow nmap version

NOTE: I don't show all parameters because it's too many of them, i only show the most important one.

Nmap sample command

basic scan with nmap:

nmap -v [ip address or hostname]
nmap -v 127.0.0.1
nmap -v google.com

scan network and detecting the operating system:

nmap -O -v [ip address or hostname]
nmap -O -v 127.0.0.1
nmap -O -v google.com
The -O parameter means Operating system, it's the capital letter of o (not a zero).

scan multiple ip address/host:

nmap -v 192.168.0.103 192.168.0.105 192.168.0.106
nmap -v lubuntuhowto.com google.com yahoo.com

scan a whole subnet:

nmap -v 192.168.0.*
nmap -v 10.120.201.*

scan multiple ip address using the last octet of ip address:

nmap -v 192.168.0.103,104,105,106
nmap -v 10.120.201.1,2,23,14,35,56

scan range of ip address:

nmap -v 192.168.0.100-125
nmap -v 10.120.201.1-35

No comments:

Post a Comment