Lab 6 - Student
Lab 6 - Student
Objectives In this practical you will utilize different tools to perform network
scanning and port scanning as part of vulnerability assessment.
CLO: 4
Duration: 60min+
Requirements Lab PC
Kali Linux
Metasploitable VM
Windows XP VM
Port Scanning
Port Scanning:
Computer ports are logical gateways through which traffic goes into and out
of a computer. Typically, open ports are dedicated for running services (e.g.
port 80 for a web server). Scanning for ports, allow the tester to check for
running services. Some services are vulnerable and therefore can be
exploited.
Common Ports
2 | Intrusion Detection | Lab Instructor Manual | Dr. Samer Aoudi | Updated October
2018
Task 1: Network Scanning (PING Tools)
Task Objectives
You will use different ping tools to perform ping scans on
networks (sweeps) and on individual target hosts
1. Start your Kali and the two target VMs (XP and Metasploitable)
2. Get the IP address of Kali
What command did you
use?
Kali’s IP address
Netdiscover Output
What are the IP addresses Xp: 192.168.12.130
of Metasploitable: 192.168.12.129
your own XP and
Metasploitable?
FPING
5. Run the following fping command (use the IP addresses of your own target
VMs):
fping -c 2 192.168.40.129 192.168.40.130
Fping Output
What does the –c option Number of pings
do?
fping is a program like ping which uses the Internet Control Message
Protocol (ICMP) echo request to determine if a target host is responding.
fping differs from ping in that you can specify any number of targets on
the command line, or
specify a file containing the lists of targets to ping.
NPING
6. Run the following nping command (use the IP addresses of your own target
VMs):
nping --icmp -c 2 192.168.40.129
3 Destination Unreachable
4 Source Quench
5 Redirect
11 Time Exceeded
12 Parameter Problem
7. According to the probe modes shown above, we can set the ICMP probe
modes. Based on the ICMP message types table, perform the following
scan:
o Packet count = 4
o Target = any of you target VMs
o Probe mode = ICMP
o ICMP type = Router solicitation
What command did you nping –icmp-type 10 -c 4 192.168.12.130
use?
Did you get any reply
back?
Note that the ping sweep will take some time because we are sweeping the
entire network range (i.e. 256 possible hosts).
You will notice in the output that you received around 4 packets back (i.e. 4
hosts replied). The hosts that responded are your two targets + some internal
virtual hosts (e.g. virtual DHCP server).
10. Repeat the network sweep on your target network but with the following
options:
o Number of packets c = 1
o Probe mode = TCP
o Target port = 80
11. Open the web browser in your Kali and try the 3 different IP addresses
of the hosts that replied
What do you observe?
HPING3
HPING3 is a command line network tool able to send custom TCP/IP packets
and to display target replies like ping program does with ICMP replies.
HPING3 can target one host at a time so it cannot be used for ping
sweeps.
hping3 - send (almost) arbitrary TCP/IP packets to network hosts (man pages).
HPING3 Modes:
UDP/TCP
13. Turn on the XP firewall (don’t allow exceptions) and repeat the command
you used above
XP VM Firewall
Settings
How many packets were 3(100%)
lost?
Explain what happened This very important(The firewall would block- filter the
incoming connection packets. Kali send icmp packet and dose
when you turned the firewall not receive any replay
on
Other answer (The firewall will stop any icmp packets
since it will be filtered.)
What TCP flags were set in RA(RST+ ACK) can be seen in the packet information
the received packets?
What was the source port?
Firewall Exceptions
21. Ensure Remote Desktop is checked. And click the Edit button
What protocol and port
number does Remote
TCP 3389
Desktop use?
Why?
Because the firewall is allowing exceptions for port 3389
Task 2: Port Scanning (NMAP)
Task Objectives
You will use NMAP to scan entire networks for live hosts, and
scan individual hosts to detect open ports and running
services.
Lab Network:
The security lab is set up in an isolated way allowing students to perform
network scans within the lab. Do NOT perform network scans outside the lab
environment.
VM Network:
If the lab is not set up to allow scanning of the lab network (i.e. bridged
VMs), students’ VMs should be configured to allow scanning their own virtual
network (i.e. NAT setup).
NMAP
nmap is a network exploration tool and security / port scanner (man pages)
Nmap ("Network Mapper") is a free and open source (license) utility for
network discovery and security auditing. Many systems and network
administrators also find it useful for tasks such as network inventory,
managing service upgrade schedules, and monitoring host or service
uptime.
Nmap uses raw IP packets in novel ways to determine what hosts are
available on the network, what services (application name and version) those
hosts are offering, what operating systems (and OS versions) they are
running, what type of packet filters/firewalls are in use, and dozens of other
characteristics. It was designed to rapidly scan large networks, but works
fine against single hosts.
NMAP Usage:
nmap [Scan Type(s)] [Options] {target
specification}
Scan Types:
Scan Options:
Ports
Versions
Scripts
Operating Systems
Firewalls
Output
Examples
More Examples
What is the IP address of
your Kali VM?
TCP Connect
Null
FIN
ACK
XMAS
UDP
3. Run the scans with the XP VM firewall ON and write down the results:
Results with firewall on SYN TCP NULL FIN ACK XMAS UDP
Number of Open Ports
Number of Closed Ports
Number of Filtered Ports 1000 1000 1000
Number of Open | 1000 1000 1000 1000
Filtered
Number of Unfiltered
Ports
Scan Time 21.25 21.18 21.24 21.28 21.28 21.24 21.27
4. Run the scans with the XP firewall OFF and write down the results:
Results with firewall on SYN TCP NULL FIN ACK XMAS UDP
Number of Open Ports 8 8 10
Number of Closed Ports 992 992 1000 1000 1000 990
Number of Filtered Ports
Number of Open | 8
Filtered
Number of Unfiltered 1000
Ports
Scan Time 1.19 1.18 1.18 1.18 1.18 1.20 1.26
Results
Results, especially scan time, will vary. The important thing is that students
are capable of retrieving and interpreting this information.
5. With the firewall off, perform a TCP scan on port 21 and show what
version of the service is running on that port
Command
Port 21
State Open
Service FTP
Version Microsoft FTPD
6. With the firewall off, perform a scan to detect the OS on the target
Command
NMAP is capable of running advanced and deep scans. For your project, you are
expected to discover these techniques and utilize them. Otherwise, you won’t be
able to produce accurate results. Research and try the following:
7. Run a Deep Scan of all ports each one of your target hosts (XP and
Metasploitable). Your scan should include service version and OS detection
Command Nmap -sV -192.168.221.132 -p1-65535(this if you need to do
(XP) deep scanning )
Command
(Meta)
Sometimes you want speed and efficiency in your scan. Research and try the
following:
8. Perform a version detection scan on one of your hosts targeting only open
ports
Command
1. How many port states does NMAP report and what are they?
6. What command is used to save the output of an NMAP scan into a file
called
results on the target 192.166.1.12?
-oN