Installing Snort 1.6.3 on SuSE 6.x-7.x
Written By: DrSuSE
Home Page: http://www.snort.org
Snort is a lightweight network intrusion detection system, capable of
performing real-time traffic analysis and packet logging on IP
networks. It can perform protocol analysis, content searching/matching
and can be used to detect a variety of attacks and probes, such as
buffer overflows, stealth port scans, CGI attacks, SMB probes, OS
fingerprinting attempts, and much more. Snort uses a flexible rules
language to describe traffic that it should collect or pass, as well as a
detection engine that utilizes a modular plugin architecture. Snort
has a real-time alerting capability as well, incorporating alerting
mechanisms for syslog, a user specified file, a UNIX socket, or WinPopup
messages to Windows clients using Samba's smbclient.
You MUST have libpcap and tcpdump installed. SuSE Linux
includes both but if you want to get the latest or for some reason dont
have them, they can be found at:
1. Login as root
2. Get Snort
1.6.3 source and save it to your /tmp directory.
3. CD to your /tmp directory and untar the snort file by using the
tar -xvzf snort-1.6.3.tar.gz
4. CD to /tmp/snort-1.6.3
5. Run configure by typing:
6. Run make by typing:
7. Run make install by typing:
8. Create a snort directory in /etc:
9. Create a snort log directory:
10. Now, we need to move the Snort rule files. From the /tmp/snort-1.6.3
mv *lib /etc/snort
11. Let's edit the /etc/snort/snort-lib file using your favorite
editor. Dr SuSE likes vi
12. The first thing we need to do is find and edit the HOME_NET
variable. Change it to reflect your network range. Mine is
13. Move on down until you get to the line for the DNS_SERVER and change
that variable to reflect your DNS or ISP's DNS server.
14. Ok, now move down until you find a line that reads "preprocessor
portscan: $HOME_NET 4 3 portscan.log" and change it so that portscan.log
points to /var/log/snort. The line should look like this:
preprocessor portscan: $HOME_NET 4 3
15. Alright, now then if you look further down you will see a series of
lines that begin with "include something-lib" Change each line so that
it reflects the full path like this:
16. Ok, save the file.
Guess what? Snort is now usable but were gonna get it to start up
each time you boot your machine.
1. Get the snort-init script which was written by Matthias Eckermann of
SuSE Linux Solutions AG. You can get it from the following places.
2. Move snort-init to /etc/rc.d/init.d as snort:
3. cd to /etc/rc.d/init.d so we can make some sym links. Run the two
ln -s ../snort /sbin/init.d/rc2.d/S26snort
ln -s ../snort /sbin/init.d/rc2.d/K26snort
4. Make /etc/rc.d/init.d/snort executable. From the /etc/rc.d/init.d
chmod +x ./snort
5. Edit the file rc.config in the /etc directory and add this line to the
end of it:
6. Ok, that's it for the rc.config file, save it and let's get to snortin
You can either shutdown -hr now or you
can telinit s then telinit 2.
Well, if everything went well, your box should be snortin packets and
You can check to make sure Snort is running by using this command:
ps -ax | grep snort
Installing SnortSnarf on SuSE 6.x-7.x
1. Get the latest SnortSnarf version from Silicon Defense. and
place it into your /tmp directory.
2. cd to the /tmp directory and extract the file using the following
3. cd to /tmp/SnortSnarf-100400.1/include
4. Copy the contents of the include directory to
5. cd to /tmp/SnortSnarf-100400.1/cgi
6. Copy the contents of the cgi directory to /usr/local/httpd/cgi-bin
cp ./* /usr/local/httpd/cgi-bin/
7. Now go back to the directory /tmp/SnortSnarf-100400.1 and copy the
file snortsnarf.pl a directory or your choice. I just made one called
/snarf and put it there.
8. Go to the directory where you placed snortsnarf.pl and let's run the
./snortsnarf.pl -rulesdir /etc/snort -rulesfile
/etc/snort/snort-lib -d /usr/local/httpd/htdocs/snort
TIP: That's a long command, you might want to script it.
If everything went according to plan you should be able to view your
SnortSnarf result page at http://localhost/snort
Want to see what it all looks like? Check out my SnortSnarf page HERE
I hope you enjoy Snort and SnortSnarf and I hope this NHF has been of
some help to you. I encourage you to learn more about Snort and
SnortSnarf as there are many features that have not been covered in this
Soon you will be well on your way to writing your own Snort rules and
some of you may have the opportunity to install and administer your own
Snort box at work. Snort is an excellant tool for learning about network
attacks and TCP/IP and it's been a very enjoyable application to work
with. I'm sure you will enjoy it as much as I do. If you run into
problems, you can get help by using the Snort User Forum at
www.snort.org. As always I welcome your email and if I have the time I am
always willing to help.
Links of Interest:
Official Snort site
Marty Roesch: The man responsible for giving us Snort.
Matthias Eckermann: Matthias wrote the Snort init
script. Matthias, hook me up with a job at SUSE.
The Snort Team: You know who you are.....so do the FEDS ;)
Stuart, James and Joe: Silicon Defense crew who wrote
Max Vision: Masta of the uber 31337 arachNIDS database.
Sensei: It's www.linuxnewbie.ORG not .com
Would you like to have your article published online? Send them in to firstname.lastname@example.org