Jul 17, 2025
This lecture covers using Nmap to scan open ports on remote systems, details installation, command syntax, common options, and practical scan examples.
sudo apt install nmap
for Ubuntu.nmap [options] [target(s)]
.sudo nmap 192.168.0.1
.sudo nmap example.com
.-p-
: Scans all 65,535 TCP and UDP ports.-p [port]
: Scan a specific port.-p [1-n]
: Scan a range of ports.-p [port1,port2]
: Scan multiple specific ports.-sT
: Scan only TCP ports.-sU
: Scan only UDP ports.--top-ports [n]
: Scan the top n most common ports.-O
: Identify the target's operating system.-F
: Fast scan of the top 100 ports.-iL
: Scan targets from a text file list.-sV
: Detect service and version on open ports.-T[n]
: Set scan timing (0=safest, 5=fastest/aggressive).--exclude [host1,host2]
: Exclude hosts from scan.sudo nmap 192.168.0.1 192.168.0.2
.sudo nmap 192.168.200.1-10
.sudo nmap 192.168.200.1/24
.sudo nmap -iL users.txt
.sudo nmap -p 22 192.168.200.1
.sudo nmap -p 1-100 192.168.200.1
.sudo nmap -F 192.168.200.1
.sudo nmap -p- 192.168.200.1
or sudo nmap -p "*"
for all.sudo nmap -sT 192.168.200.1
.sudo nmap -sU 192.168.200.1
.sudo nmap -O 192.168.10.1
.sudo nmap -A 192.163.43.103
.sudo nmap --top-ports 100 target
.sudo nmap -T5 example.com
.sudo nmap -Pn --script vuln 127.0.0.1
.