What is the Nmap? How to use it?
What is the Nmap?
Nmap is an open source tool for network scanning and vulnerability detection.Real name is Network Maper.It is completely free software and can be used on both Windows, Linux and MacOS.
Nmap is an open source program written in C++ by Gordon Lyon and used for extended network discovery and security auditing with C, Perl and Python.Also known as port scanning tool for short.
Network managers use nmap for which find working device,the explore available host and server service,find open ports and scan security risk.
How to use Nmap?
basic nmap command write
nmap {scan method} {options} {target}
You can write “nmap -help” and “nmap -h” commands on the command line to learn all the commands and functions in using Nmap.
Let’s take a look at the port conditions that may arise as a result of the scan:
Open: Indicates that the port is accessible and service is running on it.
Closed : Indicates that the port is accessible but there is no service on it.
Filtered: Indicates that the returned responses are blocked by a packet filtering mechanism, it cannot decide whether the port is open or closed, there may be a security device there.
Unfiltered : Indicates that the ports are accessible but Nmap cannot decide whether the ports are open or closed. Here you can switch to another scanning method so that Nmap can understand it.
Open|Filtered : Indicates that Nmap cannot decide whether ports are open or filtered (in this case, scans such as UDP, IP, FIN, Null, Xmas can be performed).
Closed|Filtered : Indicates that Nmap cannot decide whether ports are closed or have a security device in front of them. In this case, a different scan is required.
Some nmap commands:
nmap 192.168.1.1 -scanning a single ip address
nmap 192.168.1.1 192.168.2.1 -scanning several ip addresses
nmap 192.168.1.1,2,3 -scanning several ip addresses
nmap –sec 192.168.1.0/24 -scan active hosts
nmap 192.168.1.1–254 -scan ip address range
nmap google.com -domain scan
nmap 192.168.1.0/24 -subnet scan
nmap 192.168.1.* -subnet scan
nmap -iL targets.txt -scan ip address or hosts in file
nmap — exclude 192.168.1.1 -scan excluding ip address
nmap –sS 192.168.1.1 -tcp syn scan
nmap –sT 192.168.1.1 -scan tcp ports
nmap –sU 192.168.1.1 -scanning udp ports
nmap –sA 192.168.1.1 -tcp ack scan
nmap –p 80 192.168.1.1 -scan 80 port only
nmap –p 80,443 192.168.1.1 -scan a few ports
nmap –p 80–100 192.168.1.1 -port range scan
nmap –p “*” 192.168.1.1 -scan all ports
nmap –top-ports 7 192.168.1.1 -scan 7 most popular ports
nmap –p T:80 192.168.1.1 -tcp 80 port scan
nmap –p U:53 192.168.1.1 -udp 53 port scan
nmap –open 192.168.1.1 -scan only open ports
nmap –O 192.168.1.1 -find operating system
nmap –sV 192.168.1.1 -Version find
nmap –sA 192.168.1.1 -find firewall or filter
nmap –sF 192.168.1.1 -tcp fin scan
nmap –sX 192.168.1.1 -tcp xmas scan
nmap –Pn 192.168.1.1 -scan without ping
nmap 192.168.1.1 >output.txt -print result to file
nmap –oN output.txt 192.168.1.1 -print result to file
nmap –oX output.txt 192.168.1.1 -print the result as xml