Snort
Snort
Snort
This lab was developed for the Labtainer framework by the Naval Postgraduate School, Center for
Cybersecurity and Cyber Operations under National Science Foundation Award No. 1438893. This
work is in the public domain, and cannot be copyrighted.
1 Overview
This exercise introduces the use of the snort system to provide intrusion detection within a Linux environ-
ment. Students will configure simple snort rules and experiment with a network intrusion detection system,
(IDS).
2 Lab Environment
This lab runs in the Labtainer framework, available at http://nps.edu/web/c3o/labtainers. That site includes
links to a pre-built virtual machine that has Labtainers installed, however Labtainers can be run on any Linux
host that supports Docker containers.
From your labtainer-student directory start the lab using:
labtainer snort
3 Network Configuration
This lab includes several networked computers as shown in Figure 1. When the lab starts, you will get
virtual terminals, one connected to each component. The gateway is configured with iptables to use
NAT to translate sources addresses of traffic from internal IP addresses, e.g., 192.168.2.1, to our external
address, i.e., 203.0.113.10. The iptables in the gateway also routes web traffic (ports 80 and 443) to the
web server component by translating the externally visible destination address to the internal web server
address.
The gateway is also configured to mirror traffic that enters the gateway via either the 203.0.113.10 link,
or the link to the web server. This mirrored traffic is routed to the snort component. This mirroring allows
the snort component to reconstruct TCP sessions between the web server and external addresses.
The snort component includes the Snort IDS utility. It also includes Wireshark to help you observe
traffic being mirrored to the snort component.
The web server runs Apache and is configured to support SSL for web pages in the www.example.com
domain.
The remote ws component includes the Firefox browser, and a local /etc/hosts file that maps
www.example.com to the external address of the gateway, i.e., 203.0.113.10. The internal workstation
(ws2) also includes Firefox and an entry in /etc/hosts for www.example.com. Both workstations also
include the nmap utility.
Labtainers 2
4 Lab Tasks
It is assumed that the student has received instruction or independent study on the basic operation of Snort,
and the general goals and mechanics of network intrusion detection.
Review the network topology. In particular, consider the iptables settings on the gateway. These can
be seen by reviewing the commands in /etc/rc.local, which are used to define the NAT translations
and, critically for this lab, mirror traffic to the snort component.
firefox www.example.com
As you can see, the rule you wrote will overwhelm you with useless information. So, stop snort and
delete the rule.
5 Submission
After finishing the lab, go to the terminal on your Linux system that was used to start the lab and type:
stoplab snort
When you stop the lab, the system will display a path to the zipped lab results on your Linux system. Provide
that file to your instructor, e.g., via the Sakai site.