Study of nmap Command
Experiment
Study of nmap Command
๐ฏ Aim
To explore and analyze network hosts and services using the nmap command.
๐ Objective
By the end of this experiment, students will be able to:
- Discover active hosts in a network
- Scan open ports
- Identify running services
- Understand basic network security scanning
๐ Theory
The nmap (Network Mapper) command is a powerful tool used for:
- Network discovery
- Security auditing
- Port scanning
๐ It works by sending packets to target systems and analyzing responses.
๐ It can detect:
- Open ports
- Closed ports
- Filtered ports (blocked by firewall)
๐งพ Syntax
-
<target>→ IP address, hostname, or network range
๐ง Common Options
-
-sS→ TCP SYN scan (stealth scan) -
-sT→ TCP connect scan -
-sU→ UDP scan -
-p→ Specify port(s) -
-A→ Aggressive scan (OS + version detection) -
-O→ OS detection -
-v→ Verbose output -
-F→ Fast scan (common ports only)
๐งฐ Prerequisites
- Linux system
- Root/sudo privileges (for advanced scans)
-
nmapinstalled
Installation:
๐ฌ Procedure & Commands
1️⃣ Scan a Single Host
2️⃣ Scan a Domain
3️⃣ Scan Specific Ports
4️⃣ Scan a Range of IPs
5️⃣ Perform Stealth Scan
6️⃣ Detect OS and Services
7️⃣ Fast Scan
๐ฅ️ Sample Output
๐ Output Interpretation
| Field | Meaning |
|---|---|
| PORT | Port number and protocol |
| STATE | open / closed / filtered |
| SERVICE | Service running on the port |
๐ Port States
- Open → Service is running
- Closed → No service running
- Filtered → Blocked by firewall
๐ Exercises for Students
-
Scan your local system (
localhost). - Identify open ports on a given IP.
- Perform a fast scan and compare with normal scan.
- Scan a network range and list active hosts.
- Analyze differences between TCP and UDP scans.
❓ Viva Questions
-
What is
nmapused for? - What is port scanning?
- Difference between open and filtered ports?
- What is a stealth scan?
-
Why is
nmapimportant in security?
⚠️ Precautions
- ⚠️ Scan only authorized systems (important ethical rule)
- Requires root privileges for advanced scans
- Can be detected by firewalls/IDS
✅ Result
The nmap command is a powerful tool for network exploration and security auditing, widely used by network administrators and cybersecurity professionals.
Comments
Post a Comment