[Snort-users] Snort and Barnyard2

Josh Bitto jbitto at ...16055...
Thu Feb 7 19:20:32 EST 2013


Nevermind.....I didn't have enough rows optioned into the query...



From: Josh Bitto [mailto:jbitto at ...16055...]
Sent: Thursday, February 07, 2013 4:15 PM
To: Y M; beenph
Cc: snort-users at lists.sourceforge.net
Subject: Re: [Snort-users] Snort and Barnyard2

I just noticed something I ran the query and the data for timesamp has about 1000 rows.....but there's only one day on it...I know there have been several days of reporting. Any thoughts as to why it's only limited to that one day?

I've set my log file size to 10000 mb so I don't believe that is the issue.




From: Y M [mailto:snort at ...15979...]
Sent: Wednesday, February 06, 2013 8:37 PM
To: Josh Bitto; beenph
Cc: snort-users at lists.sourceforge.net<mailto:snort-users at ...3783...net>; barnyard2-users at ...14071...<mailto:barnyard2-users at ...14071...>
Subject: RE: [Snort-users] Snort and Barnyard2

Yes it can be done. Try the following query:


 SELECT
               signature.sig_name AS 'Signature Name',
               event.timestamp AS 'Timestamp',
               INET_NTOA(iphdr.ip_src) AS 'Source IP',
               INET_NTOA(iphdr.ip_dst) AS 'Destination IP',
               sig_class.sig_class_name AS 'Signature Class'
FROM
              signature LEFT JOIN event ON (signature.sig_id=event.signature)
              LEFT JOIN sig_class ON (signature.sig_class_id=sig_class.sig_class_id)
              LEFT JOIN iphdr ON (event.cid=iphdr.cid)
WHERE
              signature.sig_sid=<xxx>;


In this case, you would replace the "<xxx>" with your own signature sid that you are looking for. You can get rid of the WHERE clause to perform the same behavior on all the data, but that would be an overkill to your db server depending on the amount of data you have.

Perhaps not the most efficient query, but it will return data and columns in the following format:

Signature Name, Timestamp, Source IP, Destination IP, Signature Class

Please note that these are fancy formatting (the "AS 'Your favorite column name'" part in the query) of the column names for easier reading. Beenph, jump in if I am doing something wrong in my query here :)

YM
> From: jbitto at ...16055...<mailto:jbitto at ...16055...>
> To: beenph at ...11827...<mailto:beenph at ...11827...>; snort at ...15979...<mailto:snort at ...15979...>
> CC: snort-users at lists.sourceforge.net<mailto:snort-users at ...2652...e.net>; barnyard2-users at ...14071...<mailto:barnyard2-users at ...14071...>
> Date: Wed, 6 Feb 2013 13:21:41 -0800
> Subject: RE: [Snort-users] Snort and Barnyard2
>
> Ok so if I wanted to run a query where I wanted the src and dst IP plus view event and signature tables as well....Can that be done?
>
> Also....would running these query's have the data line up with the actual date and times that the event actually occurred?
>
>
>
> -----Original Message-----
> From: beenph [mailto:beenph at ...11827...]
> Sent: Wednesday, February 06, 2013 12:31 PM
> To: Y M
> Cc: Josh Bitto; snort-users at lists.sourceforge.net<mailto:snort-users at ...1753...s.sourceforge.net>; barnyard2-users at ...14071...<mailto:barnyard2-users at ...391...4071...>
> Subject: Re: [Snort-users] Snort and Barnyard2
>
> On Wed, Feb 6, 2013 at 2:43 PM, Y M <snort at ...15979...<mailto:snort at ...15052...979...>> wrote:
> > Sorry for not detailing my reply. For example try querying snort
> > database
> > with:
> >
> > SELECT ip_src, INET_NTOA(ip_src)
> > FROM acid_event;
>
> IP src/dst data in the default schema is not stored in the acid_event table but the iphdr table.
>
> So a query could look like this:
>
> Assuming mysql:
>
> SELECT INET_NTOA(ip_src),INET_NTOA(ip_dst) FROM iphdr WHERE sid="XXX"
> AND cid="XXX";
>
> >
> > From: Josh Bitto
> > Sent: 2/6/2013 10:05 PM
> > To: snort-users at lists.sourceforge.net<mailto:snort-users at ...2987...rge.net>
> > Subject: [Snort-users] Snort and Barnyard2
> >
> > Has anyone else had this issue come up where when you export the data
> > from your database the IP's listed do not correspond with the actual
> > IP addresses that have been captured when an event happens?
> >
> >
>
> Now, i am not sure i understand what Josh Bitto mean by "the store IP are not the same as the captured IP".
> barnyard2 will store whats found in the unified2 file, did you validate the content of your unified2 file using u2spewfoo or u2boat to export contained packets to pcap file and compare that information?
>
> -elz
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.snort.org/pipermail/snort-users/attachments/20130207/46a2861c/attachment.html>


More information about the Snort-users mailing list