T9 🏁

Practical 2

Aim: Port scanning using Nmap

What is Port Scanning?

Process of probing a host to determine open/closed/filtered ports. Used for:

  • Network diagnostics
  • Security assessments
  • Attack reconnaissance

6 Port States Recognized by Nmap

StateMeaning
OpenApplication accepting connections
ClosedPort accessible, no service listening
FilteredFirewall/filter blocking probe
UnfilteredPort accessible, but state undetermined (e.g., ACK scan)
Open|FilteredNmap can't tell (common in UDP/FIN scans)
Closed|FilteredAmbiguous (e.g., idle scan)

Port Scan Commands

nmap [TARGET]                    # Default 1000 ports
nmap -p 80,443 [TARGET]          # Specific ports
nmap -p- [TARGET]                # All 65535 ports
nmap -A [TARGET]                 # Aggressive
nmap -sV [TARGET]                # Version detection
nmap -sS [TARGET]                # SYN (stealth)
nmap -sU [TARGET]                # UDP
nmap 192.168.1.1-50              # IP range
nmap 192.168.1.0/24              # Subnet