Here are the steps to install Snort:
- yum clean all
- yum install gcc gcc-c++ kernel-devel patch make vim ssh libxml2 libxml2-devel
- yum install pcre pcre-devel php php-common php-gd gd php-cli php-mysql flex bison php-pear-Numbers-Roman php-pear-Numbers-Words php-pear-Image-Color php-pear-Image-Canvas php-pear-Image-Graph libpcap libpcap-devel mysql mysql-devel mysql-bench mysql-server glib2-devel
- Make sure libpcap (version 1.0.0) is installed. If a version less than 1 is installed, it won’t work. If you need to, you can download using the following commands:
- wget http://www.tcpdump.org/release/libpcap-1.0.0.tar.gz
- tar -xzf libpcap-1.0.0.tar.gz
- cd libpcap-1.0.0
- ./configure –prefix=/usr
- make
- make install
- wget http://libdnet.googlecode.com/files/libdnet-1.12.tgz
- Download libnet-1.0.2a.tar.gz (not .tgz file and not a later version) from http://www.filewatcher.com/m/libnet-1.0.2a.tar.gz.140191.0.0.html
- Download the latest Snort binary from http://www.snort.org
- Download the latest daq from http://www.snort.org
- Download base-1.4.5.tar.gz from http://sourceforge.net/projects/secureideas/files/BASE/base-1.4.5/
Command: wget http://sourceforge.net/projects/secureideas/files/BASE/base-1.4.5/base-1.4.5.tar.gz - Download ADOdb from http://sourceforge.net/projects/adodb/files/adodb-php-4-and-5/adodb-4991-for-php/adodb4991.tgz/download
- Download Barnyard2:
wget http://www.securixlive.com/download/barnyard2/barnyard2-1.9.tar.gz - Install libdnet:
- cd libdnet-1.12
- ./configure
- make
- make install
- Install daq:
- tar -xf daq-0.5.tar
- cd daq-0.5.tar
- ./configure <– Make sure you installed libpcap = 1.0.0 (as mentioned above) otherwise this will fail
- make
- make install
- Install barnyard2
- tar -xzf barnyard2-1.9.tar.gz
- cd barnyard2-1.9
- ./configure –with-mysql –with-mysql-libraries=/usr/lib64/mysql/
- make
- make install
- Install snort:
- tar -xf snort-2.9.0.3.tar
- cd snort-2.9.0.3
- ./configure -with-mysql-libraries=/usr/lib64/mysql/ –enable-dynamicplugin
- make
- make install
- groupadd snort
- useradd -g snort snort -s /sbin/nologin
- mkdir /etc/snort
- mkdir /etc/snort/rules
- mkdir /etc/snort/so_rules
- mkdir /var/log/snort
- chown snort:snort /var/log/snort
- cd /root/Snort/snort-2.9.0.3/etc
- cp * /etc/snort/
- Download latest Snort rules file from snort.org and install:
- Register an account at http://www.snort.org to get your Oinkcode
- wget http://www.snort.org/reg-rules/snortrules-snapshot-2902.tar.gz/a2dec5e394b80d5337fe9ed57151787139a2fe28 -O snortrules-snapshot-2902.tar.gz
NOTE: To get the right version for that URL, look at what is available on the snort.org site under VRT Releases - mkdir snortrules ; tar -xf snortrules-snapshot-2902.tar ; cd snortrules
- cp rules/* /etc/snort/rules
- Install ADOdb and base:
- cd /var/www/html
- cp ADODB4991.tar /var/www/html/
- cp base-1.4.5.tar.gz /var/www/html/
- tar -xf ADODB4991.tar
- tar -xzf base-1.4.5.tar.gz
- chown -R root:root base-1.4.5
- chmod 777 base-1.4.5
- vim /etc/php.ini and set the following line to be: error_reporting = E_ALL & ~E_NOTICE
- service httpd restart
Installation References:
- http://www.snort.org/assets/159/Snort_2.9.0.3_FC14_Base.pdf
- http://www.snort.org/assets/145/Install_Snort_2.8.6_on_CentOS_5.5.pdf
Snort can run in one of 3 modes:
- Sniffer Mode: Captures packets on the wire and dumps them to your screen (console)
- Command (shows only TCP and IP headers): ./snort -v
- Command (shows data as well): ./snort -vd
- Command (shows data link layer headers as well): ./snort -vde
- Packet Logger Mode: Captures packets and logs them to a disk file
- Command: ./snort -dev -l /var/log/snort/
- Command (log in binary mode – faster): ./snort -dev -l /var/log/snort -b
- Command (to replay saved data): ./snort -dvr /var/log/snort/packet.log
- NOTE: You can also use something like tcpdump or Ethereal to replay saved file
- Network Intrusion Detection System (NIDS) Mode:
Additional Notes:
I tried these steps to install Snort via yum, worked fine, but had issues with rules after that (since the version provided by yum and version of rules don’t match):
- Verify requirements are met:
- libpcap installed
- PCRE installed
- libnet installed
- Barnyard installed
- wget http://3es.atomicrocketturtle.com/packages/atomic-release/atomic-release-1.0-11.el5.art.noarch.rpm
- rpm -ivh atomic-release-1.0-11.el5.art.noarch.rpm
- yum clean all
- yum install snort
No comments:
Post a Comment