Snort

Snort can be downloaded in rpm format from a variety of sites. It has a long list of dependencies unless you get a version 1.8.2 or newer, which only requires libpcap. On my system, I had to install with the --no-deps flag because it didn't recognize that libpcap.so.0 was already installed.

Installation provides the Snort binary in /usr/sbin and the configuration files in /etc/snort.

Configuration

The configuration consists of two major files, /etc/snort/snort.conf and /etc/snort/classification.config, and a large number of rulesets files named /etc/snort/*.rules. The rule files are included by snort.conf, as is the classification.config file.

You would begin by configuring snort.conf by providing information about system variables. The format is:

Here are the changes you need to make:

  1. Change the HOME_NET to something that represents your local network address and subnet mask:

  2. Change external net to be anything else:

  3. Change DNS_SERVERS to reflect you configuration:

  4. Uncomment the line:
       #preprocessor portscan-ignorehosts: $DNS_SERVERS. 
          

  5. In the Output-Plugin section find the line for classification.config and change the path to:
     
       include /etc/snort/classification.config
       

  6. In the rules sections, change the rule include paths to reflect the actual path, which should be /etc/snort/. Remove the comment indicator on any other rulesets you want to include.

The comments in the file will lead you through the majority of the configuration.

The classification.config file is a list of problem classifications in the form:

where the priority is a numeric value. For now, you shouldn't have to worry about this.

The rules in the ruleset files have the form:

Running Snort

Snort has a lengthy list of options that control its operation, but you might start with the command:

Snort Reports

Snort can report a huge amount of information, but it does so in a very organized fashion. If you look in /var/log/snort you will see several files and directories. It nicely writes a directory for every new IP address that is involved in communication with your system for any reason. For example, you might see a directory named 192.68.1.14. In these directories, you will see files that are named as:

For example, if host 192.68.1.10 connected using TCP from port 16785 to your telnet port, you would see:

This makes it much easier to identify hosts or particular activity.

The reports provide much of the packet sniffer information and a short comment from Snort. For example,

/var/log/snort also contains a file named alert that has potential problems as idenfied by Snort. For example,

Updating Rulesets

There are groups that update the rulesets for Snort on a regular basis. These rulesets can be downloaded from:

The latter site updates their rulesets hourly to reflect the latest information.

You can download and install a script to automatically update your rules via a cron job from