Lab7 Instruction
Lab7 Instruction
Introduction
In this lab students will explore the Snort Intrusion Detection Systems. The students will
study Snort IDS, a signature based intrusion detection system used to detect network
attacks. Snort can also be used as a simple packet logger. For the purpose of this lab
the students will use snort as a packet sniffer and write their own IDS rules.
Software Requirements
All required files are packed and configured in the provided virtual machine image.
In this lab, we use Ubuntu as our VM image. Select the VM named “Lab8.
Login the Ubuntu image with username student, and password [TBA in the class].
Below is the screen snapshot after login.
After configuring the Snort, you need to start the Snort. You can simply type the
following command to start the service.
$ service snort start
or
$ /etc/init.d/snort start
Snort is a signature-based IDS, and it defines rules to detect the intrusions. All rules of
Snort are stored under /etc/snort/rules directory. The screenshot below shows the files
that contain rules of Snort.
The screenshot below shows real rules in the /etc/snort/rules/web-misc.rules. The slides
of Lab 7 has more information about Snort rules including syntax and format.
Next, we are going to add a simple snort rule. You should add your own rules at
/etc/snort/rules/local.rules. Add the following line into the local.rules file
alert icmp any any -> any any (msg:"ICMP Packet found"; sid:1000001; rev:1;)
Bascailly, this rule defines that an alert will be logged if an ICMP packet is found. The
ICMP packet could be from any IP address and the rule ID is 1000001. Make sure to
pick a SID greater 1000000 for your own rules. The screenshot below shows the
contents of the local.rules file after adding the rule.
To trigger an alert for the new rule, you only need to send an ICMP message to the VM
image where snort runs. First, you need to find the IP address of the VM by typing the
following command.
$ ifconfig
For instance, the screenshot shows the execution result on my VM image, and the IP
address is 172.16.108.242.
After you have a terminal, you can just type the following command to send ping
messages to the VM.
$ ping 172.16.108.242
After you send the ping messages, the alerts should be trigged and you can find the log
messages in /var/log/snort/snort.log. However, the snort.log file will be binary format.
You need to use a tool, called u2spewfoo, to read it. The screenshot below shows the
result of reading the snort alerts.
1. Read the lab instructions above and finish all the tasks.
2. Answer the questions and justify your answers. Simple yes or no answer will not
get any credits.
a. What is a zero-day attack?
b. Can Snort catch zero-day network attacks? If not, why not? If yes, how?
c. Given a network that has 1 million connections daily where 0.1% (not
10%) are attacks. If the IDS has a true positive rate of 95%, and the
probability that an alarm is an attack is 95%. What is false alarm rate?
(You may use the math approach from the slides.)
3. Write a rule that will fire when you browse to craigslist.org or another particular
website from the machine Snort is running on; it should look for any outbound
TCP request to craigslist.org and alert on it.
a. The rule you added (from the rules file)
b. A description of how you triggered the alert
c. The alert itself from the log file (after converting it to readable text)
Extra Credit (3pt): Write and add a snort rule for detecting VPNs; it should trigger an alert
when a VPN service is running on your machine.
Happy Hacking!