Nmap in Kali Linux – Installation, Usage & Basic Commands

Nmap is a powerful network scanning tool used in Kali Linux to discover devices, scan open ports, detect running services, and gather network information. It is commonly used for network analysis, security testing, and learning how systems communicate over a network. Here’s a list of tasks you can do with Nmap:

  • Discover devices connected to a network.
  • Scan open ports on a target system.
  • Detect running services and versions.
  • Identify operating systems.
  • Perform network security testing.
  • Run vulnerability detection scripts.

Installation Commands

Nmap is pre-installed in Kali Linux. If not available, install it using:

sudo apt update && sudo apt install nmap -y

Check version:

nmap --version

Usage Commands

Below commands show how to use Nmap for scanning networks, checking open ports, detecting services, and gathering target information. These commands help perform different types of network scanning and analysis step by step.

Scan a target:

nmap 192.168.1.1

Scan a website:

nmap example.com

Scan multiple targets:

nmap 192.168.1.1 192.168.1.2

Scan a range of IP addresses:

nmap 192.168.1.1-100

Check open ports:

nmap -p 1-1000 192.168.1.1

Fast scan:

nmap -F 192.168.1.1

Service version detection:

nmap -sV 192.168.1.1

Detect operating system:

nmap -O 192.168.1.1

Aggressive scan:

nmap -A 192.168.1.1

Ping scan:

nmap -sn 192.168.1.1/24

UDP scan:

nmap -sU 192.168.1.1

Stealth SYN scan:

nmap -sS 192.168.1.1

Save output to file:

nmap -oN result.txt 192.168.1.1

Save output in XML:

nmap -oX result.xml 192.168.1.1

Nmap Basic Commands

Nmap Basic Commands help perform common scanning tasks like host discovery, port scanning, service detection, and saving scan results. These commands are useful for learning the basic functions of Nmap in Kali Linux.

Show help menu:

nmap --help

Show version:

nmap --version

Check local IP address:

ip addr

Show all network interfaces:

ifconfig

Scan from a target list file:

nmap -iL targets.txt

Save output to all formats:

nmap -oA result 192.168.1.1

Disable ping before scan:

nmap -Pn 192.168.1.1

Enable verbose mode:

nmap -v 192.168.1.1

Enable very verbose mode:

nmap -vv 192.168.1.1

Scan specific ports:

nmap -p 80,443 192.168.1.1

Scan top common ports:

nmap --top-ports 100 192.168.1.1

Detect firewall:

nmap -sA 192.168.1.1

Run default NSE scripts:

nmap -sC 192.168.1.1

Run vulnerability scan scripts:

nmap --script vuln 192.168.1.1

Show traceroute:

nmap --traceroute 192.168.1.1

Exclude a host from scan:

nmap 192.168.1.1/24 --exclude 192.168.1.5

Random target scan:

nmap -iR 5

Show open ports only:

nmap --open 192.168.1.1

Timing template scan:

nmap -T4 192.168.1.1

Scan IPv6 target:

nmap -6 example.com
See also  50+ Best Termux Tools and Packages You Should Install in 2026 (With Commands)
SHARE THIS POST:

Leave a Reply

Your email address will not be published. Required fields are marked *