Systems and security #security 2 min

SNORT - Security auditor

Translation of the original in Catalan. Read it in: CatalàCastellano

A very good security auditor and a great project to keep in mind. It is not trivial to install it well but it compensates the effort.

It has been a while since I started installing this auditor on maestratnet.net, but due to an error in the database support in the output plugin I gave up on using it until this project is documented more.

Well then today at last, I have managed to give SNORT 1.6.3 support for MySQL databases, I have modified the Makefile file because otherwise it didn't work the changes I have made I have found them on the page:

http://www.incident.org/snortdb

Basically what I have had to change are 3 environment variables of the file which have ended up like this:

CPPFLAGS = -I/usr/include/mysql -I/usr/include/mysql -DENABLE_MYSQL

LDFLAGS = -L/usr/lib/mysql

LIBS = -lpcap -lnsl -lmysqlclient -lm

Having modified this file when doing the configure I have had to put:

./configure --with-mysql-includes=/usr/include/mysql --with-mysql-libraries=/usr/local/mysql/lib/mysql

Assuming that I have MySQL installed in /usr/local/mysql, I have also had to modify the /etc/ld.so.conf file and add the line:

/usr/local/mysql/lib/mysql

otherwise after compiling snort it didn't work correctly since it found a library missing.

After all this I have downloaded the snort rules file that I have put in /etc/snort, the last one I have found is 07272k.rules, this one I have modified adding support for the output plugin to mysql databases:

output log_database: mysql, dbname=snort user=snort host=localhost password=xxxx

After all this I have been able to launch snort with the following line that I have placed in the rc.snort file:

snort -s -d -D -i eth0 -l /var/log/snort -c /etc/snort/07272k.rules

Once the daemon was running I have installed a file called snort_mysql.php3 made by Yen-Ming Chen (chenym@cmu.edu). But it had a couple of bugs that didn't let it run. Well first you have to configure the file, but then it has some conditions towards the end of the file where the ip's that you have entered in a form are compared, well there it checks whether the ip that you have entered has numbers between 0 and 255 and if it has a 0 it gives you an error. Something that didn't let it work with the ip 212.0.103.47 of maestratnet.net, I have changed the conditions of <=0 for <0 and it already works. Afterwards there was also a form where reference was made to the snort.php3 file or something like that, something that prevented the file from working since I have it with the name snort_mysql.php3. So I have substituted the name for $PHP_SELF and now whatever the file is called it already works.

All this is what I have had to do so that SNORT works with MySQL databases. I still have many things left to configure, things that I will be commenting on as I find them. Since the project personally I find that it is poorly documented.

1 comment

Comments from the old blog, as they were written. Comments are closed.

  1. Oriol Rius

    He trobat una web amb documentacio detallada de l'snort pinta força
    bé, tot i q no l'he pogut llegir.

    http://www.dpo.uab.edu/~andrewb/snort/snortdoc/snort.html