A number of Snort dynamic preprocessors are available which enables the development of rules to attack detection.
Snort is an open source product and available for most popular network operating systems. Snort rules are also available commercially from Sourcefire.
The following instruction detail the installation of Snort 2.9.4 on a CentOS 6.3 64bit host. The installation instructions include the installation of Snort rules available to registered Snort users, as well as third party rules available from EmergingThreats.
Installation:
- Install dependencies
- yum -y update
- yum -y install gcc flex bison wget make
- yum -y install zlib zlib-devel
- yum -y install libpcap libpcap-devel
- yum -y install pcre pcre-devel
- rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm #(or rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm for 32 bit machines)
- yum -y update
- yum -y install libdnet libdnet-devel
- Download and install DAQ
- cd /root/
- wget http://www.snort.org/downloads/2216 -O daq-2.0.0.tar.gz
- tar zxvf daq-2.0.0.tar.gz
- cd daq-2.0.0
- ./configure
- make
- make install
- Download and install Snort
- wget http://www.snort.org/downloads/2225 -O snort-2.9.4.1.tar.gz
- tar zxvf snort-2.9.4.1.tar.gz
- cd snort-2.9.4.1
- ./configure --enable-sourcefire
- make
- make install
- Download and install Snort Rules
- mkdir -p /etc/snort/rules
- mkdir -p /var/log/snort
- cd /etc/snort
- Manually download the rules file to /etc/snort/ (You need to be signed in to get the registered user rules). In this case it was snortrules-snapshot-2940.tar.gz
- tar zxvf snortrules-snapshot-2940.tar.gz
- mv ./etc/* /etc/snort/
- rmdir /etc/snort/etc
- OPTIONAL: Download and install Emerging Threats rules
- wget http://rules.emergingthreats.net/open/snort-2.9.0/emerging.rules.tar.gz -O emerging.rules.tar.gz
- tar zxvf emerging.rules.tar.gz
- Create Snort accounts
- groupadd snort
- useradd snort -g snort -d /var/log/snort -s /sbin/nologin -m
- chown -R snort:snort /etc/snort
- chown -R snort:snort /var/log/snort
- Edit the Snort configuration file
- vi /etc/snort/snort.conf
- ipvar HOME_NET x.x.x.x/x/
- ipvar EXTERNAL_NET !$HOME_NET
- var RULE_PATH rules
- var SO_RULE_PATH so_rules
- var PREPROC_RULE_PATH preproc_rules
- var WHITE_LIST_PATH rules
- var BLACK_LIST_PATH rules
- OPTIONAL: include $RULES_PATH/emerging.conf
- Test the Snort installation
- snort -u snort -g snort -c /etc/snort/snort.conf -T
- If all goes well you should see this
Snort exiting
I plan to have a subsequent blog post to record instructions for installing and configuring barnyard, oinkmaster and BASE. Instructions in a previous post using an older version of Snort and CentOS can be found at http://nkush.blogspot.com.au/2011/10/installing-snort-2912-on-centos-57.html
References
- http://fedoraproject.org/wiki/EPEL
- http://snort.org/docs
- http://nkush.blogspot.com.au/2011/10/installing-snort-2912-on-centos-57.html
- ERROR: /etc/snort/snort.conf(253) Could not stat dynamic module path "/usr/local/lib/snort_dynamicrules": No such file or directory.
- mkdir -p /usr/local/lib/snort_dynamicrules
- ERROR: /etc/snort/snort.conf(511) => Unable to open address file /etc/snort/rules/white_list.rules, Error: No such file or directory
- touch /etc/snort/rules/white_list.rules
- ERROR: /etc/snort/snort.conf(511) => Unable to open address file /etc/snort/rules/black_list.rules, Error: No such file or directory
- touch /etc/snort/rules/black_list.rules
Very nice post!
ReplyDeleteCongratulations!
Thanks, much appreciated :)
DeleteNice Post :)
ReplyDeleteThank you! It was a great help!
ReplyDelete