Hello to all;
First, sorry for the length. I just wanted to give everyone as much info as possible and try not to waste anyone’s time.
I’m having an issue where I can’t get my mysql database loaded with data from my snort.u2.timestamp file.
Details of what’s running:
Ubuntu 12.04.1
snort Version 2.9.3 IPv6 GRE (Build 37),
Barnyard2 reports Version 2.1.10 (Build 310)
Interfacing it all with SnortReports 1.3.3
Mysql - Server version: 5.5.24
I start snort with this:
sudo /usr/local/snort/bin/snort -u snort -g snort –c /usr/local/snort/etc/snort.conf -i eth1
Snort starts and runs with no problems.
I’m using unified2 files. I see the ‘snort.u2.timestamp’ file(s) incrementing in size as snort runs, as well as a file named ‘alert’. Also looks like barnyard2.waldo gets updated accordingly. I have a local rule for ICMP to generate activity for testing.
I kickoff barnyard2 with this:
sudo /usr/local/bin/barnyard2 -c /usr/local/snort/etc/barnyard2.conf -G /usr/local/snort/etc/gen-msg.map -S /usr/local/snort/etc/sid-msg.map -d /var/log/snort -f snort.u2 -w /var/log/snort/barnyard2.waldo
Output line in barnyard2.conf is this:
output database: log, mysql, user=snort password=xxxxxxxxx dbname=snort host=localhost
(I have also tried alert, “output database: alert, mysql, etc”)
During startup I get these “dup signature” warning messages. I get 23969 of them (signature id goes to 23969 on last warning):
WARNING: While processing data parsed from SIGNATURE FILE a duplicate entry was found [DUPLICATE ARE NOT PROCESSED]:
Generator ID:[1] Signature ID:[660] Revision:[0] Classification ID:[0]
Message [SERVER-MAIL expn root]
WARNING: While processing data parsed from SIGNATURE FILE a duplicate entry was found [DUPLICATE ARE NOT PROCESSED]:
Generator ID:[1] Signature ID:[661] Revision:[0] Classification ID:[0]
I assume there is some duplicity in my sig files but I’m not sure if this is a problem because it says (DUP ARE NOT PROCESSED) and it says they are warnings.
Here are more by2 startup messages:
database: [SynchronizeEventId()]: Problems executing [SELECT MAX(cid) FROM data WHERE sid='1';]
database: [SynchronizeEventId()]: Problems executing [SELECT MAX(cid) FROM event WHERE sid='1';]
database: [SynchronizeEventId()]: Problems executing [SELECT MAX(cid) FROM icmphdr WHERE sid='1';]
database: [SynchronizeEventId()]: Problems executing [SELECT MAX(cid) FROM iphdr WHERE sid='1';]
database: [SynchronizeEventId()]: Problems executing [SELECT MAX(cid) FROM opt WHERE sid='1';]
database: [SynchronizeEventId()]: Problems executing [SELECT MAX(cid) FROM tcphdr WHERE sid='1';]
database: [SynchronizeEventId()]: Problems executing [SELECT MAX(cid) FROM udphdr WHERE sid='1';]
[SignatureReferencePullDataStore()]: No Reference found in database ...
database: compiled support for (mysql)
database: configured to use mysql
database: schema version = 107
database: host = localhost
database: user = snort
database: database name = snort
database: sensor name = localhost:eth1
database: sensor id = 1
database: sensor cid = 1
database: data encoding = hex
database: detail level = full
database: ignore_bpf = no
database: using the "log" facility
by2 messages showing it using waldo:
--== Initialization Complete ==--
______ -*> Barnyard2 <*-
/ ,,_ \ Version 2.1.10 (Build 310)
|o" )~| By Ian Firns (SecurixLive): http://www.securixlive.com/
+ '''' + (C) Copyright 2008-2012 Ian Firns <>
Using waldo file '/var/log/snort/barnyard2.waldo':
spool directory = /var/log/snort
spool filebase = snort.u2
time_stamp = 1349268804
record_idx = 4099
Opened spool file '/var/log/snort/snort.u2.1349268804'
Waiting for new data
Then, as snort continues to run I get these messages from by2:
Closing spool file '/var/log/snort/snort.u2.1349268804'. Read 4099 records
Opened spool file '/var/log/snort/snort.u2.1349269934'
WARNING database [Database()]: Called with Event[0x0] Event Type [0] (P)acket [0x9486188]
WARNING database [Database()]: Called with Event[0x0] Event Type [0] (P)acket [0x956c1b0]
WARNING database [Database()]: Called with Event[0x0] Event Type [0] (P)acket [0x94e6330]
WARNING database [Database()]: Called with Event[0x0] Event Type [0] (P)acket [0x9470860]
WARNING database [Database()]: Called with Event[0x0] Event Type [0] (P)acket [0xaa95578]
WARNING database [Database()]: Called with Event[0x0] Event Type [0] (P)acket [0xa908fc0]
WARNING database [Database()]: Called with Event[0x0] Event Type [0] (P)acket [0xa58c4f0]
WARNING database [Database()]: Called with Event[0x0] Event Type [0] (P)acket [0x9cb8220]
WARNING database [Database()]: Called with Event[0x0] Event Type [0] (P)acket [0x98f2848]
WARNING database [Database()]: Called with Event[0x0] Event Type [0] (P)acket [0x952a440]
I get quite a few of these warnings. (one for every record snort puts into the ‘snort.u2.timestamp’ file and by2 tries to process???) I’m guessing that by2 is trying to process the snort.u2 file into the snort database but can’t (for some reason) thus giving me this WARNING message.
Things done up to now:
I’ve double-check all mysql password, grants and permissions and all seem ok.
Deleted and recreated and reloaded the snort database.
Here’s my snort tables:
mysql> show tables;
+------------------+
| Tables_in_snort |
+------------------+
| data |
| detail |
| encoding |
| event |
| icmphdr |
| iphdr |
| opt |
| reference |
| reference_system |
| schema |
| sensor |
| sig_class |
| sig_reference |
| signature |
| tcphdr |
| udphdr |
+------------------+
Found out ‘event’ is supposed to look like this:
mysql select * from event;
+-----+-----+-----------+---------------------+
| sid | cid | signature | timestamp |
+-----+-----+-----------+---------------------+
| 1 | 1 | 1 | 2004-11-06 03:24:51 |
| 1 | 2 | 1 | 2004-11-06 03:24:57 |
| 1 | 3 | 2 | 2004-11-06 03:32:41 |
| 1 | 4 | 2 | 2004-11-06 03:32:47 |
| 1 | 5 | 3 | 2004-11-06 03:33:29 |
| 1 | 6 | 3 | 2004-11-06 03:33:35 |
| 1 | 7 | 4 | 2004-11-06 03:33:41 |
| 1 | 8 | 4 | 2004-11-06 03:33:47 |
| 1 | 9 | 5 | 2004-11-06 03:34:53 |
| 1 | 10 | 5 | 2004-11-06 03:34:59 |
| 1 | 11 | 6 | 2004-11-06 03:35:05 |
| 1 | 12 | 6 | 2004-11-06 03:35:11 |
| 1 | 13 | 7 | 2004-11-06 03:35:17 |
| 1 | 14 | 7 | 2004-11-06 03:35:23 |
| 1 | 15 | 7 | 2004-11-06 03:37:42 |
+-----+-----+-----------+---------------------+
But mine is empty and looks like this:
mysql> select * from event;
Empty set (0.00 sec)
Here is my sensor table: (I have just one sensor at the time)
mysql> select * from sensor;
+-----+----------------+-----------+--------+--------+----------+----------+
| sid | hostname | interface | filter | detail | encoding | last_cid |
+-----+----------------+-----------+--------+--------+----------+----------+
| 1 | localhost:eth1 | eth1 | NULL | 1 | 0 | 0 |
+-----+----------------+-----------+--------+--------+----------+----------+
1 row in set (0.00 sec)
Also, re-installed barnyard2 after re-downloading, thinking something was corrupt.
Thanks to anyone for your time and assistance. -Kevin
Hey Eric:
A very, very late update, but did want to get back to you.
I did start SNORT as suggested:
>Can you remove your -G and -S Command line arguments and rerun the process?
This did get rid of the “SIG FILE "duplicate entry” warnings.
Thank you for that.
I still get the:
“barnyard2: spo_database.c:1665: dbProcessSignatureInformation: Assertion `data->mc.cacheSignatureHead->obj.db_id != 0' failed.” error.
Moving forward update:
I was able to find, (scavenge), a better server (core 2 duo) and was able to build everything under 64bit. This system is working great. I must have “dinked” something up in the other build, so I’m abandoning that one.
I just want to thank you for all your help and assistance.
It truly is/was appreciated.
-Kevin