Lab On Network Mapper
Lab On Network Mapper
To learn and practice basic to advanced Nmap commands for network discovery, port scanning, service
detection, and security auditing.
Prerequisites:
Theory:
Nmap, short for "Network Mapper," is a powerful and versatile open-source tool used for network
discovery and security auditing. Developed by Gordon Lyon (also known as Fyodor), Nmap is widely
utilized by network administrators, security professionals, and hackers to explore and manage network
environments. It helps in discovering hosts and services on a computer network by sending packets and
analyzing the responses.
1. Host Discovery: Identifies live hosts on a network. Nmap can detect hosts even when they do
not respond to standard pings by using various methods such as ARP requests, TCP/UDP pings,
and more.
2. Port Scanning: Determines which ports are open, closed, or filtered on a host. Nmap supports
several scan techniques including:
TCP Connect Scan (-sT): Completes the TCP handshake, making it easier to detect.
SYN Scan (-sS): Often called "half-open" scanning because it doesn't complete the TCP
handshake, making it stealthier.
UDP Scan (-sU): Scans for open UDP ports, which can be trickier because UDP is
connectionless.
FIN Scan (-sF), NULL Scan (-sN), and Xmas Scan (-sX): These scan techniques send
unusual flag combinations to elicit responses from firewalls and intrusion detection
systems.
3. Service and Version Detection: Identifies the software running on open ports and attempts to
determine the version. This is done by sending specific probes and analyzing the responses.
4. OS Detection: Estimates the operating system and device type based on TCP/IP stack
fingerprinting.
5. Scriptable Interaction with the Target: Nmap includes the Nmap Scripting Engine (NSE) which
allows users to write and share scripts for automated and advanced network tasks. These scripts
can be used for:
6. Network Mapping: Visualizes the network topology and how devices are connected.
Practical Uses
Network Inventory: Helps in identifying all devices connected to the network and their
respective services.
Compliance Testing: Ensures that network configurations comply with security policies and
regulations.
Penetration Testing: Employed by ethical hackers to find and exploit weaknesses in a network.
2. Use Nmap to perform a basic ping scan to discover live hosts on a local network (assuming your
network range is 192.168.1.0/24).
nmap -sn 192.168.1.0/24
nmap 192.168.1.1
2. Note the open UDP ports and compare with the TCP results.
1. Conduct an aggressive scan which includes OS detection, version detection, script scanning, and
traceroute.
nmap -sU scanme.nmap.org
nmap -O 192.168.1.1
Performance Tuning
Exercise 10: Timing Templates
2. Record the time taken and note any differences from a default scan.
Output Options
Exercise 12: Save Output to File
1. Perform a scan and save the output to a file in three different formats: normal, XML, and
grepable.