What is Nmap?
Nmap is an advanced Network scanner tool. This tool is categorized in Kali Linux as an information-gathering tool. Nmap tool is used to scan different kinds of Networks, Ip addresses, domain server,s, etc. As a result, you can get useful information about that Network like port details, OS detection, Host discovery, Network analysis, and many more. Nmap has both CLI and GUI interfaces. Zenmap is the GUI version of Nmap. To open Zenmap, simply go to Application> Information gathering tool> Zenmap. To open the CLI, type Nmap in the terminal.
In this tutorial, we’re gonna cover all the basic and advanced Nmap commands.
Target Specification commands
Let’s start with the target specification command. If you want to scan a single IP address. Simply type the command
nmap ‘target IP address’ (ex: nmap 192.168.43.1)
Or, if you want to scan multiple IP addresses, just type
nmap ‘target ip address’ ‘target ip address’
To scan a range of IP address, type the command
nmap ‘target IP address’ -254
This process will start from 1-254. So, it will take time to complete the scan.
Let’s see how to use the Nmap tool to scan with CIDR notation. Type the command
nmap ‘target ip address’/24
To scan a targeted list of IP addresses.
Open leafpad and create a list of IP addresses. Type the IP addresses one by one and save the list as target.txt.
Now open the Nmap in the terminal and type the command
nmap -iL /‘file path’ (ex: nmap -iL /root/desktop/target.txt)
It will show up the result of each IP address.
Network scanning commands:
Nmap also uses some scan techniques like TCP port scan, UDP port scan, TCP window port scan, etc.
To scan TCP port in default mode. Type the command
nmap ‘target ip address’ -sS (ex: nmap 192.168.43.1 -sS)
This one will show up the scan result of the TCP port.
To scan TCP port without root privilege type the command
nmap ‘target ip address’ -sT
To scan UDP port type the command
nmap ‘target ip address’ -sU
To scan TCP ARP port type the command
nmap ‘target ip address’ -sA
To scan Window port type the command
nmap ‘target ip address’ -sW
To my more scan type the command
nmap ‘target ip address’ -sM
Those are the commands for scanning Network.
Host discovery commands:
For host discovery of a targeted IP address type the command
nmap ‘target ip address’ -sn
Service & Version detection command:
To detect running services and version type the command
nmap ‘target ip address’ -sV -p‘port number‘ (ex: nmap 192.168.43.1 -p21)
In the ‘port number’ put the number of the port you want to scan.
OS detection command:
To detect OS that installed in a specific IP address type the command
nmap ‘target ip address’ -A
Remote OS detection command:
To detect the OS installed in a targeted IP address type the command
nmap ‘target ip’ -O
So these are the commands you can use in the Nmap. These commands will help you to use Nmap like a pro. If you’re facing any problem feel free to comment to us. Our team is always here for you. Use all commands without inverted commas.
This tutorial is only for educational purposes. Don’t try it on your neighbor’s local server or other networks. Practice it on your own local server. Hacking a system without the owner’s permission is purely illegal. We’re not responsible for any kind of damage.