LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > *BSD
User Name
Password
*BSD This forum is for the discussion of all BSD variants.
FreeBSD, OpenBSD, NetBSD, etc.

Notices


Reply
  Search this Thread
Old 11-19-2005, 01:03 PM   #1
lord-fu
Member
 
Registered: Apr 2005
Location: Ohio
Distribution: Slackware && freeBSD
Posts: 676

Rep: Reputation: 30
snort and mysql


Hello,

I know this topic has been posted a bunch and I think I have read all the posts, but I am still stuck getting snort to log to mysql. The error I recieve is one of not having the table created on my SNORT db.
Code:
database: mysql_error: Table 'SNORT.sensor' doesn't exist
database: mysql_error: Table 'SNORT.sensor' doesn't exist
SQL=INSERT INTO sensor (hostname, interface, detail, encoding, last_cid) VALUES ('192.168.1.1','xl0','1','0', '0')
database: mysql_error: Table 'SNORT.sensor' doesn't exist
database: Problem obtaining SENSOR ID (sid) from SNORT->sensor
ERROR:
 When this plugin starts, a SELECT query is run to find the sensor id for the
 currently running sensor. If the sensor id is not found, the plugin will run
 an INSERT query to insert the proper data and generate a new sensor id. Then a
 SELECT query is run to get the newly allocated sensor id. If that fails then
 this error message is generated.

 Some possible causes for this error are:
  * the user does not have proper INSERT or SELECT privileges
  * the sensor table does not exist
I have not created any tables, so I know thats why I recieve the error. I have been following this tut:
http://www.bsdguides.org/guides/free...nortreport.php
That is using snortreport, but I just kinda skip over that stuff. I was just more interested in the mysql part,as well as reading a bunch of others.
I have created the user snort and given him insert,select,update,delete privledges on the SNORT db I created....however I have not created a table on the db so I guess thats where I am at right now.
On the link I posted above there was a section from the tut that looked like it was creating the table
Code:
cd /usr/ports/security/snort/work/snort-*/contrib
mysql -u root -p -D snort < create_mysql
However that path is not valid in my ports collection.
So I am sorry to beat a dead horse on the snort sql subject, but any help is greatly appreciated.
Many thanks in advance.

mysql -V
mysql Ver 14.7 Distrib 4.1.14, for portbld-freebsd5.4 (i386) using 4.3
snort -V
,,_ -*> Snort! <*-
o" )~ Version 2.4.3 (Build 26) FreeBSD
'''' By Martin Roesch & The Snort Team: http://www.snort.org/team.html
(C) Copyright 1998-2005 Sourcefire Inc., et al.
NOTE: Snort's default output has changed in version 2.4.1!
The default logging mode is now PCAP, use "-K ascii" to activate
the old default logging mode.



Last edited by lord-fu; 11-19-2005 at 01:12 PM.
 
Old 11-20-2005, 09:11 PM   #2
lord-fu
Member
 
Registered: Apr 2005
Location: Ohio
Distribution: Slackware && freeBSD
Posts: 676

Original Poster
Rep: Reputation: 30
Well I have figured the above problem. When I installed snort I installed with the
Code:
make install clean
This wipes out the work dir that contained the create_mysql script. After a quick backup of /usr/local/etc/snort/snort.conf and a
Code:
make deinstall clean
then
Code:
make install
Copy snort.conf back and then from within the /usr/ports/security/snort/work/snort-2.4.3/schemas dir.
Code:
mysql -p -D SNORT < create_mysql
The needed tables are now created.
Now I recieve this error when trying to start snort.
Code:
 Unable to open rules file: ./rules//local.rules or /usr/local/etc/snort/./rules//local.rules
Off to googleland....
[edit] Got my rules file dir in place, but have a new error
Code:
ERROR: Undefined variable name: (/usr/local/etc/snort/rules/exploit.rules:35): SMTP_SERVERS
I should be able to comment out rules I dont need right? Only one way to find out....[/edit]
[edit]I swear this is the last post to this.....I just did not have the include statements commented out in snort.conf. Sorry to keep reposting...hope my issues help someone in the future.[/edit]

Last edited by lord-fu; 11-20-2005 at 10:28 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Slackware, Snort, Mysql Atrocity Slackware 4 06-10-2005 11:20 AM
snort and mysql ilnli Linux - General 1 03-28-2005 02:20 PM
Snort don't want log to mysql lcat Slackware 1 03-07-2005 07:20 AM
mysql snort acid HELP wylie1001 Linux - Software 0 01-01-2005 06:51 PM
Snort and Logging to Mysql. FragInHell Linux - Security 3 09-18-2004 05:16 PM

LinuxQuestions.org > Forums > Other *NIX Forums > *BSD

All times are GMT -5. The time now is 10:59 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration