<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Niels Horn&#039;s Blog &#187; Monitoring</title>
	<atom:link href="http://blog.nielshorn.net/category/monitoring/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.nielshorn.net</link>
	<description>Random thoughts, tips &#38; tricks about Slackware-Linux, Lego and Star Wars</description>
	<lastBuildDate>Thu, 05 Jan 2012 02:40:08 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>NTOP 4.1.0 on Slackware &#8211; Packages available</title>
		<link>http://blog.nielshorn.net/2011/08/ntop-4-1-0-on-slackware-packages-available/</link>
		<comments>http://blog.nielshorn.net/2011/08/ntop-4-1-0-on-slackware-packages-available/#comments</comments>
		<pubDate>Fri, 26 Aug 2011 03:05:53 +0000</pubDate>
		<dc:creator>Niels Horn</dc:creator>
				<category><![CDATA[ARMedslack]]></category>
		<category><![CDATA[Slackware]]></category>
		<category><![CDATA[ntop]]></category>

		<guid isPermaLink="false">http://blog.nielshorn.net/?p=1118</guid>
		<description><![CDATA[A few days ago ntop 4.1.0 was released so it was time to update my SlackBuild script again  
This release is focused on stability and speed, solving some of the problems the 4.0.x series had.
Some &#8220;older&#8221; protocols have been removed (but may come back in rewritten form in future versions), making space for newer [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.nielshorn.net/wp-content/uploads/2010/08/ntop.png"><img src="http://blog.nielshorn.net/wp-content/uploads/2010/08/ntop.png" alt="ntop" title="ntop" width="103" height="50" class="alignleft size-full wp-image-528" /></a>A few days ago <a href="http://www.ntop.org/">ntop</a> 4.1.0 was <a href="http://www.ntop.org/blog/ntop/released-ntop-4-1/">released</a> so it was time to update my SlackBuild script again <img src='http://blog.nielshorn.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>This release is focused on stability and speed, solving some of the problems the 4.0.x series had.<br />
Some &#8220;older&#8221; protocols have been removed (but may come back in rewritten form in future versions), making space for newer &#8220;protocols&#8221; like twitter or facebook.</p>
<p>I already submitted the new SlackBuild script and the packages (including one for ARMedslack) are being uploaded to my <a href="http://www.nielshorn.net/slackware/slack_pkg.php">site</a>.<br />
And, while you&#8217;re updating ntop, check if your GeoIP and graphviz packages are up-to-date, as new versions have been released for these dependencies as well (and are available also on my site).</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nielshorn.net/2011/08/ntop-4-1-0-on-slackware-packages-available/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Nagios 3.3.1 is out! And the Slackware packages are ready</title>
		<link>http://blog.nielshorn.net/2011/07/nagios-3-3-1-is-out-and-the-slackware-packages-are-ready/</link>
		<comments>http://blog.nielshorn.net/2011/07/nagios-3-3-1-is-out-and-the-slackware-packages-are-ready/#comments</comments>
		<pubDate>Wed, 27 Jul 2011 04:29:30 +0000</pubDate>
		<dc:creator>Niels Horn</dc:creator>
				<category><![CDATA[Slackware]]></category>
		<category><![CDATA[nagios]]></category>

		<guid isPermaLink="false">http://blog.nielshorn.net/?p=1065</guid>
		<description><![CDATA[Nagios 3.3.1 was released a few days ago and since it is a program I like a lot, I immediately started working on the updated SlackBuild script.
What is new
The complete ChangeLog for version 3.3.1 can be found here. Basically, it contains several improvements and bug-fixes &#8220;under the hood&#8221;, but it also has some new enhancements [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://blog.nielshorn.net/wp-content/uploads/2010/09/nagios.png" alt="nagios" title="nagios" width="295" height="70" class="alignleft size-full wp-image-548" />Nagios</a> 3.3.1 was released a few days ago and since it is a program I like a lot, I immediately started working on the updated SlackBuild script.</p>
<p><strong>What is new</strong><br />
The complete ChangeLog for version 3.3.1 can be found <a href="http://www.nagios.org/projects/nagioscore/history/core-3x">here</a>. Basically, it contains several improvements and bug-fixes &#8220;under the hood&#8221;, but it also has some new enhancements &#8220;on the outside&#8221;:</p>
<ul>
<li>A new and refreshing &#8220;exfoliation&#8221; theme</li>
<li>The documentation link now goes to the on-line docs, always showing the newest information</li>
<li>The &#8220;home&#8221; page shows links to current events from Nagios</li>
</ul>
<p><strong>What it looks like</strong><br />
Well, here are just two simple screenshots from Nagios running on my home network&#8230;</p>
<p>This is the new &#8220;home&#8221; screen of Nagios:<br />
<a href="http://blog.nielshorn.net/wp-content/uploads/2011/07/nagios_331_a.png"><img src="http://blog.nielshorn.net/wp-content/uploads/2011/07/nagios_331_a-300x196.png" alt="nagios_331_a" title="nagios_331_a" width="300" height="196" class="aligncenter size-medium wp-image-1068" /></a></p>
<p>And this is the new &#8220;Tactical overview&#8221; (yes, I have 13 hosts at home):<br />
<a href="http://blog.nielshorn.net/wp-content/uploads/2011/07/nagios_331_b.png"><img src="http://blog.nielshorn.net/wp-content/uploads/2011/07/nagios_331_b-300x195.png" alt="nagios_331_b" title="nagios_331_b" width="300" height="195" class="aligncenter size-medium wp-image-1069" /></a></p>
<p><strong>Where to get it</strong><br />
As always, the new script has been submitted to <a href="http://slackbuilds.org/">SlackBuilds.org</a> and the pre-built packages are available on <a href="http://www.nielshorn.net/slackware/slack_pkg.php">my site</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nielshorn.net/2011/07/nagios-3-3-1-is-out-and-the-slackware-packages-are-ready/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>New packages for LibreOffice, Freeciv and Zabbix</title>
		<link>http://blog.nielshorn.net/2011/02/new-packages-for-libreoffice-freeciv-and-zabbix/</link>
		<comments>http://blog.nielshorn.net/2011/02/new-packages-for-libreoffice-freeciv-and-zabbix/#comments</comments>
		<pubDate>Sun, 13 Feb 2011 22:03:47 +0000</pubDate>
		<dc:creator>Niels Horn</dc:creator>
				<category><![CDATA[ARMedslack]]></category>
		<category><![CDATA[LibreOffice]]></category>
		<category><![CDATA[Slackware]]></category>
		<category><![CDATA[zabbix]]></category>

		<guid isPermaLink="false">http://blog.nielshorn.net/?p=935</guid>
		<description><![CDATA[The year 2011 started with changes and lots of work, so I have been without time to work on most private projects, including the SlackBuild scripts I maintain.
But things are clearing up and I found some time this weekend to update some scripts &#8211; the ones most people asked me about  
Actually, this was [...]]]></description>
			<content:encoded><![CDATA[<p>The year 2011 started with changes and lots of work, so I have been without time to work on most private projects, including the <a href="http://slackbuilds.org/">SlackBuild</a> scripts I maintain.<br />
But things are clearing up and I found some time this weekend to update some scripts &#8211; the ones most people asked me about <img src='http://blog.nielshorn.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Actually, this was a nice popularity test&#8230; I received *lots* of e-mails asking about an update for <a href="http://www.libreoffice.org/">LibreOffice</a>, which reached the stable stage with version 3.3.0.<br />
Next in order of requests was <a href="http://www.zabbix.com/">Zabbix</a>, for the new version 1.8.4.<br />
And third in line was <a href="http://www.freeciv.org/">FreeCiv</a> &#8211; the game.</p>
<p>These updates were long over due but they are all in the pending queue on SlackBuilds.org now.<br />
As I write this I&#8217;m also uploading everything to my <a href="http://www.nielshorn.net/slackware/slack_pkg.php">site</a>, for those who can&#8217;t wait <img src='http://blog.nielshorn.net/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>I&#8217;ll do some more updates soonish, so keep following the news here&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nielshorn.net/2011/02/new-packages-for-libreoffice-freeciv-and-zabbix/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>December updates &#8211; lbench, snort and daq</title>
		<link>http://blog.nielshorn.net/2010/12/december-updates-lbench-snort-and-daq/</link>
		<comments>http://blog.nielshorn.net/2010/12/december-updates-lbench-snort-and-daq/#comments</comments>
		<pubDate>Sun, 26 Dec 2010 15:20:44 +0000</pubDate>
		<dc:creator>Niels Horn</dc:creator>
				<category><![CDATA[ARMedslack]]></category>
		<category><![CDATA[Slackware]]></category>
		<category><![CDATA[snort]]></category>

		<guid isPermaLink="false">http://blog.nielshorn.net/?p=922</guid>
		<description><![CDATA[December has been a busy month until now and probably will continue like this&#8230;
But today is Christmas, a good day to give some new packages to my visitors  
Recently version 1.6 of lbench was released, a benchmark utility.
And last week version 2.9.0.3 of snort, the Intrusion Detection software, and version 0.5 of daq, the [...]]]></description>
			<content:encoded><![CDATA[<p>December has been a busy month until now and probably will continue like this&#8230;<br />
But today is Christmas, a good day to give some new packages to my visitors <img src='http://blog.nielshorn.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Recently version 1.6 of <a href="http://kornelix.squarespace.com/lbench/">lbench</a> was released, a benchmark utility.<br />
And last week version 2.9.0.3 of <a href="http://www.snort.org/">snort</a>, the Intrusion Detection software, and version 0.5 of daq, the Data Acquisition libray, were published.</p>
<p>I updated and submitted my SlackBuilds scripts to <a href="http://slackbuilds.org/">SBo</a> and put the pre-built packages for Slackware, Slackware64 and ARMedslack on my <a href="http://www.nielshorn.net/slackware/slack_pkg.php">site</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nielshorn.net/2010/12/december-updates-lbench-snort-and-daq/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Snort 2.9.0.1 and daq 0.3 released &#8211; Slackware packages available</title>
		<link>http://blog.nielshorn.net/2010/11/snort-2-9-0-1-and-daq-0-3-released-slackware-packages-available/</link>
		<comments>http://blog.nielshorn.net/2010/11/snort-2-9-0-1-and-daq-0-3-released-slackware-packages-available/#comments</comments>
		<pubDate>Sat, 20 Nov 2010 02:40:10 +0000</pubDate>
		<dc:creator>Niels Horn</dc:creator>
				<category><![CDATA[ARMedslack]]></category>
		<category><![CDATA[Barnyard2]]></category>
		<category><![CDATA[Slackware]]></category>
		<category><![CDATA[snort]]></category>

		<guid isPermaLink="false">http://blog.nielshorn.net/?p=873</guid>
		<description><![CDATA[The beginning of this month a new version of Snort was released &#8211; 2.9.0.1. The companion Data Acquisition library (daq) was also upgraded to version 0.3.
I updated my SlackBuilds and installed the new versions on my server. I waited a bit before releasing the packages as there had been some reports on a new &#8220;Unknown [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.nielshorn.net/wp-content/uploads/2010/09/snort.png"><img src="http://blog.nielshorn.net/wp-content/uploads/2010/09/snort.png" alt="snort" title="snort" width="231" height="128" class="alignleft size-full wp-image-604" /></a>The beginning of this month a new version of <a href="http://www.snort.org/">Snort</a> was released &#8211; 2.9.0.1. The companion Data Acquisition library (daq) was also upgraded to version 0.3.</p>
<p>I updated my SlackBuilds and installed the new versions on my server. I waited a bit before releasing the packages as there had been some reports on a new &#8220;Unknown record type&#8221; in Barnyard2, this time with record type 110. Read my previous posts <a href="http://blog.nielshorn.net/2010/10/barnyard2-solving-the-unknown-record-type-errors/">here</a> and <a href="http://blog.nielshorn.net/2010/11/barnyard2-unknown-record-type-read-110/">here</a> to learn more details about this problem.</p>
<p>For the &#8220;110&#8243; record type the workaround is disabling the &#8220;inspect_gzip&#8221; option in the snort.conf flie, while the authors of Barnyard2 work on a new release.</p>
<p>For daq-0.3 and snort-2.9.0.1 I submitted the new SlackBuilds and pre-built packages for Slackware, Slackware64 and ARMedslack are available on my <a href="http://www.nielshorn.net/slackware/slack_pkg.php">site</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nielshorn.net/2010/11/snort-2-9-0-1-and-daq-0-3-released-slackware-packages-available/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Barnyard2 &#8211; Unknown record type read: 110</title>
		<link>http://blog.nielshorn.net/2010/11/barnyard2-unknown-record-type-read-110/</link>
		<comments>http://blog.nielshorn.net/2010/11/barnyard2-unknown-record-type-read-110/#comments</comments>
		<pubDate>Thu, 11 Nov 2010 10:30:00 +0000</pubDate>
		<dc:creator>Niels Horn</dc:creator>
				<category><![CDATA[Barnyard2]]></category>
		<category><![CDATA[snort]]></category>

		<guid isPermaLink="false">http://blog.nielshorn.net/?p=843</guid>
		<description><![CDATA[After my post about the &#8220;Unknown record type 104&#8243; problem in Barnyard2, I received several e-mails recently about a new error that started popping up:
ERROR: Unknown record type read: 110
I had not seen this one myself, but did some quick investigating and found out that it is a new record type in Snort 2.9.0
This new [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.nielshorn.net/wp-content/uploads/2010/09/Barnyard2.png"><img src="http://blog.nielshorn.net/wp-content/uploads/2010/09/Barnyard2.png" alt="Barnyard2" title="Barnyard2" width="120" height="120" class="alignleft size-full wp-image-667" /></a>After <a href="http://blog.nielshorn.net/2010/10/barnyard2-solving-the-unknown-record-type-errors/">my post</a> about the &#8220;Unknown record type 104&#8243; problem in Barnyard2, I received several e-mails recently about a new error that started popping up:</p>
<pre>ERROR: Unknown record type read: 110</pre>
<p>I had not seen this one myself, but did some quick investigating and found out that it is a new record type in Snort 2.9.0<br />
This new record type is called “Unified2_Extra_Data” and is used for gzip and XFF data.</p>
<p>Barnyard2 will need to be adapted to recognize these new types and this will hopefully happen soon&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nielshorn.net/2010/11/barnyard2-unknown-record-type-read-110/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Barnyard2 &#8211; Solving the &#8220;Unknown record type&#8221; errors</title>
		<link>http://blog.nielshorn.net/2010/10/barnyard2-solving-the-unknown-record-type-errors/</link>
		<comments>http://blog.nielshorn.net/2010/10/barnyard2-solving-the-unknown-record-type-errors/#comments</comments>
		<pubDate>Mon, 11 Oct 2010 02:21:51 +0000</pubDate>
		<dc:creator>Niels Horn</dc:creator>
				<category><![CDATA[Barnyard2]]></category>
		<category><![CDATA[Patches]]></category>

		<guid isPermaLink="false">http://blog.nielshorn.net/?p=736</guid>
		<description><![CDATA[When experimenting with the new Snort version 2.9.0 I ran into some problems with Barnyard2. It would simply crash with errors like:
ERROR: Unknown record type read: 104
Fatal Error, Quitting..
I started looking for information on the internet (Google is our friend&#8230;), and found out that at least I was not alone  
Similar problems
Basically, I found [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.nielshorn.net/wp-content/uploads/2010/09/Barnyard2.png"><img src="http://blog.nielshorn.net/wp-content/uploads/2010/09/Barnyard2.png" alt="Barnyard2" title="Barnyard2" width="120" height="120" class="alignleft size-full wp-image-667" /></a>When experimenting with the new Snort version 2.9.0 I ran into some problems with <a href="http://www.securixlive.com/barnyard2/index.php">Barnyard2</a>. It would simply crash with errors like:</p>
<pre>ERROR: Unknown record type read: 104
Fatal Error, Quitting..</pre>
<p>I started looking for information on the internet (<a href="http://www.google.com/">Google</a> is our friend&#8230;), and found out that at least I was not alone <img src='http://blog.nielshorn.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><strong>Similar problems</strong></p>
<p>Basically, I found two types of reports:</p>
<ol>
<li>some with record types like <code>2148576734</code>, <code>1697542248</code>, <code>3569595041</code>, etc.</li>
<li>others more like the error I received, with the unknown record type being either <code>104</code> (like mine) or <code>105</code></li>
</ol>
<p><strong>Error type 1 (apparently random record types)</strong></p>
<p>These errors are caused by reading a log from Snort that is not in the &#8220;unified2&#8243; format. Barnyard2 only uses the newer unified2 log format from Snort as input.<br />
The solution is to check your Snort configuration file and change it to use the newer format.</p>
<p><strong>Error type 2 (record types 104 and 105)</strong></p>
<p>The first &#8220;solution&#8221; I found was removing two parameters in the Snort configuration file for the unified2 log format, <code>mpls_event_types</code> and <code>vlan_event_types</code>.<br />
The default line in the Snort 2.9.0 configuration reads:</p>
<pre>output unified2: filename merged.log, limit 128, nostamp, mpls_event_types, vlan_event_types</pre>
<p>For Barnyard I already had to remove the &#8220;nostamp&#8221; parameter, as it prefers to work with the time-stamp extensions.<br />
I do not use the mpls option in Snort, but the vlan ID can be useful&#8230;</p>
<p>To get Snort working, I removed the two parameters, but was not satisfied. <img src='http://blog.nielshorn.net/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
<p><strong>Finding a real solution &#8211; Start examining the source code!</strong></p>
<p>After reading through the source code of Barnyard2 and of the new u2spewfoo utility that comes with Snort 2.9.0, I found out that these record types are from version 2 of the Unified2 record format.<br />
In the Barnyard2 source file <code>unified2.h</code> the definitions can be found:</p>
<pre>#define UNIFIED2_EVENT 1
#define UNIFIED2_PACKET 2
#define UNIFIED2_IDS_EVENT 7
#define UNIFIED2_EVENT_EXTENDED 66
#define UNIFIED2_PERFORMANCE 67
#define UNIFIED2_PORTSCAN 68
#define UNIFIED2_IDS_EVENT_IPV6 72
#define UNIFIED2_IDS_EVENT_MPLS 99
#define UNIFIED2_IDS_EVENT_IPV6_MPLS 100

//version 2
#define UNIFIED2_IDS_EVENT_V2 104
#define UNIFIED2_IDS_EVENT_IPV6_V2 105</pre>
<p>So, if Barnyard2 knows about the record types, why can&#8217;t it process them?<br />
Well, I found that in <code>spi_unified2.c</code> there was this piece of code:</p>
<pre>int Unified2ReadRecord(void *sph)
{
        DEBUG_WRAP(DebugMessage(DEBUG_LOG,"Reading record type=%u (%u bytes)\n", ntohl(u2hdr.type), ntohl(u2hdr.length)););

        switch (ntohl(u2hdr.type))
        {
                case UNIFIED2_IDS_EVENT:
                        return Unified2ReadEventRecord(sph);
                        break;
                case UNIFIED2_IDS_EVENT_IPV6:
                        return Unified2ReadEvent6Record(sph);
                        break;
                case UNIFIED2_PACKET:
                        return Unified2ReadPacketRecord(sph);
                        break;
        default:
                        FatalError("Unknown record type read: %u\n", ntohl(u2hdr.type));
            break;
        }

        return -1;
}</pre>
<p>This means that it will simply show an error message <code>Unknown record type read: ...</code> when it encounters anything different from type 7, 72 or 2. And that&#8217;s exactly what it does in our case <img src='http://blog.nielshorn.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>This gave me something to start working on&#8230;<br />
I first wrote a quick patch to simply recognize and handle record type 104 and sent it to the development team to check if this was the way to go. They answered me that it was, so I completed the patch with record type 105 (which is for ip6) and included the necessary routines for the debugging mode.</p>
<p>This is the resulting patch:</p>
<pre>--- barnyard2-1.8_orig/src/input-plugins/spi_unified2.c    2010-03-03 08:03:12.000000000 -0300
+++ barnyard2-1.8/src/input-plugins/spi_unified2.c    2010-10-09 23:31:17.000000000 -0300
@@ -62,11 +62,15 @@

 int Unified2ReadEventRecord(void *);
 int Unified2ReadEvent6Record(void *);
+int Unified2ReadEventRecordV2(void *);
+int Unified2ReadEvent6RecordV2(void *);
 int Unified2ReadPacketRecord(void *);

 void Unified2PrintCommonRecord(Unified2EventCommon *evt);
 void Unified2PrintEventRecord(Unified2Event *);
 void Unified2PrintEvent6Record(Unified2Event6 *evt);
+void Unified2PrintEventRecordV2(Unified2Event_v2 *);
+void Unified2PrintEvent6RecordV2(Unified2Event6_v2 *evt);
 void Unified2PrintPacketRecord(Unified2Packet *);

 /* restart/shutdown functions */
@@ -163,9 +167,15 @@
         case UNIFIED2_IDS_EVENT:
             return Unified2ReadEventRecord(sph);
             break;
+        case UNIFIED2_IDS_EVENT_V2:
+            return Unified2ReadEventRecordV2(sph);
+            break;
         case UNIFIED2_IDS_EVENT_IPV6:
             return Unified2ReadEvent6Record(sph);
             break;
+        case UNIFIED2_IDS_EVENT_IPV6_V2:
+            return Unified2ReadEvent6RecordV2(sph);
+            break;
         case UNIFIED2_PACKET:
             return Unified2ReadPacketRecord(sph);
             break;
@@ -221,6 +231,50 @@
     return -1;
 }

+int Unified2ReadEventRecordV2(void *sph)
+{
+    ssize_t                bytes_read;
+    int                 record_size;
+    Spooler                *spooler = (Spooler *)sph;
+
+    record_size = sizeof(Unified2Event_v2);
+
+    if(!spooler->record.data)
+    {
+        // SnortAlloc will FatalError if memory can't be assigned.
+        spooler->record.data=SnortAlloc(record_size);
+    }
+
+    if (spooler->offset < record_size)
+    {
+        /* in case we don't have it already */
+        bytes_read = read(spooler->fd, spooler->record.data + spooler->offset,
+                    record_size - spooler->offset);
+
+        if(bytes_read == -1)
+        {
+            LogMessage("ERROR: read error: %s\n", strerror(errno));
+            return BARNYARD2_FILE_ERROR;
+        }
+
+        if(bytes_read + spooler->offset != record_size)
+        {
+            spooler->offset += bytes_read;
+            return BARNYARD2_READ_PARTIAL;
+        }
+
+#ifdef DEBUG
+        Unified2PrintEventRecordV2((Unified2Event_v2 *)spooler->record.data);
+#endif
+
+        spooler->offset = 0;
+
+        return 0;
+    }
+
+    return -1;
+}
+
 int Unified2ReadEvent6Record(void *sph)
 {
     ssize_t                bytes_read;
@@ -265,6 +319,50 @@
     return -1;
 }

+int Unified2ReadEvent6RecordV2(void *sph)
+{
+    ssize_t                bytes_read;
+    int                 record_size;
+    Spooler                *spooler = (Spooler *)sph;
+
+    record_size = sizeof(Unified2Event6_v2);
+
+    if(!spooler->record.data)
+    {
+        /* SnortAlloc will FatalError if memory can't be assigned */
+        spooler->record.data=SnortAlloc(record_size);
+    }
+
+    if (spooler->offset < record_size)
+    {
+        /* in case we don't have it already */
+        bytes_read = read(spooler->fd, spooler->record.data + spooler->offset,
+                    record_size - spooler->offset);
+
+        if(bytes_read == -1)
+        {
+            LogMessage("ERROR: read error: %s\n", strerror(errno));
+            return BARNYARD2_FILE_ERROR;
+        }
+
+        if(bytes_read + spooler->offset != record_size)
+        {
+            spooler->offset += bytes_read;
+            return BARNYARD2_READ_PARTIAL;
+        }
+
+#ifdef DEBUG
+        Unified2PrintEvent6RecordV2((Unified2Event6_v2 *)spooler->record.data);
+#endif
+
+        spooler->offset = 0;
+
+        return 0;
+    }
+
+    return -1;
+}
+
 int Unified2ReadPacketRecord(void *sph)
 {
     ssize_t                bytes_read;
@@ -366,10 +464,66 @@
         "  packet_action      = %d\n", evt->packet_action););
 }

+void Unified2PrintEventRecordV2(Unified2Event_v2 *evt)
+{
+    char                sip4[INET_ADDRSTRLEN];
+    char                dip4[INET_ADDRSTRLEN];
+
+    if(evt == NULL)
+        return;
+
+    Unified2PrintEventCommonRecord((Unified2EventCommon *)evt);
+
+    inet_ntop(AF_INET, &#038;(evt->ip_source), sip4, INET_ADDRSTRLEN);
+    DEBUG_WRAP(DebugMessage(DEBUG_LOG,
+        "  ip_source          = %s\n", sip4););
+
+    DEBUG_WRAP(DebugMessage(DEBUG_LOG,
+        "  sport_itype        = %d\n", ntohs(evt->sport_itype)););
+    inet_ntop(AF_INET, &#038;(evt->ip_destination), dip4, INET_ADDRSTRLEN);
+    DEBUG_WRAP(DebugMessage(DEBUG_LOG,
+        "  ip_destination     = %s\n", dip4););
+    DEBUG_WRAP(DebugMessage(DEBUG_LOG,
+        "  dport_icode        = %d\n", ntohs(evt->dport_icode)););
+
+    DEBUG_WRAP(DebugMessage(DEBUG_LOG,
+        "  ip_protocol        = %d\n", evt->protocol););
+    DEBUG_WRAP(DebugMessage(DEBUG_LOG,
+        "  packet_action      = %d\n", evt->packet_action););
+}
+
 void Unified2PrintEvent6Record(Unified2Event6 *evt)
 {
     char                sip6[INET6_ADDRSTRLEN];
     char                dip6[INET6_ADDRSTRLEN];
+
+    if(evt == NULL)
+        return;
+
+    Unified2PrintEventCommonRecord((Unified2EventCommon *)evt);
+
+    inet_ntop(AF_INET6, &#038;(evt->ip_source), sip6, INET6_ADDRSTRLEN);
+    DEBUG_WRAP(DebugMessage(DEBUG_LOG,
+        "  ip_source          = %s\n", sip6););
+
+    DEBUG_WRAP(DebugMessage(DEBUG_LOG,
+        "  sport_itype        = %d\n", ntohs(evt->sport_itype)););
+    inet_ntop(AF_INET6, &#038;(evt->ip_destination), dip6, INET6_ADDRSTRLEN);
+    DEBUG_WRAP(DebugMessage(DEBUG_LOG,
+        "  ip_destination     = %s\n", dip6););
+    DEBUG_WRAP(DebugMessage(DEBUG_LOG,
+        "  dport_icode        = %d\n", ntohs(evt->dport_icode)););
+
+    DEBUG_WRAP(DebugMessage(DEBUG_LOG,
+        "  ip_protocol        = %d\n", evt->protocol););
+    DEBUG_WRAP(DebugMessage(DEBUG_LOG,
+        "  packet_action      = %d\n", evt->packet_action););
+}
+
+void Unified2PrintEvent6RecordV2(Unified2Event6_v2 *evt)
+{
+    char                sip6[INET6_ADDRSTRLEN];
+    char                dip6[INET6_ADDRSTRLEN];

     if(evt == NULL)
         return;</pre>
<p>The patch can also be downloaded <a href="http://www.nielshorn.net/_lib/download.php?file=barnyard2-1.8_unified2v2.patch*">here</a>.</p>
<p>The code could probably be optimized since there are many duplicate lines now, but I did not want to change too much.<br />
I sent the patch to the Barnyard2 developers and they may commit it in their git repository.<br />
It <em>looks</em> like this patch should work on the 1.9-beta version as well, but I have not tested this&#8230; YMMV!</p>
<p>I have been running the patched Barnyard2 for several hours now on my Snort server without problems, using the <code>vlan_event_types</code> parameter. <img src='http://blog.nielshorn.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nielshorn.net/2010/10/barnyard2-solving-the-unknown-record-type-errors/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Snort 2.9.0 released &#8211; Slackware packages available</title>
		<link>http://blog.nielshorn.net/2010/10/snort-2-9-0-released-slackware-packages-available/</link>
		<comments>http://blog.nielshorn.net/2010/10/snort-2-9-0-released-slackware-packages-available/#comments</comments>
		<pubDate>Sun, 10 Oct 2010 02:33:35 +0000</pubDate>
		<dc:creator>Niels Horn</dc:creator>
				<category><![CDATA[ARMedslack]]></category>
		<category><![CDATA[Slackware]]></category>
		<category><![CDATA[snort]]></category>

		<guid isPermaLink="false">http://blog.nielshorn.net/?p=720</guid>
		<description><![CDATA[A few days ago Snort 2.9.0 was released. The official announcement can be read here.
This new version brings some essential changes to Snort that needed special attention. 
New dependencies
libdnet is a &#8220;simplified, portable interface to several low-level networking routines&#8221; and has a SlackBuild on SlackBuilds.org.
daq is a new &#8220;Data Acquisition library&#8221; that can use several [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.nielshorn.net/wp-content/uploads/2010/09/snort.png"><img src="http://blog.nielshorn.net/wp-content/uploads/2010/09/snort.png" alt="snort" title="snort" width="231" height="128" class="alignleft size-full wp-image-604" /></a>A few days ago <a href="http://www.snort.org/">Snort</a> 2.9.0 was released. The official announcement can be read <a href="http://www.snort.org/news/2010/10/04/snort-2-9-0-released/">here</a>.<br />
This new version brings some essential changes to Snort that needed special attention. </p>
<p><strong>New dependencies</strong></p>
<p><em>libdnet</em> is a &#8220;simplified, portable interface to several low-level networking routines&#8221; and has a SlackBuild on <a href="http://slackbuilds.org/">SlackBuilds.org</a>.<br />
<em>daq</em> is a new &#8220;Data Acquisition library&#8221; that can use several sources for the packages to Snort. Its source is available on the Snort site. I wrote a simple SlackBuild script for it, that I submitted.</p>
<p><strong>Changes to default configuration</strong></p>
<p>The second change I encountered, was with the new default options in the snort.conf file.<br />
By default, the &#8220;nostamp&#8221;, &#8220;mpls_event_types&#8221; and &#8220;vlan_event_types&#8221; are enabled in the &#8220;unified2&#8243; log format, but Barnyard2 does not understand them.<br />
On the last two it actually crashes with this error:</p>
<pre>ERROR: Unknown record type read: 104
Fatal Error, Quitting..</pre>
<p>I sent an e-mail to the Barnyard2 mailing list, but I&#8217;m not sure if there will be an answer, as I found other requests that never received any response.<br />
For now I decided to disable these options in the standard configuration.</p>
<p>I also needed to include the &#8211;enable-zlib option at the configuration stage of building Snort, as the new default is to use this option.</p>
<p><strong>New unified2 tools</strong></p>
<p>Snort 2.9.0 comes with two new tools:</p>
<p><em>u2spewfoo</em> can read the binary unified2 logs and dump the output as text. This helped me to understand the problem I had with the &#8220;unknown event type&#8221; I encountered above.<br />
<em>u2boat</em> is a Unified2 Binary Output &#038; Alert Tool can convert the unified2 logs to standard tcpdump format.</p>
<p><strong>Conclusion</strong></p>
<p>So, after some struggling, I managed to update my Snort server and submitted the updated SlackBuild for version 2.9.0<br />
As always, I also prepared the packages for Slackware and ARMedslack, that are available on my <a href="http://www.nielshorn.net/slackware/slack_pkg.php">site</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nielshorn.net/2010/10/snort-2-9-0-released-slackware-packages-available/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Nagios 3.2.3 released</title>
		<link>http://blog.nielshorn.net/2010/10/nagios-3-2-3-released/</link>
		<comments>http://blog.nielshorn.net/2010/10/nagios-3-2-3-released/#comments</comments>
		<pubDate>Sat, 09 Oct 2010 12:23:09 +0000</pubDate>
		<dc:creator>Niels Horn</dc:creator>
				<category><![CDATA[ARMedslack]]></category>
		<category><![CDATA[Slackware]]></category>
		<category><![CDATA[nagios]]></category>

		<guid isPermaLink="false">http://blog.nielshorn.net/?p=716</guid>
		<description><![CDATA[Just over a month ago I wrote about the release of Nagios 3.2.2 and now it&#8217;s time to update already 
Nagios announced the release of version 3.2.3 a few days ago, resolving a few bugs. According to the announcement updating your installation is recommended.
Since the ChangeLog is quite short, I copy it here:

Fixes problem where [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.nielshorn.net/wp-content/uploads/2010/09/nagios.png"><img src="http://blog.nielshorn.net/wp-content/uploads/2010/09/nagios.png" alt="nagios" title="nagios" width="295" height="70" class="alignleft size-full wp-image-548" /></a>Just over a month ago I <a href="http://blog.nielshorn.net/2010/09/nagios-3-2-2-released-slackware-package-available/">wrote</a> about the release of <a href="http://www.nagios.org/">Nagios</a> 3.2.2 and now it&#8217;s time to update already <img src='http://blog.nielshorn.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
Nagios <a href="http://www.nagios.org/news/77-news-announcements/268-nagios-core-323-released">announced</a> the release of version 3.2.3 a few days ago, resolving a few bugs. According to the announcement updating your installation is recommended.</p>
<p>Since the ChangeLog is quite short, I copy it here:</p>
<ul>
<li>Fixes problem where disabling all active hosts/services was not taking effect</li>
<li>Fixes for compiler warnings</li>
<li>Fixes for format errors in event handler logging</li>
<li>Fixed incorrect info in sample nagios.cfg file for state_retention_file</li>
<li>Fixed broker_event_handler() to return ERR if data is NULL</li>
</ul>
<p>I already submitted the new SlackBuild script and the pre-built packages for Slackware (32/64/ARM) can be downloaded already from my <a href="http://www.nielshorn.net/slackware/slack_pkg.php">site</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.nielshorn.net/2010/10/nagios-3-2-3-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Snort / Barnyard2 / BASE &#8211; Complete installation on Slackware</title>
		<link>http://blog.nielshorn.net/2010/09/snort-barnyard2-base-complete-installation/</link>
		<comments>http://blog.nielshorn.net/2010/09/snort-barnyard2-base-complete-installation/#comments</comments>
		<pubDate>Thu, 23 Sep 2010 02:06:40 +0000</pubDate>
		<dc:creator>Niels Horn</dc:creator>
				<category><![CDATA[ARMedslack]]></category>
		<category><![CDATA[Slackware]]></category>
		<category><![CDATA[snort]]></category>

		<guid isPermaLink="false">http://blog.nielshorn.net/?p=612</guid>
		<description><![CDATA[Introduction
I have set up Snort a few times on a network to check for possible intrusion attempts. It is a very powerful tool to discover these attempts, based on rules that are frequently updated. Snort is a so-called &#8220;Intrusion Detection System&#8221; (=IDS), that can also be setup as a &#8220;Intrusion Prevention System&#8221;.
Recently I needed Snort [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Introduction</strong></p>
<p>I have set up <a href="http://www.snort.org/">Snort</a> a few times on a network to check for possible intrusion attempts. It is a very powerful tool to discover these attempts, based on rules that are frequently updated. Snort is a so-called &#8220;Intrusion Detection System&#8221; (=IDS), that can also be setup as a &#8220;Intrusion Prevention System&#8221;.<br />
Recently I needed Snort again and decided to finally organize my notes and write down everything in a single document, so that I would spend less time if I ever needed it do this all over again.</p>
<p>Snort is powerful, but to effectively use it, you need some extra tools.<br />
First of all, there is Barnyard2, a tool that reads Snorts binary logs (which are much faster than writing directly to a database)<br />
Second, you will probably want an easy web interface to see the result remotely, for which I use BASE.</p>
<p><strong>Preparations</strong></p>
<p>You will need a working setup of your httpd server &#8211; with php &#8211; and MySQL.<br />
I won&#8217;t explain how to do this, there are many tutorials available on the web. And &#8211; being quite honest &#8211; if you don&#8217;t know how to setup these programs, you&#8217;re probably not ready to setup or use an IDS <img src='http://blog.nielshorn.net/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p><strong>Installing and setting up Snort</strong></p>
<p><a href="http://blog.nielshorn.net/wp-content/uploads/2010/09/snort.png"><img src="http://blog.nielshorn.net/wp-content/uploads/2010/09/snort.png" alt="snort" title="snort" width="231" height="128" class="alignleft size-full wp-image-604" /></a>This part is actually quite simple:</p>
<p>1) <a href="http://www.nielshorn.net/slackware/slack_pkg.php">Get</a> or <a href="http://slackbuilds.org/repository/13.1/network/snort/">build</a> the Snort package and install it on your system<br />
2) Download recent <a href="https://www.snort.org/snort-rules">snort-rules</a> (*) and install them manually or with my script (**)</p>
<p>(*) You will need to register for free or buy a subscription to get the rules file.<br />
(**) I use a small script that is certainly not perfect, but you can <a href="http://www.nielshorn.net/_lib/download.php?file=snortrules_update">download</a> it and improve it as you wish.</p>
<p>3) Start Snort</p>
<p>You can use the following command to start Snort:</p>
<p><code># /etc/rc.d/rc.snort start</code></p>
<p>You can check if Snort is running with this command:</p>
<p><code># ps -ef | grep snort</code></p>
<p>Which should return something like:</p>
<pre> 7874 ?        00:18:46 snort</pre>
<p><strong>Installing and setting up Barnyard2</strong></p>
<p><a href="http://blog.nielshorn.net/wp-content/uploads/2010/09/Barnyard2.png"><img src="http://blog.nielshorn.net/wp-content/uploads/2010/09/Barnyard2.png" alt="Barnyard2" title="Barnyard2" width="120" height="120" class="alignleft size-full wp-image-667" /></a>The default setup of Snort creates binary logs in the &#8220;unified2&#8243; format. This is the fastest way Snort can work, handling even heavy traffic.<br />
Snort could also write directly to a database, but this takes some processor time and delays could cause packages to be missed.<br />
The solution is to use a separate program to read the binary logs and save the information to a database for research, statistics, browsing, etc.</p>
<p>Enter <a href="http://www.securixlive.com/barnyard2/index.php">Barnyard2</a> to the rescue!<br />
Barnyard2 is based on the original Snort Barnyard program, but modified to read the newer &#8220;unified2&#8243; log format.</p>
<p>1) <a href="http://www.nielshorn.net/slackware/slack_pkg.php">Get</a> or <a href="http://slackbuilds.org/">build</a> the barnyard2 package and install it on the same system you installed Snort on</p>
<p>Now let&#8217;s do a basic test to check if Snort is identifying intrusions and if Barnyard2 is parsing the log.<br />
Start Barnyard2 from the command line like this:</p>
<p><code># barnyard2 -d /var/log/snort -f snort.log</code></p>
<p>The parameters we passed are:</p>
<ul>
<li>-d /var/log/snort &#8211; the standard directory where Snort stores its log files</li>
<li>-f snort.log &#8211; the &#8220;base&#8221; name of the Snort log file (it is appended with a time-stamp)</li>
</ul>
<p>Barnyard2 will read its configuration file and start processing the Snort log. If there are already events in the log, they will be displayed.</p>
<p>Let&#8217;s check if Snort is working by doing a port-scan from another computer on the same network (doing this from the computer Snort is installed on won&#8217;t have any effect, as it wont pass through the network adapter and Snort will never notice it).<br />
You can do this with the following command:</p>
<p><code># nmap -A &lt;ip_address_of_snort_server&gt;</code></p>
<p>Snort should detect the port scan, write the event in its log, and Barnyard2 should display it.<br />
If all works fine, you can continue with the next step.</p>
<p>2) Create the database to store the events</p>
<p>You will need to set up the structure of the database:<br />
(replace the &lt;&#8230;&gt; with your real passwords)<br />
<code><br />
# cd /usr/doc/barnyard2-*/schemas<br />
# mysql -p<br />
Enter password: &lt;your_mysql_root_password&gt;<br />
</code><br />
Now inside MySQL:<br />
<code><br />
mysql> create database snort;<br />
mysql> grant create,select,update,insert,delete on snort.* to snort@localhost;<br />
mysql> set password for snort@localhost=PASSWORD('&lt;your_mysql_snort_password&gt;');<br />
mysql> exit<br />
</code><br />
Back at the prompt:<br />
<code><br />
 # mysql -p &lt; create_mysql snort<br />
Enter password: &lt;your_mysql_root_password&gt;<br />
</code></p>
<p>This will create the snort database and tables.</p>
<p>3) Configure Barnyard2</p>
<p>Open the /etc/barnyard2.conf file with your favorite editor (that&#8217;s VIm, of course&#8230;), go to the end of the file and edit one of the sample lines so that it looks like this:</p>
<p><code>output database: log, mysql, user=snort password=&lt;your_mysql_snort_password&gt; dbname=snort host=localhost</code></p>
<p>4) Start the Barnyard2 daemon</p>
<p>The package created with the SlackBuild script includes a file to start the daemon. use it like this:</p>
<p><code># /etc/rc.d/rc.barnyard2 start</code></p>
<p>The script only parses the <em>new</em> events from the log, to avoid duplicate entries in the database.</p>
<p>You can now check your MySQL database to see if the entries are saved there. I personally use phpmysql to check the database, but other tools exist.<br />
If needed, run the port-scan again.</p>
<p>If all is fine, we can now start installing BASE, the web front-end for Snort.</p>
<p><strong>Installing and setting up BASE</strong></p>
<p><a href="http://blog.nielshorn.net/wp-content/uploads/2010/09/base.png"><img src="http://blog.nielshorn.net/wp-content/uploads/2010/09/base.png" alt="base" title="base" width="104" height="38" class="alignleft size-full wp-image-668" /></a><a href="http://base.secureideas.net/">BASE</a> stands for Basic Analysis and Security Engine. It is a web-based tool to display and filter all events captured by Snort.</p>
<p>1) Install dependencies</p>
<p>BASE needs some other files to work properly. The first one is adodb, the PHP database abstraction library. A SlackBuild for this can be found on <a href="http://slackbuilds.org/">SlackBuilds.org</a> or a pre-built package can be downloaded from my <a href="http://www.nielshorn.net/slackware/slack_pkg.php">site</a>.</p>
<p>You will also need a few modules from the PHP &#8220;pear&#8221; library. Use these commands to download &#038; install them:</p>
<p><code># pear install Image_Color-1.0.4<br />
# pear install Image_Canvas-0.3.2<br />
# pear install Image_Graph-0.7.2</code></p>
<p>2) <a href="http://www.nielshorn.net/slackware/slack_pkg.php">Get</a> or <a href="http://slackbuilds.org/">build</a> BASE and install the package</p>
<p>3) Configure BASE</p>
<p>After installing the dependencies and the package, point your web browser to <code>http://&lt;your_snort_server&gt;/base</code> and the first configuration screen should show up:</p>
<p><a href="http://blog.nielshorn.net/wp-content/uploads/2010/09/BASE_1.png"><img src="http://blog.nielshorn.net/wp-content/uploads/2010/09/BASE_1-300x197.png" alt="BASE_1" title="BASE_1" width="300" height="197" class="aligncenter size-medium wp-image-637" /></a><br />
For safety, the directory where the configuration file will be stored does not give write access to the web server, so after finishing the next steps, you will need to create this file by copying the parameters and pasting them into a text file on the console.</p>
<p>Click on &#8220;continue&#8221; and select your language in the next screen:</p>
<p><a href="http://blog.nielshorn.net/wp-content/uploads/2010/09/BASE_2.png"><img src="http://blog.nielshorn.net/wp-content/uploads/2010/09/BASE_2-300x70.png" alt="BASE_2" title="BASE_2" width="300" height="70" class="aligncenter size-medium wp-image-640" /></a></p>
<p>If you installed adodb from the standard SlackBuild or package, use <code>/var/www/htdocs/adodb</code> for its location, and click on continue.</p>
<p>The next screen will ask the parameters to connect to your database:</p>
<p><a href="http://blog.nielshorn.net/wp-content/uploads/2010/09/BASE_3.png"><img src="http://blog.nielshorn.net/wp-content/uploads/2010/09/BASE_3-300x166.png" alt="BASE_3" title="BASE_3" width="300" height="166" class="aligncenter size-medium wp-image-643" /></a></p>
<p>Since we set up the database on the same server as Snort and Barnyard2, use &#8220;localhost&#8221; as the database host.</p>
<p>After clicking on continue, screen number 3 will appear:</p>
<p><a href="http://blog.nielshorn.net/wp-content/uploads/2010/09/BASE_41.png"><img src="http://blog.nielshorn.net/wp-content/uploads/2010/09/BASE_41-300x84.png" alt="BASE_4" title="BASE_4" width="300" height="84" class="aligncenter size-medium wp-image-645" /></a></p>
<p>Select the check-box and choose whatever name you prefer for the administrator (I used &#8220;admin&#8221; in this example) and create a password and a full name (like &#8220;Administrator&#8221; in my example).</p>
<p>Click on continue again to go to the next step:</p>
<p><a href="http://blog.nielshorn.net/wp-content/uploads/2010/09/BASE_5.png"><img src="http://blog.nielshorn.net/wp-content/uploads/2010/09/BASE_5-300x66.png" alt="BASE_5" title="BASE_5" width="300" height="66" class="aligncenter size-medium wp-image-647" /></a></p>
<p>Here BASE will try to include some extra needed tables for the &#8220;Alert Groups&#8221; in the database we created before. Click on &#8220;Create BASE AG&#8221; and you should see this screen:</p>
<p><a href="http://blog.nielshorn.net/wp-content/uploads/2010/09/BASE_5b.png"><img src="http://blog.nielshorn.net/wp-content/uploads/2010/09/BASE_5b-300x151.png" alt="BASE_5b" title="BASE_5b" width="300" height="151" class="aligncenter size-medium wp-image-648" /></a></p>
<p>The messages show that everything went fine. The text that the &#8220;snort&#8221; user needs DELETE and UPDATE privileges in the database is nothing to worry about, as we took care of that when we installed Barnyard2 a few steps back.</p>
<p>Click on &#8220;step 5&#8243; to continue to the next screen:</p>
<p><a href="http://blog.nielshorn.net/wp-content/uploads/2010/09/BASE_6.png"><img src="http://blog.nielshorn.net/wp-content/uploads/2010/09/BASE_6-300x191.png" alt="BASE_6" title="BASE_6" width="300" height="191" class="aligncenter size-medium wp-image-651" /></a><br />
<a href="http://blog.nielshorn.net/wp-content/uploads/2010/09/BASE_6b.png"><img src="http://blog.nielshorn.net/wp-content/uploads/2010/09/BASE_6b-300x95.png" alt="BASE_6b" title="BASE_6b" width="300" height="95" class="aligncenter size-medium wp-image-652" /></a></p>
<p>Copy the text of the configuration and paste it using your favorite text editor to create the file <code>/var/www/htdocs/base/base_conf.php</code></p>
<p><em>After</em> saving it, click on &#8220;click here to access your install&#8221; to enter your newly set-up BASE! The following screen should show up, asking for login and password:</p>
<p><a href="http://blog.nielshorn.net/wp-content/uploads/2010/09/BASE_7.png"><img src="http://blog.nielshorn.net/wp-content/uploads/2010/09/BASE_7-300x68.png" alt="BASE_7" title="BASE_7" width="300" height="68" class="aligncenter size-medium wp-image-653" /></a></p>
<p>Since we only have the administrator account for now, let&#8217;s use the login we created and the password we set. After clicking on &#8220;login&#8221;, we&#8217;re in the &#8220;home&#8221; screen of BASE:</p>
<p><a href="http://blog.nielshorn.net/wp-content/uploads/2010/09/BASE_8.png"><img src="http://blog.nielshorn.net/wp-content/uploads/2010/09/BASE_8-300x212.png" alt="BASE_8" title="BASE_8" width="300" height="212" class="aligncenter size-medium wp-image-654" /></a></p>
<p>We already have one captured event, so let&#8217;s see what it is by clicking on &#8220;listing&#8221; for today&#8217;s events:</p>
<p><a href="http://blog.nielshorn.net/wp-content/uploads/2010/09/BASE_9.png"><img src="http://blog.nielshorn.net/wp-content/uploads/2010/09/BASE_9-300x174.png" alt="BASE_9" title="BASE_9" width="300" height="174" class="aligncenter size-medium wp-image-655" /></a></p>
<p>So that event was our port-scan we tried earlier <img src='http://blog.nielshorn.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><strong>Where to go from here</strong></p>
<p>This concludes our basic Snort / Barnyard2 / BASE set-up and we now have a working IDS &#8211; Intrusion Detection System.</p>
<p>There are many more things to configure, but there are some great books out there teaching what you can do with Snort and how to configure it. I can personally recommend <a href="http://oreilly.com/catalog/9780596007911">&#8220;The Snort Cookbook&#8221;</a> and <a href="http://oreilly.com/catalog/9780596006617">&#8220;Managing Security with Snort &#038; IDS Tools&#8221;</a>, both by O&#8217;Reilly but there are several other options.<br />
And don&#8217;t forget: Google is your friend!</p>
<p><strong>Links</strong></p>
<p>For Snort, Barnyard2, adodb and BASE, I submitted SlackBuild scripts to <a href="http://slackbuilds.org/">SlackBuilds.org</a>.<br />
If you prefer pre-built packages for Slackware, Slackware64 or ARMedslack, you can find them on my <a href="http://www.nielshorn.net/slackware/slack_pkg.php">site</a>.</p>
<p>To read more about these programs, visit their sites:</p>
<ul>
<li><a href="http://www.snort.org/">Snort</a></li>
<li><a href="http://www.securixlive.com/barnyard2/">Barnyard2</a></li>
<li><a href="http://adodb.sourceforge.net/">adodb</a></li>
<li><a href="http://base.secureideas.net/">BASE</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.nielshorn.net/2010/09/snort-barnyard2-base-complete-installation/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

