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

nmap [options] <target>
  • <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)
  • nmap installed

Installation:

sudo apt install nmap

๐Ÿ”ฌ Procedure & Commands

1️⃣ Scan a Single Host

nmap 192.168.1.1

2️⃣ Scan a Domain

nmap google.com

3️⃣ Scan Specific Ports

nmap -p 22,80,443 192.168.1.1

4️⃣ Scan a Range of IPs

nmap 192.168.1.1-100

5️⃣ Perform Stealth Scan

sudo nmap -sS 192.168.1.1

6️⃣ Detect OS and Services

sudo nmap -A 192.168.1.1

7️⃣ Fast Scan

nmap -F 192.168.1.1

๐Ÿ–ฅ️ Sample Output

PORT     STATE     SERVICE 22/tcp     open     ssh 80/tcp     open     http 443/tcp     open     https

๐Ÿ” Output Interpretation

FieldMeaning
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

  1. Scan your local system (localhost).
  2. Identify open ports on a given IP.
  3. Perform a fast scan and compare with normal scan.
  4. Scan a network range and list active hosts.
  5. Analyze differences between TCP and UDP scans.

❓ Viva Questions

  • What is nmap used for?
  • What is port scanning?
  • Difference between open and filtered ports?
  • What is a stealth scan?
  • Why is nmap important 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

Popular posts from this blog

Networks Lab PCCSL507 Semester 5 KTU CS 2024 Scheme - Dr Binu V P

Analysis of HTTP Protocol using Wireshark

Study and Use of ifconfig Command