UPC-Laboratorio - Seguridad en Redes
UPC-Laboratorio - Seguridad en Redes
UPC-Laboratorio - Seguridad en Redes
What are the IP addresses assigned to your virtual machine? Document the process with
screenshots
Type your answers here.
Locate and launch the web browser application and verify you can you navigate. Document the
process with screenshots
Topology
In a secure production network, network alerts are generated by various types of devices such as security
appliances, firewalls, IPS devices, routers, switches, servers, and more. The problem is that not all alerts are
created equally. For example, alerts generated by a server and alerts generated by a firewall will be different
and vary in content and format. In this part you will get familiar with firewall rules and IDS signatures.
a. In the CyberOps Workstation VM, open a terminal and configure its network by executing the
configure_as_dhcp.sh script.
Because the script requires super-user privileges, provide the password for the user analyst.
While there is a difference in rule structure, some similarities between the components of the rules remain. For
example, both firewall and IDS rules contain matching components and action components. Actions are taken
after a match is found.
• Matching component - specifies the packet elements of interest, such as: packet source; the packet
destination; transport layer protocols and ports; and data included in the packet payload.
• Action component - specifies what should be done with that packet that matches a component, such as:
accept and forward the packet; drop the packet; or send the packet to a secondary rule set for further
inspection.
A common firewall design is to drop packets by default while manually specifying what traffic should be allowed.
Known as dropping-by-default, this design has the advantage protecting the network from unknown protocols
and attacks. As part of this design, it is common to log the events of dropped packets since these are packets
that were not explicitly allowed and therefore, infringe on the organization’s policies. Such events should be
recorded for future analysis.
The mininet prompt should be displayed, indicating mininet is ready for commands.
b. From the mininet prompt, open a shell on R1 using the command below:
mininet> xterm R1
mininet>
Question:
The R1 shell opens in a terminal window with black text and white background. You are logged as root
user. This is indicated by the # sign after the prompt.
c. From R1’s shell, start the Linux-based IDS, Snort.
[root@secOps analyst]# ./lab.support.files/scripts/start_snort.sh
Running in IDS mode
--== Initializing Snort ==--
Initializing Output Plugins!
Initializing Preprocessors!
Initializing Plug-ins!
Parsing Rules file "/etc/snort/snort.conf"
<output omitted>
Note: You will not see a prompt as Snort is now running in this window. If for any reason, Snort stops
running and the [root@secOps analysts]# prompt is displayed, rerun the script to launch Snort. Snort
must be running to capture alerts later in the lab.
d. From the CyberOps Workstation VM mininet prompt, open shells for hosts H5 and H10.
mininet> xterm H5
mininet> xterm H10
mininet>
e. H10 will simulate a server on the Internet that is hosting malware. On H10, run the mal_server_start.sh
script to start the server.
[root@secOps analyst]# ./lab.support.files/scripts/mal_server_start.sh
[root@secOps analyst]#
f. On H10, use netstat with the -tunpa options to verify that the web server is running. When used as shown
below, netstat lists all ports currently assigned to services:
g. In the R1 terminal window, an instance of Snort is running. To enter more commands on R1, open another
R1 terminal by entering the xterm R1 again in the CyberOps Workstation VM terminal window. You may
also want to arrange the terminal windows so that you can see and interact with each device.
h. In the new R1 terminal tab, run the tail command with the -f option to monitor the /var/log/snort/alert file
in real-time. This file is where snort is configured to record alerts.
[root@sec0ps analyst]# tail -f /var/log/snort/alert
Because no alerts were yet recorded, the log should be empty. However, if you have run this lab before,
old alert entries may be shown. In either case, you will not receive a prompt after typing this command. This
window will display alerts as they happen.
i. From H5, use the wget command to download a file named W32.Nimda.Amm.exe. Designed to download
content via HTTP, wget is a great tool for downloading files from web servers directly from the command
line.
[root@secOps analyst]# wget 209.165.202.133:6666/W32.Nimda.Amm.exe
Question:
What port is used when communicating with the malware web server? What is the indicator?
Document the process with screenshots
Type your answers her
Was the file completely downloaded?
Type your answers he
Did the IDS generate any alerts related to the file download?
Type your answers he
j. As the malicious file was transiting R1, the IDS, Snort, was able to inspect its payload. The payload matched
at least one of the signatures configured in Snort and triggered an alert on the second R1 terminal window
(the tab where tail -f is running). Show the alert entry, document the process with screenshots:
Based on the alert shown above, what was the source and destination IPv4 addresses used in the
transaction?
Type your answers here.
Based on the alert shown above, what was the source and destination ports used in the transaction?
Type your answers here.
Based on the alert shown above, when did the download take place?
Type your answers here.
Based on the alert shown above, what was the message recorded by the IDS signature?
Type your answers here.
On H5, use the tcpdump command to capture the event and download the malware file again so you can
capture the transaction. Issue the following command below start the packet capture:
[root@secOps analyst]# tcpdump –i H5-eth0 –w nimda.download.pcap &
[1] 5633
[root@secOps analyst]# tcpdump: listening on H5-eth0, link-type EN10MB (Ethernet),
capture size 262144 bytes
The command above instructs tcpdump to capture packets on interface H5-eth0 and save the capture to a
file named nimda.download.pcap.
The & symbol at the end tells the shell to execute tcpdump in the background. Without this symbol,
tcpdump would make the terminal unusable while it was running. Notice the [1] 5633; it indicates one
process was sent to background and its process ID (PID) is 5366. Your PID will most likely be different.
k. Press ENTER a few times to regain control of the shell while tcpdump runs in background.
l. Now that tcpdump is capturing packets, download the malware again. On H5, re-run the command or use
the up arrow to recall it from the command history facility.
[root@secOps analyst]# wget 209.165.202.133:6666/W32.Nimda.Amm.exe
m. Stop the capture by bringing tcpdump to foreground with the fg command. Because tcpdump was the
only process sent to background, there is no need to specify the PID. Stop the tcpdump process with
Ctrl+C. The tcpdump process stops and displays a summary of the capture. Show the capture,
document the process with screenshots
[root@secOps analyst]# fg
n. On H5, Use the ls command to verify the pcap file was in fact saved to disk and has size greater than zero:
Show the capture, document the process with screenshots
[root@secOps analyst]# ls -l
Question:
[root@secOps ~]#
Question:
Note. This lab was adapted from a Cisco Security Course Lab for academic purposes