All about Nmap: A Powerful Tool for Network Discovery and Security Inspection

Alp M.
6 min readMay 21, 2023

--

Cybersecurity is a crucial aspect of today’s digital development. Institutions and individuals take various security measures to keep their systems safe and take precautions against possible attacks. One of these measures is the possibility of networking. Network pulses and security inspections are key images used to detect network vulnerabilities and areas of death to attacks. In this context, a tool called Nmap is one of the biggest helpers of cybersecurity professionals and network management.

What is Nmap?
Nmap (Network Mapper) is an open-source network execution and security review tool for Linux, Windows, and other tablet systems. It is used to discover and analyze computers, servers, and network devices at different targets. Nmap provides detailed information about and protection of scanning of systems running on the network.

Features of Nmap
Network Discovery: Nmap uses scanning protection to find active devices on the network. Provides information about IP addresses, ports, and services. This makes it possible to detect all active network systems andcreate a map of the network topology.

Port Scan: Nmap is used to detect open ports on the target system. In this way, potential security vulnerabilities in the system can be identified. Open ports are an important indicator for attackers to detect attempts to infiltrate the network and potential attacks.

Service Detection: Nmap is used for the results of system running services. It provides detailed information such as which services the target systems are running on and which browsers are using it. This information helps attackers evaluate vulnerabilities in the target system.

Network Traffic Inspection: Nmap can capture and analyze dimensions on the network. This particular is useful for monitoring data paths happening on the network and detecting anomalies.

System and Network Inspection: Nmap can do an overview of system and network security. This review can be used to detect security vulnerabilities in the system and offer fixes.

Uses of Nmap
Nmap storage in various usage scenarios:

System Management: Network guards use Nmap to monitor devices and services running on their network, determine the network topology, and detect newly targeted devices in the network.

Security Audits: Security professionals use Nmap for security audits. They prefer Nmap to detect potential vulnerabilities, check open ports, and perform metric analysis for attacks.

Penetration Tests: Penetration testers use Nmap to analyze target systems and assess vulnerabilities against attacks. In this way, security vulnerabilities are detected and weak points that need to be hidden are determined.

Intrusion Detection Systems: Intrusion detection systems use Nmap to monitor the gateway and detect attacks. Fortresses, such as abnormal network spawns and open ports, can be used to identify attack attempts.

Conclusion
Nmap is a powerful tool widely used in network recovery and security investigations. It provides great convenience to cyber security experts and network departments thanks to features such as the discovery of systems in the network, port positions, service evaluations, and network management analysis. However, with the use of a powerful tool like Nmap comes responsibility. Unauthorized use and unauthorized network scans can lead to legal rules. Therefore, using it within legal and ethical limits like Nmap is important.

Installing Nmap
Nmap is a tool available for Linux, Windows, and other operating systems. Here are the steps to install Nmap:

Installation for Linux:

Open the terminal and enter the following command: sudo apt install nmap
After the installation is complete, run the Nmap — version command in the terminal to verify that Nmap is installed correctly.
Installation for Windows:

