How to Use Nmap in Kali Linux
Nmap (Network Mapper) is a popular and versatile network scanning tool used for network discovery, security auditing and more. It comes pre-installed in Kali Linux, a penetration testing and ethical hacking Linux distribution. Using Nmap is easy in Kali Linux, allowing you to scan networks and systems effectively.
Introduction to Nmap
Nmap allows scanning single hosts, subnets, whole networks or even entire countries using raw IP packets. It determines which hosts are up, what services they offer, the operating system they run etc without requiring agent software.
Some key uses of Nmap include:
Managing service upgrade schedules
Monitoring host or service uptime
Detecting open ports & vulnerabilities
Installing Nmap in Kali Linux
Nmap comes pre-installed in Kali Linux. To confirm, open a terminal and type:
This will display the Nmap help output, confirming it is installed and ready to use.
If Nmap is not already installed for any reason, use:
apt-get install nmap
Using Nmap in Kali Linux
Nmap is very simple to use in Kali Linux. Some useful basic scans include:
This scans whether hosts are online and reachable:
nmap -sn 192.168.1.1/24
Scans open ports on the target:
Operating System Detection
Tries detecting which OS the target is running:
nmap -O 192.168.1.1
More Advanced Scans
Nmap offers many more scan types such as UDP scans, IP protocol scans, FTP bounce scans etc for advanced discovery and vulnerability detection.
Some useful examples:
nmap -sU -p 53 192.168.1.1/24 # UDP scan
nmap -sO 192.168.1.1 # IP protocol scan
nmap --script vuln 192.168.1.1 # Detect vulnerabilities
There are many more options covered in detail in the official Nmap guide.
Using Nmap Scripts
Nmap offers scripts for more advanced functionality such as:
Scripts are easy to use. For example:
nmap --script ftp-brute 192.168.1.1
Many scripts come bundled with Kali Linux and Nmap. You can find these in
More scripts can also be downloaded from the Nmap script page and added to this folder.
Instead of interactively using Nmap, you can write scripts to automate scanning. Useful for:
Periodic network monitoring
Testing new vulnerabilities
Batch vulnerability assessments
Some options to automate Nmap:
This makes Nmap easy to schedule and integrate into other tools.
Nmap is a versatile network and security scanner pre-installed in Kali Linux. It can be used for basic ping/port scans, detecting vulnerabilities and automating security tests. Kali Linux makes it very easy to get started with Nmap. Consider using some of the scans and scripts outlined here next time you are assessing a network!