Nowadays, cyber-attacks have increased and regular network security scans should be done for organizations and companies. For this purpose, there are many monitoring tools and software, Nmap is one of the best monitoring tools nothing else can replace its useful and practical features. This article will introduce you to 5 Nmap Security Scanning Examples. If you want to purchase a Linux VPS server, you can check out the packages offered on the Eldernode website.
Table of Contents
Introducing Nmap Security Scanning
What is Nmap?
Nmap stands for Network Mapper and is an open-source and versatile Linux command-line tool for security auditing and network exploration. You can use Nmap to automate many repetitive and scheduled tasks such as program monitoring and service updates and was developed by Gordin Lyon. Also, network administrators use this tool to explore networks, network audit, find open ports, and perform security scans.
Nmap collects network details and determines security holes in the system. It is operating system independent and you can run it on many popular operating systems such as Linux, Windows, Mac, and BSD.
5 Nmap Security Scanning Examples in 2022
This section includes Nmap security scanning examples. You shouldn’t initiate more than a dozen scans against that host per day to conserve bandwidth.
1. You can use the following command to scan all reserved TCP ports on the scanme.nmap.org machine:
nmap -v scanme.nmap.org
The -v option is used to enable verbose mode.
2. If you want to launch a stealth SYN scan against any device from the 256 IPs on the 24-sized network, where Scanme is located or determine what operating system is running on each running host, use the command below:
nmap -sS -O scanme.nmap.org/24
Note: You should use root privileges to scan SYN and detect the operating system.
3. The following command launches host enumeration and a TCP scan at the first half of the 255 possible eight-bit subnets in the 198.116.0.0/16 address space. Also, you can test whether systems are running SSH, DNS, POP3, or IMAP on their standard ports, or anything on port 4564 using this option:
nmap -sV -p 22,53,110,143,4564 198.116.0-255.1-127
For each of the opened ports, you can determine what program is running from the version detection.
4. The following command tells Nmap to randomly select 100000 hosts and scan for web servers (port 80):
nmap -v -iR 100000 -Pn -p 80
-Pn option disables host enumeration since first sending a couple probes to determine, since a host is up is wasteful when you are only probing one port on each target host anyway.
5. To scan 4096 IPs for any web servers (without pinging them) and save the output in grepable and XML formats, use the below command:
nmap -Pn -p80 -oX logs/pb-port80scan.xml -oG logs/pb-port80scan.gnmap IP_Server/20
That’s it!
Conclusion
You can use the Nmap Linux command-line tool to scan IP addresses and ports in a network and to detect installed applications. In this article, we introduced Nmap and explained 5 Nmap Security Scanning examples from the simple to a little more complex and esoteric. I hope you enjoy this tutorial. If you face any problems or have any questions, you can contact us in the Comments section.