Go to Nmap’s official website (https://nmap.org) and download the Windows version from the “Download” section.
Run the downloaded setup file and follow the instructions to complete the setup.
To use Nmap after installation is complete, open Command Prompt and run Nmap — version.
Example Usage Scenarios of Nmap
1. Network Discovery and Device Detection
You can use Nmap for network discovery and device detection. For example, it is possible to scan for active IP addresses on the network using the following command:

nmap -sn 192.168.1.0/24

This command scans all IP addresses in the 192.168.1.0 IP block and lists the active ones.

2. Port Scan and Service Detection
Nmap is useful for detecting open ports and running services on the target system. For example, you can port scan on a specific IP address with the following command:

nmap -p 1–1000 192.168.1.100

This command scans for ports 1–1000 at the IP address 192.168.1.100 and lists the open ones.

3. System and Network Security Review
You can use Nmap for system and network security inspection. For example, you can detect vulnerabilities in the target system using the following command:

nmap — script vuln 192.168.1.100

This command uses a security check script from Nmap called “vuln” to detect potential vulnerabilities in the target system.

4. Network Traffic Inspection
Nmap can capture and analyze network traffic. For example, you can listen for network traffic using the following command:

sudo nmap — packet-trace 192.168.1.0/24

This command captures the network traffic occurring in the specified IP block and analyzes the packets in detail.

Conclusion
Nmap is a powerful tool for network discovery and security investigations. In this article, we focused on how to install Nmap and example usage scenarios. Nmap’s capabilities make it a valuable tool for network security professionals, network administrators, and penetration testers. However, remember that it should always be used within legal and ethical limits. Make sure target systems are allowed and get necessary authorizations when using Nmap.

Here are 50 otherexamples of commands using Nmap :

1 — Listing scan types: nmap -help scan

2 — Setting scan speed: nmap -T<0-5> target

3 — Scanning a specific port: nmap -p <port> target

4 — Scanning a port range: nmap -p <port-range> target

5 — Excluding a specific port: nmap -p <port> --exclude-ports <port> target

6 — Scanning all ports: nmap -p- target

7 — TCP SYN scan: nmap -sS target

8 — UDP scan: nmap -sU target

9 — Sending ICMP Echo request: nmap -PE target

10 — Scanning a specific protocol: nmap -sO <protocol> target

11 — Script scanning: nmap -sC target

12 — Operating system detection: nmap -O target

13 — Fast scan: nmap -F target

14 — Aggressive scan: nmap -A target

15 — Saving scan results to an XML file: nmap -oX output.xml target

16 — Saving scan results to a text file: nmap -oN output.txt target

17 — Setting the inter-request delay: nmap --scan-delay <time> target

18 — Setting a random inter-request delay: nmap --randomize-hosts target

19 — Specifying the TTL value: nmap --ttl <value> target

20 — Hiding the MAC address: nmap -S spoofed_source target

21 — Enabling traceroute-like functionality: nmap --traceroute target

22 — Scanning network devices: nmap -PR target

23 — Listing NSE (Nmap Scripting Engine) scripts: nmap --script-help <script-name>

24 — Resolving DNS information for a target: nmap --system-dns target

25 — Concealing the scan: nmap -sI zombiehost target

26 — Customizing packet sizes: nmap --data-length <size> target

27 — Scanning on unwanted systems: nmap --spoof-mac <mac-address> target

28 — Excluding a specific target: nmap --exclude <host> target

29 — Running a script with a script ID: nmap --script <script-id> target

30 — Scanning broadcast addresses on a network: nmap -PR -sn target

31 — Aggressive scan and service version detection: nmap -A -sV target

32 — Checking FTP server: nmap --script ftp* target

33 — SNMP service scanning: nmap -p 161 --script snmp* target

34 — Web server vulnerability scan: nmap --script http-vuln* target

35 — DNS server scanning: nmap --script dns* target

36 — Modbus protocol scan: nmap -p 502 --script modbus* target

37 — POP3 server scanning: nmap -p 110 --script pop3* target

38 — SSH server security scan: nmap -p 22 --script ssh* target

39 — MySQL database scanning: nmap -p 3306 --script mysql* target

40 — Windows SMB security scan: nmap -p 445 --script smb* target

41 — SNMP password brute-forcing: nmap --script snmp-brute target

42 — VoIP scanning: nmap -p 5060 --script voip* target

43 — NFS server scanning: nmap -p 2049 --script nfs* target

44 — RDP security scan: nmap -p 3389 --script rdp* target

45 — MongoDB database scanning: nmap -p 27017 --script mongodb* target

46 — Cisco devices scanning: nmap -p 23 --script cisco* target

47 — X11 security scan: nmap -p 6000 --script x11* target

48 — Security vulnerabilities scan on HTTP: nmap --script http-vuln-cve* target

49 — SNMP password brute-forcing: nmap --script snmp-brute --script-args snmp-brute.communitiesdb=community_list.txt target

50 — NTP server scanning: nmap -p 123 --script ntp* target

--

--