Snort
Snort
Topic
Snort
Introduction
In this lab you 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.
2|Page
Software Requirements
3|Page
Installing Snort into the Operating System
To install the latest version of the snort, you can follow the installation instruction from the snort
website. Note that installation instructions are vary from OSes. The instruction below shows how
to install snort from its source code on Linux.
While you install the snort, your system may miss some libraries. You need to install the required
libraries, too.
$ ip addr
After installing the Snort, we need to configure it. The configuration file of snort is stored at cd
/etc/snort/snort.conf. The screenshot below shows the commands to configure the Snort. You need
to switch to root to gain the permission to read the snort configurations file.
4|Page
First list the files by using command
$ls -l
Step 1: Locate the HOME_NET variable, change the network address to the IP addresses you are
protecting. It can be a single IP address or a block of IP addresses by specifying a CIDR block.
For this lab, please setup the address to a block of IP addresses specific to your eth0.
Lastly, run sudo snort -T -I ens33 -c/etc/snort/snort.conf This is to validate the configuration file.
If you are doing everything correctly, you should see the last two lines as:
Snort exiting
5|Page
Snort Rules
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.
6|Page
To configure rules, you need to edit the file local rules file
alert icmp any any -> $HOME_NET any (msg:"Testing ICMP alert"; sid:1000001; rev:1;)
7|Page
Lastly, run Snort in IPS mode and tell it to output any alerts to the console by running the following
command:
Now snort will capture packets according to your rules and generate alerts to the console
Run the Ping command on other system to generate icmp traffic. Target should be the system on
which snort is running.
1. Read the lab instructions above and finish all the tasks.
2. Write and add another snort rule and show me you trigger it.
Question No. 2: Write a rule that will fire when you browse to snort.org from the machine Snort
is running on; it should look for any outbound TCP request to snort.org and alert on it.
8|Page