LAB 02 - Scanning - Mastring Nmap
LAB 02 - Scanning - Mastring Nmap
Lab n° 02
Scanning Phase – Mastring Nmap
1- Objective :
The purpose of this lab is to explore advanced network scanning techniques by Mastering Nmap
Scan, including different techniques like NSE scripting engine, automation, firewall/IDS evasion
techniques and packet fragmentation. In order to understand well the concept functioning of
scanning process for each attack, you will capture and analyse traffic using Wireshark or tshark
Lab Outline :
Instructions:
The lab report must be submitted one week after the lab session on the Moodle application by the
deadline mentioned on the platform.
The lab work must be done individually in class, but the report is to be submitted in groups of up
to 2 students. Lab groups must remain the same for all reports throughout the semester.
ATTENTION:
This work demonstrates some basic techniques that can be used to commit illegal acts. This is
considered useful within the course to better understand the types of attacks that can be carried out
on systems we aim to protect, BUT these tests should not be applied to real systems without
written authorization.
Network Mapper Scanner:
1. Introduction to Nmap:
Nmap (Network Mapper) is an open-source utility used for both network exploration and security
auditing. Nmap allows us to:
o Identify hosts present on the network.
o Detect the services running on those hosts and their versions.
o Determine which packets and ports are filtered by firewalls.
o Detect the operating systems of machines connected to the network, along with their
versions.
The objective of this part of the lab is to effectively learn how to use this powerful and versatile
tool. Keep in mind that, while Nmap is a valuable tool for security, it can also be used for malicious
purposes, so it must be used responsibly.
In this lab, we will be performing a variety of scans using Nmap from a Kali Linux virtual machine,
targeting two other virtual machines running Windows 7 and Ubuntu. We will also use Wireshark
to capture and analyze traffic during each scan.
2. Nmap Network Scanning
Test 1: Host Discovery on the Network
We will begin by scanning the network to identify active devices. For this, we will use the ping scan
(-sP option).
1. Start traffic capture in Wireshark.
2. Run the following command to scan the IP address range from 192.168.1.1 to 192.168.1.10:
# nmap -sP 192.168.1.1-10
3. Analyze the output from Nmap and the traffic captured by Wireshark. What protocol does
Nmap use with the -sP option to detect devices on the network?
4. Use the -vv option to enable verbose mode for more detailed output on the test:
# nmap -sP -vv 192.168.1.1-10
5. Use the -sn option to perform a host discovery scan on the entire 192.168.1.0/24 subnet
# nmap -sn -vv 192.168.1.0/24
• How many hosts responded to the ICMP requests?
• Did Wireshark capture any other protocol responses apart from ICMP?
3. OS Fingerprinting
Nmap also allows you to identify the operating system (OS) of the scanned machines using the OS
fingerprinting feature (-O option).
1. Perform an OS fingerprinting scan with verbose mode:
# nmap -O 192.168.1.x
# nmap -O -vv 192.168.1.x
2. Perform these tests on the virtual machines you are working with, including Windows 7,
ubuntu, and metasploitable (or other systems).
3. Test with the personal firewall both enabled and disabled on the Windows machines. What
differences do you notice?
4. Compare the OS fingerprints obtained for different operating systems to understand how
each OS implements the TCP/IP stack differently.
Test: Aggressive Scanning
1. Objective: Perform aggressive scanning to gather as much information as possible in a
short time.
# nmap -A 192.168.1.10
2. Wireshark Analysis:
o Capture the different types of packets sent by Nmap. Observe how it combines
service detection, OS detection, and traceroute in the aggressive scan.
o Filter for ICMP, TCP, and UDP packets for comprehensive analysis.
3. Questions:
o What additional information was gathered by the aggressive scan?
o How did different packet types (ICMP, TCP, UDP) appear in Wireshark?
Questions
1. Did the fragmented packets bypass the firewall or IDS?
Analyze whether the fragmentation helped evade detection by any active security mechanisms like
firewalls or IDS.
2. How were the fragmented packets handled and reassembled by the target, as seen in
Wireshark?
Look for signs of how the target system handled and reassembled the fragmented packets. Were
there any delays or issues during reassembly?