<?xml version="1.0" encoding="utf-8"?><?xml-stylesheet type='text/xsl' href='http://yizh1977.spaces.live.com/mmm2008-07-24_12.50/rsspretty.aspx?rssquery=en-US;http%3a%2f%2fyizh1977.spaces.live.com%2fcategory%2fCentos%2bsnort%2ffeed.rss' version='1.0'?><rss version="2.0" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:msn="http://schemas.microsoft.com/msn/spaces/2005/rss" xmlns:live="http://schemas.microsoft.com/live/spaces/2006/rss" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:cf="http://www.microsoft.com/schemas/rss/core/2005" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>naka共享空间: Centos snort</title><description /><link>http://yizh1977.spaces.live.com/?_c11_BlogPart_BlogPart=blogview&amp;_c=BlogPart&amp;partqs=catCentos%2bsnort</link><language>en-US</language><pubDate>Fri, 10 Oct 2008 05:24:21 GMT</pubDate><lastBuildDate>Fri, 10 Oct 2008 05:24:21 GMT</lastBuildDate><generator>Microsoft Spaces v1.1</generator><docs>http://www.rssboard.org/rss-specification</docs><ttl>60</ttl><cf:parentRSS>http://yizh1977.spaces.live.com/blog/feed.rss</cf:parentRSS><live:type>blogcategory</live:type><live:identity><live:id>3114088440382333141</live:id><live:alias>yizh1977</live:alias></live:identity><cf:listinfo><cf:group ns="http://schemas.microsoft.com/live/spaces/2006/rss" element="typelabel" label="Type" /><cf:group ns="http://schemas.microsoft.com/live/spaces/2006/rss" element="tag" label="Tag" /><cf:group element="category" label="Category" /><cf:sort element="pubDate" label="Date" data-type="date" default="true" /><cf:sort element="title" label="Title" data-type="string" /><cf:sort ns="http://purl.org/rss/1.0/modules/slash/" element="comments" label="Comments" data-type="number" /></cf:listinfo><item><title>snort+base step 4</title><link>http://yizh1977.spaces.live.com/Blog/cns!2B3776EFF823A0D5!237.entry</link><description>&lt;p&gt;  &lt;img title=Sarcastic style="vertical-align:middle" height=19 alt=Sarcastic src="http://shared.live.com/HjKMzTS-xzcms40!CabizA/emoticons/smile_sarcastic.gif" width=19&gt;Naka原创
&lt;p&gt;5,数据库建立，Barnyard安装。 
&lt;p&gt;  Barnyard是snort1.9之后出现的，主要作用是处理snort的输出。我第一次安装成功之后，系统运行正常。使用几天之后，无意中重启了 系统，结果发现  base中没用数据，查证mysql工作正常，后来找到Barnyard不能正常工作，原因是我修改了 Barnyard.conf出现错误。 
&lt;p&gt;5.1数据库建立： 
&lt;p&gt;   在Mysql中建立snort的数据库，以便将snort输出数据保存在mysql中，然后用base来进行分析。 
&lt;p&gt;在任意位置输入（默认用户为root，默认密码为空，下面代码建立用户，不知道意思搜索google）： 
&lt;p&gt;mysql 
&lt;p&gt;mysql&amp;gt; SET PASSWORD FOR &lt;a href="mailto:root@localhost=PASSWORD('password'"&gt;root@localhost=PASSWORD('password'&lt;/a&gt;); 
&lt;p&gt;&amp;gt;Query OK, 0 rows affected (0.25 sec) 
&lt;p&gt;mysql&amp;gt; create database snort; 
&lt;p&gt;&amp;gt;Query OK, 1 row affected (0.01 sec) 
&lt;p&gt;mysql&amp;gt; grant INSERT,SELECT on root.* to snort@localhost; 
&lt;p&gt;&amp;gt;Query OK, 0 rows affected (0.02 sec) 
&lt;p&gt;mysql&amp;gt; SET PASSWORD FOR &lt;a href="mailto:snort@localhost=PASSWORD('password"&gt;snort@localhost=PASSWORD('password&lt;/a&gt;); 
&lt;p&gt;&amp;gt;Query OK, 0 rows affected (0.25 sec) 
&lt;p&gt;mysql&amp;gt; grant CREATE, INSERT, SELECT, DELETE, UPDATE on snort.* to snort@localhost; 
&lt;p&gt;&amp;gt;Query OK, 0 rows affected (0.02 sec) 
&lt;p&gt;mysql&amp;gt; grant CREATE, INSERT, SELECT, DELETE, UPDATE on snort.* to snort; 
&lt;p&gt;&amp;gt;Query OK, 0 rows affected (0.02 sec) 
&lt;p&gt;mysql&amp;gt; exit 
&lt;p&gt;  
&lt;p&gt;下面建立数据库： 
&lt;p&gt;位置snort-2.6.1.5/schemas/create_mysql，将目录移动到schemas目录下面，然后使用如下命令建立mysql数据表 
&lt;p&gt;mysql -u root -p &amp;lt; create_mysql snort 
&lt;p&gt;Enter password: 选择你在上一步中建立的密码。 
&lt;p&gt;  
&lt;p&gt;5.2：安装Barnyard 
&lt;p&gt;tar –xvzf barnyard-0.2.0.tar.gz &lt;br&gt;cd barnyard-0.2.0&lt;br&gt;./configure --enable-mysql&lt;br&gt;make&lt;br&gt;make install&lt;br&gt;cd etc/&lt;br&gt;cp barnyard.conf /etc/snort 
&lt;p&gt;  
&lt;p&gt;5.3修改snort.conf和barnyard.conf(这两个文件都在/ect/snort下面了) 
&lt;p&gt;在snort.conf中找到 
&lt;p&gt;# output alert_unified: filename snort.alert, limit 128 
&lt;p&gt;# output log_unified: filename snort.log, limit 128 
&lt;p&gt;把前面的＃去掉 
&lt;p&gt;在barnyard中找到： 
&lt;p&gt;config hostname: 随便你自己给个名字 
&lt;p&gt;config interface：看用那个网卡接收数据，如果是单网卡一般是eth0 
&lt;p&gt;下面两行都去掉＃，然后在user root后面加一个空格，加password空格“你的密码” 
&lt;p&gt;# output alert_acid_db: mysql, sensor_id 1, database snort, server localhost, user root 
&lt;p&gt;# output log_acid_db: mysql, database snort, server localhost, user root, detail full 
&lt;p&gt;要让snort和barnyard工作起来,还需要了解一个名词waldo file: 
&lt;p&gt;&lt;a&gt;&lt;/a&gt;Barnyard runs in one of three modes: &lt;i&gt;one-shot&lt;/i&gt;, &lt;i&gt;continual&lt;/i&gt;, or &lt;i&gt;continual with checkpoint&lt;/i&gt;. One-shot mode (or batch mode) is used to run Barnyard against a single unified logfile and then exit. Continual watches a unified logfile as it is written to. The continual with checkpoint mode is similar to the continual mode except it keeps track of where it is in the file by keeping a pointer in a file (sometimes called a &lt;strong&gt;waldo &lt;/strong&gt;file). If Barnyard crashes, processing will continue at this point in the unified logfile. 
&lt;p&gt;5.4 创建一个waldo file 
&lt;p&gt;运行: 
&lt;p&gt;snort –c /etc/snort/snort.conf #参数c的意思可以google搜索 snort手册 
&lt;p&gt;当屏幕上显示Not Using PCAP_FRAMES的时候按ctrl+c 停止工作. 
&lt;p&gt;进入目录/var/log/snort 
&lt;p&gt;运行: 
&lt;p&gt;touch /var/log/snort/barnyard.waldo 
&lt;p&gt;先看看按ctrl+c 之后生成的文件,应该有两个一个.alert一个.log 
&lt;p&gt;vi barnyard.waldo 
&lt;p&gt;打开之后是一个空文件，把/var/log/snort snort.log XXXXXX 0 这句话写入这个文件中，xxxx代表了一些数字。 
&lt;p&gt;  
&lt;p&gt;还记得上面几个步骤中copy了两个文件，一个是snort，一个是barnyard。 
&lt;p&gt;执行service snort start 
&lt;p&gt;       service barnyard start 
&lt;p&gt;没有问题的话，基本上安装就没问题了。即使有问题，也会有提示，这些提示和snort.conf,barnyard.cof有关。&lt;img src="http://c.services.spaces.live.com/CollectionWebService/c.gif?cid=3114088440382333141&amp;page=RSS%3a+snort%2bbase+step+4&amp;referrer=" width="1px" height="1px" border="0" alt=""&gt;&lt;img style="position:absolute" alt="" width="0px" height="0px" src="http://c.live.com/c.gif?NC=31263&amp;amp;NA=1149&amp;amp;PI=73329&amp;amp;RF=&amp;amp;DI=3919&amp;amp;PS=85545&amp;amp;TP=yizh1977.spaces.live.com&amp;amp;GT1=yizh1977"&gt;</description><comments>http://yizh1977.spaces.live.com/Blog/cns!2B3776EFF823A0D5!237.entry#comment</comments><guid isPermaLink="true">http://yizh1977.spaces.live.com/Blog/cns!2B3776EFF823A0D5!237.entry</guid><pubDate>Wed, 19 Dec 2007 01:58:15 GMT</pubDate><slash:comments>0</slash:comments><msn:type>blogentry</msn:type><live:type>blogentry</live:type><live:typelabel>Blog entry</live:typelabel><wfw:commentRss>http://yizh1977.spaces.live.com/blog/cns!2B3776EFF823A0D5!237/comments/feed.rss</wfw:commentRss><wfw:comment>http://yizh1977.spaces.live.com/Blog/cns!2B3776EFF823A0D5!237.entry#comment</wfw:comment><dcterms:modified>2007-12-19T02:00:04Z</dcterms:modified></item><item><title>无意中找到一篇Barnyard的文章</title><link>http://yizh1977.spaces.live.com/Blog/cns!2B3776EFF823A0D5!236.entry</link><description>&lt;h5&gt;Barnyard (and Sguil)&lt;/h5&gt; &lt;p&gt;One &lt;a&gt;&lt;/a&gt;of the costliest activities Snort performs is its &lt;a&gt;&lt;/a&gt;alert logging. Data needs to be gathered, formatted, and written. In the case of database writes, Snort must send the alert to the database and wait for confirmation of a successful write. The situation is made even worse when the database server is running on another system on network. &lt;p&gt;Snort has the ability to dump the information that it has gathered on a particular alert into a binary file. This is very quick, since no processing needs to be performed on the data. The Barnyard application reads this file, formats the alert data, and writes it to the chosen output mechanism. The output mechanism can be the conventional Snort logfile, syslogs, comma-separated-value formatted (CSV) file, or a database server. &lt;a&gt;&lt;/a&gt;Barnyard can be configured to run on the same platforms as Snort, and their installation and configuration are very similar. &lt;a href="http://book.opensourceproject.org.cn/#snortids-chp-13-fig-1"&gt;Figure 13-1&lt;/a&gt; illustrates the way Snort and Barnyard work together. Barnyard does a very good job of logging to the ACID database allowing Administrators to continue using familiar tools. &lt;p&gt;&lt;a&gt;&lt;/a&gt; &lt;h6&gt;Figure 13-1. Barnyard working with Snort&lt;/h6&gt; &lt;p&gt;&lt;a&gt;&lt;/a&gt; &lt;h6&gt;&lt;a href="http://by1.storage.msn.com/y1pPFsRh7bgxlOx1j3eyFSP5QSf1gpgBu5NEZSjn904-_J0JQ48zmpcaN3OEp_WfPD8G539FznWDJzCcFYPxiw35WpYK1yn6wSh?PARTNER=WRITER"&gt;&lt;img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px" height=155 alt=1 src="http://by1.storage.msn.com/y1pPFsRh7bgxlPzZ-LjmQQhpm2EaIOGKV_jtkazUG-qjVKaOgC1cOCVLIicFbqXpvfK97FWIH973bQLqsdyf9ZWIkyaWPDSV-v7?PARTNER=WRITER" width=244 border=0&gt;&lt;/a&gt; 13.1.1 Configuring Snort's Unified Binary Output&lt;/h6&gt; &lt;p&gt;When using &lt;a&gt;&lt;/a&gt;unified binary output, Snort is configured normally; the only difference is the output plug-in selected in the snort.conf file. The log_unified&lt;a&gt;&lt;/a&gt; output plug-in is the only output plug-in that should be configured. The format of the directive is:&lt;pre&gt;output log_unified: filename &amp;lt;filename&amp;gt;, limit &amp;lt;log file size&amp;gt;&lt;/pre&gt;
&lt;dl&gt;
&lt;p&gt;
&lt;dt&gt;&lt;tt&gt;&lt;i&gt;filename&lt;/i&gt;&lt;/tt&gt;
&lt;dd&gt;
&lt;p&gt;The base filename Snort uses when logging alerts. A timestamp is appended to the filename. The file is created in the location you chose for Snort logfiles to be written (/var/log/snort by default, but configurable using &lt;tt&gt;-l&lt;/tt&gt;.
&lt;p&gt;
&lt;dt&gt;&lt;tt&gt;&lt;i&gt;logfile size&lt;/i&gt;&lt;/tt&gt;
&lt;dd&gt;
&lt;p&gt;Designates the maximum size that a logfile can attain. Consider 128 MB a minimum size. When this file is full, Snort stops writing to that one and starts another with the same base name but a new timestamp.&lt;/dl&gt;
&lt;p&gt;A sample snort.conf entry would be:&lt;pre&gt;output log_unified: filename unified.log, limit 512&lt;/pre&gt;
&lt;p&gt;When Snort starts writing to a new file as a result of the size limit being reached, Barnyard continues processing with new file automatically if it is running in continual mode (see &lt;a href="http://book.opensourceproject.org.cn/#snortids-chp-13-sect-1.4"&gt;Section 13.1.4&lt;/a&gt; below).
&lt;p&gt;&lt;a&gt;&lt;/a&gt;
&lt;h6&gt;13.1.2 Installing Barnyard&lt;/h6&gt;
&lt;p&gt;Download &lt;a&gt;&lt;/a&gt;Barnyard from &lt;a href="http://www.snort.org/dl/barnyard"&gt;http://www.snort.org/dl/barnyard&lt;/a&gt; and extract it to a standard location (I prefer /usr/local/src/barnyard). To enable database support, you need to use a directive when running &lt;tt&gt;configure&lt;/tt&gt;. To enable support for MySQL support, use (&lt;tt&gt;--enable-mysql&lt;/tt&gt;); to enable PostgreSQL, use (&lt;tt&gt;--enable-postgres&lt;/tt&gt;). The command line is below:&lt;pre&gt;# cd /usr    /local/src/barnyard/barnyard-0.x.0/

# ./configure --enable-mysql

# make

# make install&lt;/pre&gt;
&lt;p&gt;After install, you can find the Barnyard executable in /usr/local/bin and the barnyard.conf file in the /etc directory in your source directory. You can copy this to a location like /usr/local/etc or keep it where it is.
&lt;p&gt;&lt;a&gt;&lt;/a&gt;
&lt;h6&gt;13.1.3 The barnyard.conf File&lt;/h6&gt;
&lt;p&gt;Most Barnyard options are managed using the barnyard.conf&lt;a&gt;&lt;/a&gt; file. There are two sections to the file: the &lt;i&gt;declarations&lt;/i&gt; and the &lt;i&gt;output plug-ins&lt;/i&gt;.
&lt;p&gt;Here are the configuration declarations:
&lt;p&gt;&lt;a&gt;&lt;/a&gt;&lt;a&gt;&lt;/a&gt;
&lt;dl&gt;
&lt;p&gt;
&lt;dt&gt;config daemon
&lt;dd&gt;
&lt;p&gt;Designates that &lt;a&gt;&lt;/a&gt;Barnyard &lt;a&gt;&lt;/a&gt;runs in the background (as a daemon). The same as the &lt;tt&gt;-D&lt;/tt&gt; command-line option.
&lt;p&gt;
&lt;dt&gt;config localtime
&lt;dd&gt;
&lt;p&gt;Sets Barnyard to use local time instead of UTC. This is generally not recommended due to the confusion it can cause with multiple sensors.
&lt;p&gt;
&lt;dt&gt;config hostname : &lt;tt&gt;&lt;i&gt;&amp;lt;hostname&amp;gt;&lt;/i&gt;&lt;/tt&gt;
&lt;dd&gt;
&lt;p&gt;Sets the hostname of the sensor. Currently only used by the ACID database plug-in.
&lt;p&gt;
&lt;dt&gt;config interface : &lt;tt&gt;&lt;i&gt;&amp;lt;interface name&lt;/i&gt;&lt;/tt&gt;&amp;gt;
&lt;dd&gt;
&lt;p&gt;Sets the interface name for use with the ACID database plug-in.
&lt;p&gt;
&lt;dt&gt;config filter: &amp;lt; &lt;tt&gt;&lt;i&gt;filter regular expression&lt;/i&gt;&lt;/tt&gt;&amp;gt;
&lt;dd&gt;
&lt;p&gt;Normally, this is set to stop an infinite loop if you are sniffing traffic on the same interface you are running a console using SSH. Here's a sample setting:&lt;pre&gt;Config filter: not port 22&lt;/pre&gt;&lt;/dl&gt;
&lt;p&gt;The &lt;a&gt;&lt;/a&gt;output plug-ins consist of:
&lt;p&gt;&lt;a&gt;&lt;/a&gt;&lt;a&gt;&lt;/a&gt;&lt;a&gt;&lt;/a&gt;&lt;a&gt;&lt;/a&gt;
&lt;dl&gt;
&lt;p&gt;
&lt;dt&gt;output alert_fast: &amp;lt; &lt;tt&gt;&lt;i&gt;filename&lt;/i&gt;&lt;/tt&gt;&amp;gt;
&lt;dd&gt;
&lt;p&gt;Outputs a file that is similar to Snort's &amp;quot;fast&amp;quot; format; very stripped down, with no packet headers.
&lt;p&gt;
&lt;dt&gt;output log_dump: &amp;lt; &lt;tt&gt;&lt;i&gt;filename&lt;/i&gt;&lt;/tt&gt;&amp;gt;
&lt;dd&gt;
&lt;p&gt;Outputs a file that is similar to Snort's ASCII packet dump mode.
&lt;p&gt;
&lt;dt&gt;output alert_csv: &amp;lt; &lt;tt&gt;&lt;i&gt;long list of options&lt;/i&gt;&lt;/tt&gt;&amp;gt;
&lt;dd&gt;
&lt;p&gt;(Experimental plug-in) Creates a file with user-designated fields. It might be useful for some custom scripting, but for the vast majority of administrators who are sophisticated enough to use Barnyard, a database is a better choice. If you want to do custom scripting, refer to the database schema in &lt;a href="http://book.opensourceproject.org.cn/snortids-app-a.html#snortids-app-a"&gt;Appendix A&lt;/a&gt; and create database-aware scripts. You'll be happier.
&lt;p&gt;
&lt;dt&gt;output alert_syslog: &amp;lt; &lt;tt&gt;&lt;i&gt;facility&lt;/i&gt;&lt;/tt&gt;&amp;gt;, &amp;lt; &lt;tt&gt;&lt;i&gt;priority&lt;/i&gt;&lt;/tt&gt;&amp;gt;
&lt;dd&gt;
&lt;p&gt;Outputs using the syslog mechanism with the same options as Snort (see &lt;a href="http://book.opensourceproject.org.cn/snortids-chp-5.html#snortids-chp-5"&gt;Chapter 5&lt;/a&gt;).
&lt;p&gt;
&lt;dt&gt;output alert_syslog2: &amp;lt; &lt;tt&gt;&lt;i&gt;facility&lt;/i&gt;&lt;/tt&gt;&amp;gt;, &amp;lt; &lt;tt&gt;&lt;i&gt;priority&lt;/i&gt;&lt;/tt&gt;&amp;gt;
&lt;dd&gt;
&lt;p&gt;Uses a mechanism similar to the alert_syslog output line, but has the expanded formats of syslog2 available.
&lt;p&gt;
&lt;dt&gt;&lt;tt&gt;&lt;i&gt;output log_pcap: &amp;lt;filename&amp;gt;&lt;/i&gt;&lt;/tt&gt;
&lt;dd&gt;
&lt;p&gt;Outputs data in the standard pcap format.
&lt;p&gt;
&lt;dt&gt;output alert_acid_db : &lt;tt&gt;&lt;i&gt;&amp;lt;database type&amp;gt;, sensor_id &amp;lt;sensor id&amp;gt;, database &amp;lt;database name&amp;gt;, server &amp;lt;server address&amp;gt;, user &amp;lt;username for database&amp;gt;, password &amp;lt;database password&amp;gt;&lt;/i&gt;&lt;/tt&gt;
&lt;dd&gt;
&lt;p&gt;Sends alert information (less detailed than log information) to an &lt;a&gt;&lt;/a&gt;ACID database. Designate the database type (&lt;tt&gt;mysql&lt;/tt&gt;, &lt;tt&gt;postrgres&lt;/tt&gt;, and so on), and supply the location of the server (localhost or IP address), database name, and the authentication information for the database user.
&lt;p&gt;
&lt;dt&gt;output log_acid_db : &lt;tt&gt;&lt;i&gt;&amp;lt;database type&amp;gt;, sensor_id &amp;lt;sensor id&amp;gt;, database &amp;lt;database name&amp;gt;, server &amp;lt;server address&amp;gt;, user &amp;lt;username for database&amp;gt;, password &amp;lt;database password&amp;gt;, detail &amp;lt;full or fast&amp;gt;&lt;/i&gt;&lt;/tt&gt;
&lt;dd&gt;
&lt;p&gt;Sends detailed log information to an &lt;a&gt;&lt;/a&gt;ACID database. Designate the database type (&lt;tt&gt;mysql&lt;/tt&gt;, &lt;tt&gt;postrgres&lt;/tt&gt;, and so on) and supply the location of the server (localhost or IP address), database name, and the authentication information for the database user. One last bit of data to include is the detail option (&lt;tt&gt;fast&lt;/tt&gt; or &lt;tt&gt;full&lt;/tt&gt;). I always use &lt;tt&gt;full&lt;/tt&gt;. Here's a sample configuration line for the ACID output plugin:&lt;pre&gt;output log_acid_db: mysql, sensor_id 1, database snort, server 10.10.10.25, user 

snort_user, password pa$$w0rd, detail full&lt;/pre&gt;
&lt;p&gt;
&lt;dt&gt;output sguil : &lt;tt&gt;&lt;i&gt;&amp;lt;db type&amp;gt;, sensor_id &amp;lt;sensor ID&amp;gt;, database &amp;lt;db name&amp;gt;, server &amp;lt;IP address or hostname&amp;gt;, user &amp;lt;db username&amp;gt;,password &amp;lt;db password&amp;gt;, sguild_host &amp;lt;IP address or hostname&amp;gt;, sguild_port &amp;lt;port number&amp;gt;&lt;/i&gt;&lt;/tt&gt;
&lt;dd&gt;
&lt;p&gt;Sends detailed log information to a &lt;a&gt;&lt;/a&gt;sguil server database. Designate the database type (&lt;tt&gt;mysql&lt;/tt&gt;, &lt;tt&gt;postgres&lt;/tt&gt;, and so on), supply the location of the database server, the database user and password, the sguil server location, and the port that sguil is listening on (defaults to 7736). Here's sample configuration for the sguil output plug-in:
&lt;p&gt;&lt;a&gt;&lt;/a&gt;&lt;pre&gt;output sguil: mysql, sensor_id 1, database sguil, server 10.10.10.25, user sguil_

user, password pa$$w0rd, sguild_host localhost, sguild_port 7736&lt;/pre&gt;&lt;/dl&gt;&lt;a&gt;&lt;/a&gt;
&lt;h6&gt;13.1.4 Barnyard Command-Line Options&lt;/h6&gt;
&lt;p&gt;&lt;a&gt;&lt;/a&gt;Barnyard runs in one of three modes: &lt;i&gt;one-shot&lt;/i&gt;, &lt;i&gt;continual&lt;/i&gt;, or &lt;i&gt;continual with checkpoint&lt;/i&gt;. One-shot mode (or batch mode) is used to run Barnyard against a single unified logfile and then exit. Continual watches a unified logfile as it is written to. The continual with checkpoint mode is similar to the continual mode except it keeps track of where it is in the file by keeping a pointer in a file (sometimes called a waldo file). If Barnyard crashes, processing will continue at this point in the unified logfile.
&lt;p&gt;The mode that Barnyard is running in (as well as other potentially ephemeral configuration settings) is designated at the command line. The command line options for Barnyard are:
&lt;dl&gt;
&lt;p&gt;
&lt;dt&gt;-R
&lt;dd&gt;
&lt;p&gt;Similar to the &lt;tt&gt;-T&lt;/tt&gt; test mode of Snort. Processes the configuration and tells you if you have any problems. This has gotten very useful in recent versions of Barnyard.
&lt;p&gt;
&lt;dt&gt;-c &amp;lt; &lt;tt&gt;&lt;i&gt;path to barnyard.conf&lt;/i&gt;&lt;/tt&gt;&amp;gt;
&lt;dd&gt;
&lt;p&gt;The path to the configuration file.
&lt;p&gt;
&lt;dt&gt;-d &amp;lt; &lt;tt&gt;&lt;i&gt;dir&lt;/i&gt;&lt;/tt&gt;&amp;gt;
&lt;dd&gt;
&lt;p&gt;The directory where Snort will be writing the unified binary format logs.
&lt;p&gt;
&lt;dt&gt;-L &amp;lt; &lt;tt&gt;&lt;i&gt;dir&lt;/i&gt;&lt;/tt&gt;&amp;gt;
&lt;dd&gt;
&lt;p&gt;If Barnyard is configured to output to files, this path designates where the files should be written.
&lt;p&gt;
&lt;dt&gt;-v
&lt;dd&gt;
&lt;p&gt;Increases verbosity of console output.
&lt;p&gt;
&lt;dt&gt;-s &amp;lt; &lt;tt&gt;&lt;i&gt;file&lt;/i&gt;&lt;/tt&gt;&amp;gt;
&lt;dd&gt;
&lt;p&gt;The path to Snort's sid-msg.map file. Included with the Snort rules download and specifies the sid for an alert message.
&lt;p&gt;
&lt;dt&gt;-g &amp;lt; &lt;tt&gt;&lt;i&gt;file&lt;/i&gt;&lt;/tt&gt;&amp;gt;
&lt;dd&gt;
&lt;p&gt;The path to Snort's gen-msg.map file. Included with the Snort rules download and specifies the detection generator that is associated with a generator ID.
&lt;p&gt;
&lt;dt&gt;-p &amp;lt; &lt;tt&gt;&lt;i&gt;file&lt;/i&gt;&lt;/tt&gt;&amp;gt;
&lt;dd&gt;
&lt;p&gt;The path to Snort's classification.config file. This is included with the Snort rules download and specifies the alert classifications used by Snort.
&lt;p&gt;
&lt;dt&gt;-a &amp;lt; &lt;tt&gt;&lt;i&gt;dir&lt;/i&gt;&lt;/tt&gt;&amp;gt;
&lt;dd&gt;
&lt;p&gt;If a unified logfile is processed, it can be archived to another location as specified.
&lt;p&gt;
&lt;dt&gt;-f &amp;lt; &lt;tt&gt;&lt;i&gt;base&lt;/i&gt;&lt;/tt&gt;&amp;gt;
&lt;dd&gt;
&lt;p&gt;The base name for the Snort unified binary format logs. This is the filename without the appended timestamp.
&lt;p&gt;
&lt;dt&gt;-n
&lt;dd&gt;
&lt;p&gt;Only process new events.
&lt;p&gt;
&lt;dt&gt;-w &amp;lt; &lt;tt&gt;&lt;i&gt;file&lt;/i&gt;&lt;/tt&gt;&amp;gt;
&lt;dd&gt;
&lt;p&gt;The checkpoint (waldo) file used for continual with checkpoint mode.
&lt;p&gt;
&lt;dt&gt;-D
&lt;dd&gt;
&lt;p&gt;Run in daemon mode.
&lt;p&gt;
&lt;dt&gt;-X &amp;lt; &lt;tt&gt;&lt;i&gt;file&lt;/i&gt;&lt;/tt&gt;&amp;gt;
&lt;dd&gt;
&lt;p&gt;Specify a file to store the PID of the Barnyard process.
&lt;p&gt;
&lt;dt&gt;-o
&lt;dd&gt;
&lt;p&gt;Enable one-shot mode on the specified file.
&lt;p&gt;
&lt;dt&gt;-t &amp;lt; &lt;tt&gt;&lt;i&gt;timestamp&lt;/i&gt;&lt;/tt&gt;&amp;gt;
&lt;dd&gt;
&lt;p&gt;You can specify the timestamp for the first file to be processed. The timestamp is in Unix time (seconds since the epoch).&lt;/dl&gt;
&lt;p&gt;Here are some sample command lines (they can get very long). First, there's batch (one-shot) mode:&lt;pre&gt;barnyard -c /usr/local/etc/barnyard.conf -d /var/log/snort \

-c /usr/local/share/snort_rules/classification.config \

-s /usr/local/share/snort_rules/sid-msg.map \

-g /usr/local/share/snort_rules/gen-msg.map -o unified.log.1083726235&lt;/pre&gt;
&lt;p&gt;Then we have continual mode with checkpoint:
&lt;p&gt;&lt;a&gt;&lt;/a&gt;&lt;a&gt;&lt;/a&gt;&lt;pre&gt;barnyard -c /usr/local/etc/barnyard.conf -d /var/log/snort \

-c /usr/local/share/snort_rules/classification.config \

-s /usr/local/share/snort_rules/sid-msg.map \

-g /usr/local/share/snort_rules/gen-msg.map -w /usr/local/etc/waldo.chk \

-f unified.log&lt;/pre&gt;&lt;br&gt;&lt;a&gt;&lt;/a&gt;
&lt;h6&gt;13.1.5 Sguil: An Alternative Management Console&lt;/h6&gt;&lt;a&gt;&lt;/a&gt;
&lt;p&gt;Developer:
&lt;p&gt;&lt;a&gt;&lt;/a&gt;Bamm Visscher
&lt;p&gt;Link:
&lt;p&gt;&lt;a href="http://squil.sourceforge.net"&gt;http://squil.sourceforge.net&lt;/a&gt;
&lt;p&gt;Download Link:
&lt;p&gt;&lt;a href="http://sourceforge.net/project/showfiles.php?group_id=71220"&gt;http://sourceforge.net/project/showfiles.php?group_id=71220&lt;/a&gt;
&lt;p&gt;Platform:
&lt;p&gt;Tcl/Tk client/server architecture
&lt;p&gt;Prerequisites:
&lt;p&gt;MySQL, Snort, Barnyard, Tcl/Tk 8.3 or newer (&lt;a href="http://www.tcl.tk/software/tcltk/"&gt;http://www.tcl.tk/software/tcltk/&lt;/a&gt;), Tclx libraries (&lt;a href="http://tclx.sourceforge.net"&gt;http://tclx.sourceforge.net&lt;/a&gt;), Mysqltcl (&lt;a href="http://www.xdobry.de/mysqltcl/"&gt;http://www.xdobry.de/mysqltcl/&lt;/a&gt;), incr tcl (itcl) (&lt;a href="http://incrtcl.sourceforge.net/itcl/"&gt;http://incrtcl.sourceforge.net/itcl/&lt;/a&gt;), tcllib extension (&lt;a href="http://tcllib.sf.net"&gt;http://tcllib.sf.net&lt;/a&gt;), Tcpflow (&lt;a href="http://www.circlemud.org/~jelson/software/tcpflow/"&gt;http://www.circlemud.org/~jelson/software/tcpflow/&lt;/a&gt;), p0f (&lt;a href="http://lcamtuf.coredump.cx/p0f.shtml"&gt;http://lcamtuf.coredump.cx/p0f.shtml&lt;/a&gt;)
&lt;p&gt;As the prerequisite list indicates, installing &lt;a&gt;&lt;/a&gt;Sguil can be hairy. Getting it running involves installing the standard Snort components, Tcl (tool control language) and tk (a graphical user interface toolkit), several add-on Tcl libraries, and the Tcpflow and p0f applications. Then set up a database for Sguil to use, install the GUI server, and the GUI client, patch Snort's source code and recompile, configure Barnyard's Sguil output plugin, and configure a script to get the data from Snort, Tcpflow, and p0f into the database. Detailed installation instructions are available on the Sguil web page.
&lt;p&gt;Sguil is a near real-time interface to Snort alerts that relies on Barnyard, Tcpflow, and p0f to gather alert data. Tcpflow and p0f are used to create a transcript of network traffic that can be useful in discrimating false positives and post-incident forensic analysis. The interface is actually very nice to use and presents the alert information in a useful format.
&lt;p&gt;An extract from the Sguil home page:
&lt;blockquote&gt;
&lt;p&gt;Events can be validated by placing them into one of seven incident categories or marking the event as having no further action required (NA). These actions remove the events from the RealTime tab of all the connected clients but are not deleted from the database. Archived events can easily be retrieved from the database through preformatted queries, or the analyst can create a custom query using SQL.&lt;/blockquote&gt;
&lt;p&gt;Sguil isn't that different from the ACID interface: both allow you to monitor alerts and search by event, sensor, alert classification, alert priority, or timestamp. Sguil is more up-to-date with the latest preprocessors梡articularly the new flow-portscan system. Both ACID and Sguil lack sensor-management tools.
&lt;p&gt;Where connecting to ACID is easy since it is a web-based interface, the only way to get a remote client to connect to a central server is by using an exported X-session (a security no-no). Looking back at the last few paragraphs, I see that I'm drawing a lot of comparisons between ACID and sguil. Functionally, they are very similar. Sguil's transcript feature differentiates it.
&lt;p&gt;A daunting installation, poor client model, and lack of many new features make it difficult to recommend Sguil. I advise sticking with ACID.
&lt;p&gt;Figures &lt;a href="http://book.opensourceproject.org.cn/#snortids-chp-13-fig-2"&gt;Figure 13-2&lt;/a&gt; and &lt;a href="http://book.opensourceproject.org.cn/#snortids-chp-13-fig-3"&gt;Figure 13-3&lt;/a&gt; show screenshots of Sguil in action.
&lt;p&gt;&lt;a&gt;&lt;/a&gt;
&lt;h6&gt;Figure 13-2. Sguil console in action&lt;/h6&gt;
&lt;p&gt;&lt;a&gt;&lt;/a&gt;
&lt;h6&gt;&lt;a href="http://by1.storage.msn.com/y1pPFsRh7bgxlPS6OEgte_n69WcKfBcAbeUCZt90N7olM-lwjl5j9EMt7TC_RTB7tVNeNqYdWLiN-iOwXIqXFAs8AmuzUSOnI2b?PARTNER=WRITER"&gt;&lt;img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px" height=184 alt=2 src="http://by1.storage.msn.com/y1pPFsRh7bgxlM76wbhNDSzq6ehGcJ_l901zRgpcUi6uYluGujwW_25-VbbiPffAwZuxd7728Sa7NulZhoRByyyo6s6EtfkDuhP?PARTNER=WRITER" width=244 border=0&gt;&lt;/a&gt; Figure 13-3. The sguil query builder&lt;a href="http://by1.storage.msn.com/y1pPFsRh7bgxlNVHsXMNuKEBfchCYpkaibLZ6SxpBs5vLHMqWpjyqpSqjccdycJfkkqDcnwkjHVOxLXsuF2rDck4LEc7WZRPHDe?PARTNER=WRITER"&gt;&lt;img style="border-right:0px;border-top:0px;border-left:0px;border-bottom:0px" height=190 alt=3 src="http://by1.storage.msn.com/y1pPFsRh7bgxlMuq0HIoUbaoAHVcwQj1gSUqj5X5bLffTCjU8kf2PAx15OdHRNhu8p6IVJE60R8DsOru_YtFtz9BPNloj0j0bRF?PARTNER=WRITER" width=244 border=0&gt;&lt;/a&gt;&lt;/h6&gt;&lt;img src="http://c.services.spaces.live.com/CollectionWebService/c.gif?cid=3114088440382333141&amp;page=RSS%3a+%e6%97%a0%e6%84%8f%e4%b8%ad%e6%89%be%e5%88%b0%e4%b8%80%e7%af%87Barnyard%e7%9a%84%e6%96%87%e7%ab%a0&amp;referrer=" width="1px" height="1px" border="0" alt=""&gt;&lt;img style="position:absolute" alt="" width="0px" height="0px" src="http://c.live.com/c.gif?NC=31263&amp;amp;NA=1149&amp;amp;PI=73329&amp;amp;RF=&amp;amp;DI=3919&amp;amp;PS=85545&amp;amp;TP=yizh1977.spaces.live.com&amp;amp;GT1=yizh1977"&gt;</description><comments>http://yizh1977.spaces.live.com/Blog/cns!2B3776EFF823A0D5!236.entry#comment</comments><guid isPermaLink="true">http://yizh1977.spaces.live.com/Blog/cns!2B3776EFF823A0D5!236.entry</guid><pubDate>Wed, 19 Dec 2007 01:40:32 GMT</pubDate><slash:comments>0</slash:comments><msn:type>blogentry</msn:type><live:type>blogentry</live:type><live:typelabel>Blog entry</live:typelabel><wfw:commentRss>http://yizh1977.spaces.live.com/blog/cns!2B3776EFF823A0D5!236/comments/feed.rss</wfw:commentRss><wfw:comment>http://yizh1977.spaces.live.com/Blog/cns!2B3776EFF823A0D5!236.entry#comment</wfw:comment><dcterms:modified>2007-12-19T01:40:32Z</dcterms:modified></item><item><title>snort+base step 3</title><link>http://yizh1977.spaces.live.com/Blog/cns!2B3776EFF823A0D5!228.entry</link><description>&lt;div&gt;&lt;img title=Sarcastic style="vertical-align:middle" height=19 alt=Sarcastic src="http://shared.live.com/HjKMzTS-xzcms40!CabizA/emoticons/smile_sarcastic.gif" width=19&gt;Naka原创:&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;4,准备安装snort,并且建立规则&lt;/div&gt;
&lt;div&gt;进入到 第2建立的文件夹:&lt;/div&gt;
&lt;div&gt;4.1 安装snort&lt;/div&gt;
&lt;div&gt;tar -xvzf snort-2.6.1.5.tar.gz &lt;br&gt;cd snort-2.6.1.5&lt;br&gt;./configure --with-mysql --enable-dynamicplugin #参数必须加，不然100％无法运行&lt;br&gt;make&lt;br&gt;make install&lt;br&gt;groupadd snort #建立组&lt;br&gt;useradd -g snort snort -s /sbin/nologin #建立用户，不也许telnet登陆&lt;/div&gt;
&lt;div&gt;mkdir /etc/snort  建立snort文件夹，会把安装文件夹下步骤2的中snort/etc 拷贝到这里&lt;br&gt;mkdir /etc/snort/rules  建立规则文件夹，会把snort的规则放到这里&lt;br&gt;mkdir /var/log/snort  建立snort运行log文件夹&lt;br&gt;cd  etc/&lt;br&gt;cp * /etc/snort&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;4.2 安装rules&lt;/div&gt;
&lt;div&gt;tar -xvzf  snortrules-pr-2.4.tar.gz #退回第2建立的文件夹后执行&lt;br&gt;cd rules&lt;br&gt;cp * /etc/snort/rules&lt;/div&gt;
&lt;div&gt;&lt;br&gt;4.3 修改snort配置文件&lt;/div&gt;
&lt;div&gt;
&lt;p style="margin:0cm 0cm 0pt"&gt;&lt;span lang=EN-US style="font-size:8.5pt;color:black;font-family:Verdana"&gt;vi /etc/snort&lt;/span&gt; 
&lt;p style="margin:0cm 0cm 0pt"&gt;&lt;span lang=EN-US style="font-size:8.5pt;color:black;font-family:Verdana"&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;p style="margin:0cm 0cm 0pt"&gt;&lt;span lang=EN-US style="font-size:8.5pt;color:black;font-family:Verdana"&gt;var HOME_NET 10.0.0.0/24 &lt;/span&gt;&lt;span style="font-size:8.5pt;color:black;font-family:宋体"&gt;修改成你自己的网断&lt;/span&gt;&lt;span lang=EN-US style="font-size:8.5pt;color:black;font-family:Verdana"&gt;.&lt;/span&gt; 
&lt;p style="margin:0cm 0cm 0pt"&gt;&lt;span lang=EN-US style="font-size:8.5pt;color:black;font-family:Verdana"&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;p style="margin:0cm 0cm 0pt"&gt;&lt;span lang=EN-US style="font-size:8.5pt;color:black;font-family:Verdana"&gt;var EXTERNAL_NET !$HOME_NET &lt;/span&gt;&lt;span style="font-size:8.5pt;color:black;font-family:宋体"&gt;定义除内网之外的所有网段为外网&lt;/span&gt;&lt;span lang=EN-US style="font-size:8.5pt;color:black;font-family:Verdana"&gt;&lt;/span&gt; 
&lt;p style="margin:0cm 0cm 0pt"&gt;&lt;span lang=EN-US style="font-size:8.5pt;color:black;font-family:Verdana"&gt;var RULE_PATH /etc/snort/rules &lt;/span&gt;
&lt;p style="margin:0cm 0cm 0pt"&gt;&lt;span lang=EN-US style="font-size:8.5pt;color:black;font-family:Verdana"&gt;&lt;/span&gt;  
&lt;p style="margin:0cm 0cm 0pt"&gt;&lt;span lang=EN-US style="font-size:8.5pt;color:black;font-family:Verdana"&gt;...............待继&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;strong&gt;&lt;font size=3&gt;&lt;span style="letter-spacing:-0.1pt"&gt;&lt;/span&gt;&lt;/font&gt;&lt;/strong&gt; &lt;/div&gt;
&lt;div&gt;&lt;strong&gt;&lt;font size=3&gt;&lt;span style="letter-spacing:-0.1pt"&gt;&lt;/span&gt;&lt;/font&gt;&lt;/strong&gt; &lt;/div&gt;
&lt;div&gt;&lt;strong&gt;&lt;font size=3&gt;&lt;span style="letter-spacing:-0.1pt"&gt;&lt;/span&gt;&lt;/font&gt;&lt;/strong&gt; &lt;/div&gt;&lt;img src="http://c.services.spaces.live.com/CollectionWebService/c.gif?cid=3114088440382333141&amp;page=RSS%3a+snort%2bbase+step+3&amp;referrer=" width="1px" height="1px" border="0" alt=""&gt;&lt;img style="position:absolute" alt="" width="0px" height="0px" src="http://c.live.com/c.gif?NC=31263&amp;amp;NA=1149&amp;amp;PI=73329&amp;amp;RF=&amp;amp;DI=3919&amp;amp;PS=85545&amp;amp;TP=yizh1977.spaces.live.com&amp;amp;GT1=yizh1977"&gt;</description><comments>http://yizh1977.spaces.live.com/Blog/cns!2B3776EFF823A0D5!228.entry#comment</comments><guid isPermaLink="true">http://yizh1977.spaces.live.com/Blog/cns!2B3776EFF823A0D5!228.entry</guid><pubDate>Tue, 18 Dec 2007 05:58:47 GMT</pubDate><slash:comments>0</slash:comments><msn:type>blogentry</msn:type><live:type>blogentry</live:type><live:typelabel>Blog entry</live:typelabel><wfw:commentRss>http://yizh1977.spaces.live.com/blog/cns!2B3776EFF823A0D5!228/comments/feed.rss</wfw:commentRss><wfw:comment>http://yizh1977.spaces.live.com/Blog/cns!2B3776EFF823A0D5!228.entry#comment</wfw:comment><dcterms:modified>2007-12-18T08:22:42Z</dcterms:modified></item><item><title>snort+base step 2</title><link>http://yizh1977.spaces.live.com/Blog/cns!2B3776EFF823A0D5!224.entry</link><description>&lt;div&gt;&lt;img title=Sarcastic style="vertical-align:middle" height=19 alt=Sarcastic src="http://shared.live.com/HjKMzTS-xzcms40!CabizA/emoticons/smile_sarcastic.gif" width=19&gt;Naka原创:&lt;/div&gt;
&lt;div&gt; &lt;/div&gt;
&lt;div&gt;3,准备两个文件,都将放到/etc/init.d文件夹内,直接找到这个目录vi snort和&lt;font size=2&gt;barnyard copy进去就可以。对这两个文件，还要在后面做处理。&lt;/font&gt;&lt;/div&gt;
&lt;div&gt;&lt;br&gt;第一个文件,用来启动snort:  &lt;br&gt;#!/bin/sh&lt;br&gt;#&lt;br&gt;# chkconfig: 2345 99 82&lt;br&gt;# description: Starts and stops the snort intrusion detection system&lt;br&gt;#&lt;br&gt;# config: /etc/snort/snort.conf&lt;br&gt;# processname: snort&lt;br&gt;&lt;br&gt;# Source function library&lt;br&gt;. /etc/rc.d/init.d/functions&lt;br&gt;&lt;br&gt;BASE=snort&lt;br&gt;DAEMON=&amp;quot;-D&amp;quot;&lt;br&gt;INTERFACE=&amp;quot;-i eth0&amp;quot;&lt;br&gt;CONF=&amp;quot;/etc/snort/snort.conf&amp;quot;&lt;br&gt;&lt;br&gt;# Check that $BASE exists.&lt;br&gt;[ -f /usr/local/bin/$BASE ] || exit 0&lt;br&gt;&lt;br&gt;# Source networking configuration.&lt;br&gt;. /etc/sysconfig/network&lt;br&gt;&lt;br&gt;# Check that networking is up.&lt;br&gt;[ ${NETWORKING} = &amp;quot;no&amp;quot; ] &amp;amp;&amp;amp; exit 0&lt;br&gt;&lt;br&gt;RETVAL=0&lt;br&gt;# See how we were called.&lt;br&gt;case &amp;quot;$1&amp;quot; in&lt;br&gt;  start)&lt;br&gt;        if [ -n &amp;quot;`/sbin/pidof $BASE`&amp;quot; ]; then&lt;br&gt;                echo -n $&amp;quot;$BASE: already running&amp;quot;&lt;br&gt;                echo &amp;quot;&amp;quot;&lt;br&gt;                exit $RETVAL&lt;br&gt;        fi&lt;br&gt;        echo -n &amp;quot;Starting snort service: &amp;quot;&lt;br&gt;        /usr/local/bin/$BASE $INTERFACE -c $CONF $DAEMON&lt;br&gt;        sleep 1&lt;br&gt;        action &amp;quot;&amp;quot; /sbin/pidof $BASE&lt;br&gt;        RETVAL=$?&lt;br&gt;        [ $RETVAL -eq 0 ] &amp;amp;&amp;amp; touch /var/lock/subsys/snort&lt;br&gt;        ;;&lt;br&gt;  stop)&lt;br&gt;        echo -n &amp;quot;Shutting down snort service: &amp;quot;&lt;br&gt;        killproc $BASE&lt;br&gt;        RETVAL=$?&lt;br&gt;        echo&lt;br&gt;        [ $RETVAL -eq 0 ] &amp;amp;&amp;amp; rm -f /var/lock/subsys/snort&lt;br&gt;        ;;&lt;br&gt;  restart|reload)&lt;br&gt;        $0 stop&lt;br&gt;        $0 start&lt;br&gt;        RETVAL=$?&lt;br&gt;        ;;&lt;br&gt;  status)&lt;br&gt;        status $BASE&lt;br&gt;        RETVAL=$?&lt;br&gt;        ;;&lt;br&gt;  *)&lt;br&gt;        echo &amp;quot;Usage: snort {start|stop|restart|reload|status}&amp;quot;&lt;br&gt;        exit 1&lt;br&gt;esac&lt;br&gt;&lt;br&gt;exit $RETVAL&lt;br&gt;&lt;br&gt;&lt;/div&gt;
&lt;div&gt;&lt;pre&gt;第二个文件:用来启动&lt;font size=2&gt;barnyard&lt;/font&gt;&lt;/pre&gt;&lt;pre&gt;# program options&lt;br&gt;CONF=&amp;quot;/etc/snort/barnyard.conf&amp;quot;&lt;br&gt;GEN_MAP=&amp;quot;/etc/snort/gen-msg.map&amp;quot;&lt;br&gt;SID_MAP=&amp;quot;/etc/snort/sid-msg.map&amp;quot;&lt;br&gt;LOG_DIR=&amp;quot;/var/log/snort&amp;quot;&lt;br&gt;LOG_FILE=&amp;quot;snort.log&amp;quot;&lt;br&gt;WALDO_FILE=&amp;quot;/var/log/snort/barnyard.waldo&amp;quot;&lt;br&gt;DAEMON=&amp;quot;-D&amp;quot;&lt;/pre&gt;&lt;pre&gt;# Check that $BASE exists.&lt;br&gt;[ -f /usr/local/bin/$BASE ] || exit 0&lt;/pre&gt;&lt;pre&gt;# Source networking configuration.&lt;br&gt;. /etc/sysconfig/network&lt;/pre&gt;&lt;pre&gt;# Check that networking is up.&lt;br&gt;[ ${NETWORKING} = &amp;quot;no&amp;quot; ] &amp;amp;&amp;amp; exit 0&lt;/pre&gt;&lt;pre&gt;RETVAL=0&lt;/pre&gt;&lt;pre&gt;# See how we were called.&lt;br&gt;case &amp;quot;$1&amp;quot; in&lt;br&gt;start)&lt;br&gt;if [ -n &amp;quot;`/sbin/pidof $BASE`&amp;quot; ]; then&lt;br&gt;echo -n $&amp;quot;$BASE: already running&amp;quot;&lt;br&gt;echo &amp;quot;&amp;quot;&lt;br&gt;exit $RETVAL&lt;br&gt;fi&lt;br&gt;echo -n &amp;quot;Starting Barnyard: &amp;quot;&lt;br&gt;/usr/local/bin/$BASE -c $CONF -g $GEN-MAP -s $SID_MAP -d $LOG_DIR -f $LOG_FILE -w $WALDO_FILE $DAEMON&lt;br&gt;sleep 1&lt;br&gt;action &amp;quot;&amp;quot; /sbin/pidof $BASE&lt;br&gt;RETVAL=$?&lt;br&gt;[ $RETVAL -eq 0 ] &amp;amp;&amp;amp; touch /var/lock/subsys/barnyard&lt;br&gt;;;&lt;br&gt;stop)&lt;br&gt;echo -n &amp;quot;Shutting down Barnyard: &amp;quot;&lt;br&gt;killproc /usr/local/bin/$BASE&lt;br&gt;RETVAL=$?&lt;br&gt;echo&lt;br&gt;[ $RETVAL -eq 0 ] &amp;amp;&amp;amp; rm -f /var/lock/subsys/barnyard&lt;br&gt;;;&lt;br&gt;restart|reload)&lt;br&gt;$0 stop&lt;br&gt;$0 start&lt;br&gt;RETVAL=$?&lt;br&gt;;;&lt;br&gt;status)&lt;br&gt;status $BASE&lt;br&gt;RETVAL=$?&lt;br&gt;;;&lt;br&gt;*)&lt;br&gt;echo &amp;quot;Usage: barnyard {start|stop|restart|reload|status}&amp;quot;&lt;br&gt;exit 1&lt;br&gt;esac&lt;/pre&gt;&lt;pre&gt;exit $RETVAL&lt;/pre&gt;&lt;pre&gt; &lt;/pre&gt;&lt;pre&gt;基本上，安装条件具备了，下一步就开始snort＋adodb＋base&lt;/pre&gt;&lt;pre&gt; &lt;/pre&gt;&lt;pre&gt;。。。。。。。。。。。。。。待续&lt;br&gt;&lt;/pre&gt;&lt;/div&gt;&lt;img src="http://c.services.spaces.live.com/CollectionWebService/c.gif?cid=3114088440382333141&amp;page=RSS%3a+snort%2bbase+step+2&amp;referrer=" width="1px" height="1px" border="0" alt=""&gt;&lt;img style="position:absolute" alt="" width="0px" height="0px" src="http://c.live.com/c.gif?NC=31263&amp;amp;NA=1149&amp;amp;PI=73329&amp;amp;RF=&amp;amp;DI=3919&amp;amp;PS=85545&amp;amp;TP=yizh1977.spaces.live.com&amp;amp;GT1=yizh1977"&gt;</description><comments>http://yizh1977.spaces.live.com/Blog/cns!2B3776EFF823A0D5!224.entry#comment</comments><guid isPermaLink="true">http://yizh1977.spaces.live.com/Blog/cns!2B3776EFF823A0D5!224.entry</guid><pubDate>Mon, 17 Dec 2007 04:48:08 GMT</pubDate><slash:comments>0</slash:comments><msn:type>blogentry</msn:type><live:type>blogentry</live:type><live:typelabel>Blog entry</live:typelabel><wfw:commentRss>http://yizh1977.spaces.live.com/blog/cns!2B3776EFF823A0D5!224/comments/feed.rss</wfw:commentRss><wfw:comment>http://yizh1977.spaces.live.com/Blog/cns!2B3776EFF823A0D5!224.entry#comment</wfw:comment><dcterms:modified>2007-12-18T08:22:06Z</dcterms:modified></item><item><title>snort+base step 1</title><link>http://yizh1977.spaces.live.com/Blog/cns!2B3776EFF823A0D5!217.entry</link><description>&lt;p&gt;&lt;img title=Sarcastic style="vertical-align:middle" height=19 alt=Sarcastic src="http://shared.live.com/HjKMzTS-xzcms40!CabizA/emoticons/smile_sarcastic.gif" width=19&gt;Naka原创: 
&lt;p&gt;参考了无数英文资料，虽然有些羞于写成原创，但是辛辛苦苦弄了三周&lt;img title=Sick style="vertical-align:middle" alt=Sick src="http://shared.live.com/HjKMzTS-xzcms40!CabizA/emoticons/smile_sick.gif"&gt;，才弄好&lt;img title=Wink style="vertical-align:middle" alt=Wink src="http://shared.live.com/HjKMzTS-xzcms40!CabizA/emoticons/smile_wink.gif"&gt;，那就自我安慰原创一下。所有参考文章我都放在&lt;br&gt;&lt;a href="http://cid-2b3776eff823a0d5.skydrive.live.com/browse.aspx/snort"&gt;http://cid-2b3776eff823a0d5.skydrive.live.com/browse.aspx/snort&lt;/a&gt; 如果有兴趣就可以看看。 
&lt;p&gt;&lt;br&gt;Snort算是安装完了，对于初学，Linux下Snort的安装过程充满了困难（软件兼容）。我接触linux的时候是Redhat7.3，使用了一年，之后再也没有接触了过。最近对网络安全和linu方面的一些知识很是来兴趣，以此又开始拿起linux。开始的时候，我直接下了个RHEL5来弄，由于不是注册用户，yum根本使用不了，后来才知道。。。。RHEL商业化了，郁闷啊。再后来下了个Centos 5，终于把snort给弄上了。分step1，2，3是因为我根本没有精力来一次把整个安装过程写下来。。。。。痛苦. 
&lt;p&gt;需要的软件和版本:&lt;br&gt;1,Centos 5 finall&lt;br&gt;2,mysql-server-5.0.22-2.1.0.1&lt;br&gt;3,mysql-bench-5.0.22-2.1.0.1&lt;br&gt;4,mysql-5.0.22-2.1.0.1&lt;br&gt;5,php-mysql-5.1.6-15.el5&lt;br&gt;6,mysql-devel-5.0.22-2.1.0.1&lt;br&gt;7,perl-DBD-MySQL-3.0007-1.fc6&lt;br&gt;8,mysqlclient10&lt;br&gt;9,httpd-2.2.3-11.el5.centos&lt;br&gt;10,Gcc-4.1.2-14.el5&lt;br&gt;11,pcre-devel-6.6-2.el5_1.7&lt;br&gt;12,php-gd-5.1.6-15.el5&lt;br&gt;13,Gd-2.0.33.9.3.fc6&lt;br&gt;14,glib2-devel-2.12.3-2.fc6&lt;br&gt;15,gcc-c++-4.1.2-14.el5&lt;br&gt;16,libpcap-devel-0.9.4-11.el5&lt;br&gt;17,php-pear-1.4.9-4&lt;br&gt;18,snort-2.6.0&lt;br&gt;19,base-1.3.8(用低版本出不来Graph Alert，我不知道什么原因)&lt;br&gt;20,snortrules-pr-2.4&lt;br&gt;21,adodb480 &lt;br&gt;22,barnyard2.0 
&lt;p&gt;&lt;br&gt;安装过程中,Centos默认安装就可以。之所以要写上面的这些软件包，是因为snort的安装过程不难，难的是这些软件的匹配和兼容(花了我三个周时间，当然，我是不是高手)。安装环境准备： 
&lt;p&gt;&lt;br&gt;1，别看这么多软件是吓倒了，使用yum能够很方便的安装Centos的软件环境。&lt;br&gt;    yum –y  install －－alldepeds mysql mysql-bench mysql-server mysql-devel mysqlclient10 php-mysql httpd gcc pcre-devel php-gd gd mod_ssl glib2-devel gcc-c++ libpcap-devel php php-pear等待吧，最好你的网络足够好，反正我默认安装Centos之后，通过yum还要下载75M的，在家里使用adsl根本没戏，时间太长。在单位就好点，所以也就是我最近天天加班的原因 ：） ．yum完之后，验证一下httpd和mysql运行是不是正常. 
&lt;p&gt;&lt;br&gt;2，建立一个文件夹，此文件夹用来放Centos系统不带的所有软件，包括snort，snort rules，base，adodb，banryard等等&lt;br&gt;   &lt;a href="http://www.snort.org/dl/old"&gt;http://www.snort.org/dl/old&lt;/a&gt;  因为现在是snort最新版本是&lt;a href="http://yizh1977.spaces.live.com/dl/old/snort-2.8.0.tar.gz"&gt;&lt;u&gt;&lt;font color="#0000ff"&gt;snort-2.8.0.tar.gz&lt;/font&gt;&lt;/u&gt;&lt;/a&gt;，而我只用了老版本，所以可以直接在这个地址下载&lt;br&gt;　&lt;a href="http://www.snort.org/dl/barnyard/"&gt;http://www.snort.org/dl/barnyard/&lt;/a&gt; barnyard下载&lt;br&gt;   &lt;a href="http://easynews.dl.sourceforge.net/sourceforge/adodb/"&gt;http://easynews.dl.sourceforge.net/sourceforge/adodb/&lt;/a&gt; adodb下载&lt;br&gt;   &lt;a href="http://easynews.dl.sourceforge.net/sourceforge/secureideas/"&gt;http://easynews.dl.sourceforge.net/sourceforge/secureideas/&lt;/a&gt; base下载 
&lt;p&gt;待续．．．．．．．．．．．．&lt;br&gt; &lt;br&gt;&lt;br&gt;&lt;br&gt;   
&lt;p&gt;  
&lt;p&gt;  
&lt;p&gt; &lt;img src="http://c.services.spaces.live.com/CollectionWebService/c.gif?cid=3114088440382333141&amp;page=RSS%3a+snort%2bbase+step+1&amp;referrer=" width="1px" height="1px" border="0" alt=""&gt;&lt;img style="position:absolute" alt="" width="0px" height="0px" src="http://c.live.com/c.gif?NC=31263&amp;amp;NA=1149&amp;amp;PI=73329&amp;amp;RF=&amp;amp;DI=3919&amp;amp;PS=85545&amp;amp;TP=yizh1977.spaces.live.com&amp;amp;GT1=yizh1977"&gt;</description><comments>http://yizh1977.spaces.live.com/Blog/cns!2B3776EFF823A0D5!217.entry#comment</comments><guid isPermaLink="true">http://yizh1977.spaces.live.com/Blog/cns!2B3776EFF823A0D5!217.entry</guid><pubDate>Sun, 16 Dec 2007 11:51:02 GMT</pubDate><slash:comments>2</slash:comments><msn:type>blogentry</msn:type><live:type>blogentry</live:type><live:typelabel>Blog entry</live:typelabel><wfw:commentRss>http://yizh1977.spaces.live.com/blog/cns!2B3776EFF823A0D5!217/comments/feed.rss</wfw:commentRss><wfw:comment>http://yizh1977.spaces.live.com/Blog/cns!2B3776EFF823A0D5!217.entry#comment</wfw:comment><dcterms:modified>2007-12-16T12:19:18Z</dcterms:modified></item><item><title>Analyzing Snort Data With the Basic Analysis and Security Engine (BASE)</title><link>http://yizh1977.spaces.live.com/Blog/cns!2B3776EFF823A0D5!206.entry</link><description>&lt;h5&gt;Analyzing Snort Data With the Basic Analysis and Security Engine (BASE)&lt;/h5&gt; &lt;p&gt;&lt;i&gt;Amy Rich, October 2005&lt;/i&gt; &lt;p&gt;&lt;b&gt;Abstract: &lt;/b&gt;This article describes storing Snort alert output in a MySQL database and using the web front end BASE to analyze the data. &lt;p&gt;&lt;b&gt;Contents&lt;/b&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="http://www.sun.com/#intro"&gt;Introduction to BASE&lt;/a&gt; &lt;li&gt;&lt;a href="http://www.sun.com/#prereqs"&gt;Installing and Configuring the Necessary Prerequisites&lt;/a&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="http://www.sun.com/#mysql"&gt;MySQL&lt;/a&gt; &lt;li&gt;&lt;a href="http://www.sun.com/#snort"&gt;Snort&lt;/a&gt; &lt;li&gt;&lt;a href="http://www.sun.com/#php"&gt;PHP&lt;/a&gt; &lt;li&gt;&lt;a href="http://www.sun.com/#adodb"&gt;ADOdb&lt;/a&gt; &lt;li&gt;&lt;a href="http://www.sun.com/#pear"&gt;PEAR Modules&lt;/a&gt;&lt;/ul&gt; &lt;li&gt;&lt;a href="http://www.sun.com/#base"&gt;Installing and Configuring BASE&lt;/a&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="http://www.sun.com/#install"&gt;Downloading and Installing BASE&lt;/a&gt; &lt;li&gt;&lt;a href="http://www.sun.com/#config"&gt;Configuring BASE&lt;/a&gt;&lt;/ul&gt; &lt;li&gt;&lt;a href="http://www.sun.com/#using"&gt;Using BASE&lt;/a&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="http://www.sun.com/#main"&gt;Navigating the Main Screen&lt;/a&gt; &lt;li&gt;&lt;a href="http://www.sun.com/#alertgroups"&gt;Creating Alert Groups&lt;/a&gt; &lt;li&gt;&lt;a href="http://www.sun.com/#search"&gt;The Search Function&lt;/a&gt; &lt;li&gt;&lt;a href="http://www.sun.com/#graphs"&gt;Generating Graphs&lt;/a&gt;&lt;/ul&gt; &lt;li&gt;&lt;a href="http://www.sun.com/#resources"&gt;Resources&lt;/a&gt;&lt;/ul&gt; &lt;p&gt;In the article &lt;a href="http://www.sun.com/bigadmin/features/articles/intrusion_detection.html"&gt;Introduction to Intrusion Detection With Snort&lt;/a&gt;, I covered basic concepts of intrusion detection and the installation and use of Snort, a network-based intrusion detection system (NIDS). In this article, I'll detail storing Snort alert output in a MySQL database and using the web front end &lt;a href="http://secureideas.sourceforge.net/"&gt;BASE&lt;/a&gt; to analyze the data. BASE is the successor to ACID, the Analysis Console for Intrusion Databases, developed by Roman Danyliw at the CERT Coordination Center as a part of the &lt;a href="http://www.cert.org/kb/aircert/"&gt;AirCERT&lt;/a&gt; (Automated Incident Reporting) project. BASE is actively maintained and supported by a team of volunteers led by Kevin Johnson and Joel Esler. &lt;h6&gt;&lt;a&gt;&lt;/a&gt;Introduction to BASE, the Basic Analysis and Security Engine&lt;/h6&gt; &lt;p&gt;BASE searches and processes databases containing security events logged by assorted network monitoring tools such as firewalls and IDS programs. BASE is written in the &lt;a href="http://www.php.net/"&gt;PHP&lt;/a&gt; programming language and displays information from a database in a user friendly web front end. When used with Snort, BASE reads both tcpdump binary log formats and Snort alert formats. Once data is logged and processed, BASE has the ability to graphically display both layer-3 and layer-4 packet information. It also generates graphs and statistics based on time, sensor, signature, protocol, IP address, TCP/UDP port, or classification. The BASE search interface can query based on alert meta information such as sensor, alert group, signature, classification, and detection time, as well as packet data such as source/destination addresses, ports, packet payload, or packet flags. &lt;p&gt;BASE allows for the easy management of alert data. The administrator can categorize data into alert groups, delete false positives or previously handled alerts, and archive and export alert data to an email address for administrative notification or further processing. Support for user logins and roles, allowing an administrator to control what is seen through the web interface, is also expected in an upcoming release of BASE. As of the current release of BASE (1.1.3), the hooks are there, but the code is not yet functional. &lt;p&gt;In the case we'll examine, Snort will log alert data to a MySQL database which will then be read by BASE and displayed via an Apache web server. BASE also supports other database back ends and can display information via any web server that supports PHP. &lt;h6&gt;&lt;a&gt;&lt;/a&gt;Installing and Configuring the Necessary Prerequisites&lt;/h6&gt; &lt;p&gt;In order for BASE to function, we must first install and configure a back end database, in this case MySQL, to store the Snort alerts. In addition, we'll need Apache and Snort compiled with MySQL support. We also need to install PHP and a couple of PHP add-ons. ADOdb is an object-oriented PHP library used to interface to the database. You may already have some of these necessary tools on your system as part of the default distribution, depending on what version of the operating system you're running. The instructions below assume you are using the GNU tool chain (&lt;code&gt;tar&lt;/code&gt;, &lt;code&gt;make&lt;/code&gt;, &lt;code&gt;gcc&lt;/code&gt;, and so on). &lt;p&gt;&lt;a&gt;&lt;/a&gt;&lt;b&gt;MySQL&lt;/b&gt; &lt;p&gt;We first start by obtaining and installing the MySQL package from &lt;a href="http://www.mysql.com/"&gt;MySQL&lt;/a&gt;. When unpacking, be sure to use GNU &lt;code&gt;tar&lt;/code&gt;, since &lt;code&gt;tar&lt;/code&gt; in the Solaris OS has issues with long file names. To avoid dependencies, we'll configure MySQL to build without &lt;code&gt;libgcc&lt;/code&gt; and without &lt;code&gt;zlib&lt;/code&gt;, but we'll still compile against &lt;code&gt;openssl&lt;/code&gt;. (This assumes you've previously installed &lt;code&gt;gcc&lt;/code&gt; and &lt;code&gt;openssl&lt;/code&gt;.)&lt;pre&gt;wget \
  http://dev.mysql.com/get/Downloads/MySQL-4.1/mysql-4.1.13.tar.gz/\
  from/http://mysql.mirrors.pair.com/

tar zxf mysql-4.1.13.tar.gz
cd mysql-4.1.13

LDFLAGS=&amp;quot;-R/usr/local/lib&amp;quot; ./configure --prefix=/usr/local \
     --with-openssl \
     --without-docs \
     --without-libgcc \
     --with-named-z-libs=z
make
make install
&lt;/pre&gt;
&lt;p&gt;If you run into issues compiling or installing MySQL, take a look at the &lt;a href="http://dev.mysql.com/doc/mysql/en/solaris.html"&gt;Solaris OS section&lt;/a&gt; of the &lt;a href="http://dev.mysql.com/doc/mysql/en/index.html"&gt;MySQL Reference Manual&lt;/a&gt;.
&lt;p&gt;&lt;a&gt;&lt;/a&gt;&lt;b&gt;Snort&lt;/b&gt;
&lt;p&gt;Now that we have MySQL installed, we can compile Snort with MySQL support. Slightly modify the installation directions from the &lt;a href="http://www.sun.com/bigadmin/features/articles/intrusion_detection.html"&gt;previous article on Snort&lt;/a&gt;:&lt;pre&gt;../configure --with-mysql=/usr/local --with-openssl=/usr/local
&lt;/pre&gt;
&lt;p&gt;Then follow the rest of the installation instructions provided there.
&lt;p&gt;Now set up the Snort database in MySQL. First create the &lt;code&gt;snort&lt;/code&gt; user and grant the appropriate permissions:&lt;pre&gt;mysqladmin -u root -p create snort
&lt;/pre&gt;
&lt;p&gt;Next, run the MySQL script included in the Snort source directory to create the appropriate tables:&lt;pre&gt;mysql -u root -p &amp;lt; snort-2.3.3/schemas/create_mysql snort
&lt;/pre&gt;
&lt;p&gt;Now add the &lt;code&gt;snort&lt;/code&gt; user and set the permissions:&lt;pre&gt;mysql -u root -p snort

mysql&amp;gt; set PASSWORD FOR snort@localhost=PASSWORD('snort_user_password');
mysql&amp;gt; grant CREATE,INSERT,SELECT,DELETE,UPDATE on snort.* to snort@localhost;
mysql&amp;gt; flush privileges;
mysql&amp;gt; exit
&lt;/pre&gt;
&lt;p&gt;Finally, edit the &lt;code&gt;snort.conf&lt;/code&gt; file and modify the output plug-in:&lt;pre&gt;output database: log, mysql, dbname=snort user=snort password=snort host=localhost
output database: alert, mysql, dbname=snort user=snort password=snort host=localhost
&lt;/pre&gt;
&lt;p&gt;This will cause both log and alert data to be written to the database.
&lt;p&gt;To verify that Snort is able to write to MySQL, make sure MySQL is running, then start Snort with the following options:&lt;pre&gt;snort -c /etc/snort.conf -g snort
&lt;/pre&gt;
&lt;p&gt;Once Snort and MySQL are running, wait a few moments until it collects some alert data. Then run the following command:&lt;pre&gt;echo &amp;quot;SELECT count(*) FROM event&amp;quot; | mysql -u root -p snort
&lt;/pre&gt;
&lt;p&gt;Your output should look similar to the following, where the number is the number of alerts you've received:&lt;pre&gt;count(*)
1
&lt;/pre&gt;
&lt;p&gt;If the number is zero, then you haven't seen any traffic that will trigger an alert, or you need to revisit your Snort/MySQL configurations.
&lt;p&gt;&lt;a&gt;&lt;/a&gt;&lt;b&gt;PHP&lt;/b&gt;
&lt;p&gt;This article assumes that you're running Apache as your web server, and that you've installed it with the GNU layout. If you're using a different web server or have installed Apache in a different location, these directions will need modification. First, download PHP from a nearby mirror. I've chosen &lt;code&gt;us2.php.net&lt;/code&gt;: &lt;pre&gt;wget http://us2.php.net/get/php-4.3.11.tar.gz/from/this/mirror
&lt;/pre&gt;
&lt;p&gt;Now configure PHP to install into &lt;code&gt;/usr/local/php&lt;/code&gt; and use &lt;code&gt;apxs&lt;/code&gt; to add the &lt;code&gt;libphp4.so&lt;/code&gt; module to Apache. The PHP configure lines below also tell PHP where to find MySQL, GNU &lt;code&gt;gettext&lt;/code&gt;, &lt;code&gt;OpenSSL&lt;/code&gt;, &lt;code&gt;zlib&lt;/code&gt;, &lt;code&gt;libjpeg&lt;/code&gt;, and &lt;code&gt;libpng&lt;/code&gt;:&lt;pre&gt;LDFLAGS=&amp;quot;-R/usr/local/lib&amp;quot;  ./configure --prefix=/usr/local/php \
     --enable-memory-limit=yes \
     --with-apxs=/usr/local/sbin/apxs \
     --with-gettext=/usr/local \
     --with-exif \
     --without-mm \
     --with-mysql=/usr/local \
     --with-openssl=/usr/local \
     --with-zlib \
     --with-jpeg-dir=/usr/local \
     --with-png-dir=/usr/local \
     --with-exec-dir=/usr/local/php/libexec \
     --enable-cli \
     --enable-sockets
make
make install
&lt;/pre&gt;
&lt;p&gt;In a production environment, you'll want to edit &lt;code&gt;/usr/local/php/lib/php.ini&lt;/code&gt; and set the &lt;code&gt;display_errors&lt;/code&gt; variable to &lt;code&gt;off&lt;/code&gt; so that debugging messages will not be inlined in the HTML. If you prefer to have inline debugging messages, then it's recommended to at least set the &lt;code&gt;error_reporting&lt;/code&gt; variable to &lt;code&gt;E_ALL &amp;amp; ~E_NOTICE&lt;/code&gt;.
&lt;p&gt;Obtain further information about &lt;code&gt;PHP&lt;/code&gt; from the &lt;a href="http://www.php.net/"&gt;PHP web site&lt;/a&gt;, and further information about Apache from the &lt;a href="http://httpd.apache.org/"&gt;Apache HTTP Server Project site&lt;/a&gt;.
&lt;p&gt;&lt;a&gt;&lt;/a&gt;&lt;b&gt;ADOdb&lt;/b&gt;
&lt;p&gt;&lt;a href="http://adodb.sourceforge.net/"&gt;ADOdb&lt;/a&gt; is a performance-conscious database abstraction layer for PHP. BASE requires ADOdb to talk to MySQL on the back end. First, obtain the source:&lt;pre&gt;wget http://unc.dl.sourceforge.net/sourceforge/adodb/adodb465.tgz
&lt;/pre&gt;
&lt;p&gt;Then unpack the source and place ADOdb where it can be accessed by BASE. The documentation recommends placing it in the Apache document root, but you can also configure BASE with ADOdb outside of Apache's tree (such as &lt;code&gt;/usr/local/share/&lt;/code&gt;) if desired.
&lt;p&gt;&lt;a&gt;&lt;/a&gt;&lt;b&gt;PEAR Modules&lt;/b&gt;
&lt;p&gt;BASE documentation also recommends installing several &lt;a href="http://pear.php.net/"&gt;PEAR&lt;/a&gt; modules. PEAR, the PHP Extension and Application Repository, is installed as part of PHP and is to PHP what CPAN is to Perl. If &lt;code&gt;PEAR::Image_Graph&lt;/code&gt; is not already installed, obtain it by running the following commands:&lt;pre&gt;/usr/local/php/bin/pear install Image_Color
/usr/local/php/bin/pear install Log
/usr/local/php/bin/pear install Numbers_Roman
/usr/local/php/bin/pear install http://pear.php.net/get/Numbers_Words-0.13.1.tgz
/usr/local/php/bin/pear install http://pear.php.net/get/Image_Graph-0.3.0dev4.tgz
&lt;/pre&gt;
&lt;h6&gt;&lt;a&gt;&lt;/a&gt;Installing and Configuring BASE&lt;/h6&gt;
&lt;p&gt;Now that all of the prerequisites are in place, we can install and configure BASE itself.
&lt;p&gt;&lt;b&gt;&lt;a&gt;&lt;/a&gt;Downloading and Installing BASE&lt;/b&gt;
&lt;p&gt;First go to &lt;a href="http://prdownloads.sourceforge.net/secureideas/base-1.1.3.tar.gz?download"&gt;http://prdownloads.sourceforge.net/secureideas/base-1.1.3.tar.gz?download&lt;/a&gt; and pick a mirror from which to download the source code. Next, unpack the source tarball into your Apache &lt;code&gt;DocumentRoot&lt;/code&gt;:&lt;pre&gt;cd /usr/local/apache/htdocs
tar zxf /path/to/base-1.1.3.tar.gz
mv base-1.1.3 base
&lt;/pre&gt;
&lt;p&gt;Use the supplied SQL script to create the BASE database:&lt;pre&gt;mysql -u root -p &amp;lt; base/sql/create_base_tbls_mysql.sql snort
&lt;/pre&gt;
&lt;p&gt;If you're using a database other than MySQL or upgrading to BASE from ACID, there are different scripts available in the &lt;code&gt;base/sql&lt;/code&gt; directory.
&lt;p&gt;&lt;b&gt;&lt;a&gt;&lt;/a&gt;Configuring BASE&lt;/b&gt;
&lt;p&gt;Once you create the database, configure BASE by copying the &lt;code&gt;base_conf.php.dist&lt;/code&gt; file to &lt;code&gt;base_conf.php&lt;/code&gt; and customizing it to fit your environment:&lt;pre&gt;cd base
cp base_conf.php.dist base_conf.php
&lt;/pre&gt;
&lt;p&gt;Options in the &lt;code&gt;config&lt;/code&gt; file are all well commented, but those listed in the table below are the minimum that must be set.
&lt;p&gt;Table 1: Required Configuration Options
&lt;p&gt;Variable
&lt;p&gt;Function
&lt;p&gt;Value
&lt;p&gt;&lt;code&gt;$DBlib_path&lt;/code&gt;
&lt;p&gt;Full path to the ADOdb installation
&lt;p&gt;&amp;quot;&lt;code&gt;/usr/local/share/adodb&lt;/code&gt;&amp;quot;
&lt;p&gt;&lt;code&gt;$DBtype&lt;/code&gt;
&lt;p&gt;Type of database used
&lt;p&gt;&amp;quot;&lt;code&gt;mysql&lt;/code&gt;&amp;quot;
&lt;p&gt;&lt;code&gt;$Use_Auth_System&lt;/code&gt;
&lt;p&gt;Set to 1 to force users to authenticate to use BASE
&lt;p&gt;&lt;code&gt;0&lt;/code&gt;
&lt;p&gt;&lt;code&gt;$BASE_urlpath&lt;/code&gt;
&lt;p&gt;The root URI of your site
&lt;p&gt;&amp;quot;&lt;code&gt;/base&lt;/code&gt;&amp;quot;
&lt;p&gt;&lt;code&gt;$alert_dbname&lt;/code&gt;
&lt;p&gt;The alert database name
&lt;p&gt;&amp;quot;&lt;code&gt;snort&lt;/code&gt;&amp;quot;
&lt;p&gt;&lt;code&gt;$alert_host&lt;/code&gt;
&lt;p&gt;The alert database server
&lt;p&gt;&amp;quot;&lt;code&gt;localhost&lt;/code&gt;&amp;quot;
&lt;p&gt;&lt;code&gt;$alert_port&lt;/code&gt;
&lt;p&gt;The port where the database is stored&lt;br&gt;&lt;i&gt;(Leave blank if you're not running MySQL on a network socket.)&lt;/i&gt;
&lt;p&gt;&amp;quot;&amp;quot;
&lt;p&gt;&lt;code&gt;$alert_user&lt;/code&gt;
&lt;p&gt;The username for the alert database
&lt;p&gt;&amp;quot;&lt;code&gt;snort&lt;/code&gt;&amp;quot;
&lt;p&gt;&lt;code&gt;$alert_password&lt;/code&gt;
&lt;p&gt;The password for the username
&lt;p&gt;&amp;quot;&lt;code&gt;snort_user_password&lt;/code&gt;&amp;quot;
&lt;p&gt;Until the authentication portion of BASE is working properly, protect the directory where you installed BASE. Apache can be configured to deny access based on IP address, as well as to require a user to enter a password. Modify &lt;code&gt;/usr/local/apache/etc/httpd.conf&lt;/code&gt; and add something like the following to allow users from the host 192.168.1.100 to authenticate:&lt;pre&gt;&amp;lt;Directory /usr/local/apache/htdocs/base/&amp;gt; 
Order Deny, Allow
Deny from All
Allow from 192.168.1.100
AuthType Basic
AuthName Access is restricted.
AuthUserFile /path/to/htpasswd/file
require valid-user
&amp;lt;/Directory&amp;gt; 
&lt;/pre&gt;
&lt;p&gt;Populate the &lt;code&gt;.htpasswd&lt;/code&gt; file with username and encrypted password data. Please refer to the documentation on the &lt;a href="http://httpd.apache.org/"&gt;Apache web site&lt;/a&gt; for more help on configuring access restriction.
&lt;h6&gt;&lt;a&gt;&lt;/a&gt;Using BASE&lt;/h6&gt;
&lt;p&gt;You should now have a functional BASE install accessible at &lt;code&gt;http://www.your.domain/base&lt;/code&gt;, and you're ready to begin using the GUI to view and manage alerts.
&lt;p&gt;&lt;b&gt;&lt;a&gt;&lt;/a&gt;Navigating the Main Screen&lt;/b&gt;
&lt;p&gt;Once you log in, the main page shows a summary of currently logged alerts as well as various alert summary breakdowns and links to graphs (see Figure 1).
&lt;p&gt;&lt;a href="http://www.sun.com/bigadmin/features/images/snort_base_fig1.gif"&gt;&lt;img height=274 alt="Figure 1" src="http://www.sun.com/bigadmin/features/images/snort_base_fig1_th.jpg" width=400 border=1&gt;&lt;/a&gt;
&lt;p&gt;&lt;b&gt;Figure 1: Main Page of BASE&lt;/b&gt;&lt;br&gt;&lt;i&gt;(Click to Enlarge)&lt;/i&gt;
&lt;p&gt;Drilling down into any of the summaries will present a list of events. Depending on the list, it is possible to drill further down and gain more detail. For example, following the link &lt;code&gt;Today's alerts: unique&lt;/code&gt;, brings up a new screen with a summary of alerts which begin at the previous midnight. A link labeled &lt;code&gt;snort&lt;/code&gt;, located to the left of each signature, attempts to connect to the signature database at &lt;a href="http://www.snort.org/"&gt;the Snort web site&lt;/a&gt; and provide more detailed information about that particular signature.
&lt;p&gt;Drilling down on a source or destination IP address on any of the screens brings up a summary that includes how many times that IP was logged as a source or destination address. It also indicates the first and last time the IP was logged. Additionally, the summary page contains links to external web-based tools that provide DNS and Whois lookup services.
&lt;p&gt;Drilling down on the source or destination port's links displays a summary of ports, number of occurrences, time first seen and time last seen. Each listed port number is a hyperlink to the &lt;a href="http://isc.sans.org/"&gt;SANS Internet Storm Center&lt;/a&gt; page for that port number.
&lt;p&gt;&lt;a&gt;&lt;/a&gt;&lt;b&gt;Creating Alert Groups&lt;/b&gt;
&lt;p&gt;Alert groups can be created to group event information into user-defined categories for easy perusal. In order to create a new alert group or modify existing groups, click on the &lt;code&gt;Alert Group Maintenance&lt;/code&gt; link at the bottom of the main page.
&lt;p&gt;Next, click the &lt;code&gt;Create&lt;/code&gt; link and fill out the name and description fields for the new group. For this example I'll create an alert group named &lt;code&gt;test2&lt;/code&gt; based on an alert signature. To do so, I return to the main page and select the &lt;code&gt;Unique alerts&lt;/code&gt; link, then decide to use the signature named &lt;code&gt;IIS UNICODE CODEPOINT ENCODING&lt;/code&gt;.
&lt;p&gt;I check the box next to that signature, then scroll to &lt;code&gt;Action&lt;/code&gt; box at the bottom of the page. From the drop down menu labeled &lt;code&gt;{action}&lt;/code&gt; I select the option to &lt;code&gt;ADD to AG by Name&lt;/code&gt;, type in &lt;code&gt;test2&lt;/code&gt;, and click on the &lt;code&gt;Selected&lt;/code&gt; button. Returning to the &lt;code&gt;Alert Group Maintenance&lt;/code&gt; screen I see that the group &lt;code&gt;test2&lt;/code&gt; now shows two alerts.
&lt;p&gt;&lt;a&gt;&lt;/a&gt;&lt;b&gt;The Search Function&lt;/b&gt;
&lt;p&gt;BASE has a search function that can be used to quickly search through the database for certain criteria and present it in an ordered fashion.
&lt;p&gt;&lt;a href="http://www.sun.com/bigadmin/features/images/snort_base_fig2.gif"&gt;&lt;img height=233 alt="Figure 1" src="http://www.sun.com/bigadmin/features/images/snort_base_fig2_th.jpg" width=400 border=1&gt;&lt;/a&gt;
&lt;p&gt;&lt;b&gt;Figure 2: Search Function in BASE&lt;/b&gt;&lt;br&gt;&lt;i&gt;(Click to Enlarge)&lt;/i&gt;
&lt;p&gt;The allowable search criteria include Alert Group, Signature, and Alert Time. The results can be ordered by timestamp, signature, source IP, or destination IP. Unfortunately, there is no option to use an IP address as one of the criteria.
&lt;p&gt;&lt;a&gt;&lt;/a&gt;&lt;b&gt;Generating Graphs&lt;/b&gt;
&lt;p&gt;Graphs can be created from Alert Data or Alert Detection Time.
&lt;p&gt;The Alert Data can be graphed and charted based on a variety of options to create easily readable reports. Figure 3 below shows a screen shot of a simple pie chart.
&lt;p&gt;&lt;a href="http://www.sun.com/bigadmin/features/images/snort_base_fig3.gif"&gt;&lt;img height=275 alt="Figure 3" src="http://www.sun.com/bigadmin/features/images/snort_base_fig3_th.jpg" width=400 border=1&gt;&lt;/a&gt;
&lt;p&gt;&lt;b&gt;Figure 3: Pie Graph of Time vs. Number of Alerts&lt;/b&gt;&lt;br&gt;&lt;i&gt;(Click to Enlarge)&lt;/i&gt;
&lt;p&gt;This next screen shot shows a bar graph based on Alert Detection Time which can be used to identify periods of heavy activity.
&lt;p&gt;&lt;a href="http://www.sun.com/bigadmin/features/images/snort_base_fig4.gif"&gt;&lt;img height=239 alt="Figure 4" src="http://www.sun.com/bigadmin/features/images/snort_base_fig4_th.jpg" width=400 border=1&gt;&lt;/a&gt;
&lt;p&gt;&lt;b&gt;Figure 4: Bar Graph of Time vs. Number of Alerts&lt;/b&gt;&lt;br&gt;&lt;i&gt;(Click to Enlarge)&lt;/i&gt;
&lt;p&gt;These charts and graphs allow the system administrator to visually pinpoint periods of attacks. The images created by BASE are also a valuable resource for inclusion in managerial reports and departmental presentations dealing with site security.
&lt;h6&gt;&lt;a&gt;&lt;/a&gt;Resources&lt;/h6&gt;
&lt;p&gt;&lt;b&gt;BASE Resources&lt;/b&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://secureideas.sourceforge.net/"&gt;BASE main page&lt;/a&gt;
&lt;li&gt;&lt;a href="http://secureideas.sourceforge.net/faq.php"&gt;BASE FAQ&lt;/a&gt;
&lt;li&gt;&lt;a href="http://sourceforge.net/forum/?group_id=103348"&gt;BASE forums&lt;/a&gt;
&lt;li&gt;&lt;a href="http://sourceforge.net/mailarchive/forum.php?forum_id=42223"&gt;secureideas-base-devel&lt;/a&gt; mailing list 
&lt;li&gt;&lt;a href="http://sourceforge.net/mailarchive/forum.php?forum_id=42565"&gt;secureideas-base-users&lt;/a&gt; mailing list &lt;/ul&gt;
&lt;p&gt;&lt;b&gt;Resources for Additional Software&lt;/b&gt;
&lt;ul&gt;
&lt;li&gt;MySQL &lt;a href="http://www.mysql.com"&gt;main site&lt;/a&gt; and &lt;a href="http://dev.mysql.com/doc/mysql/en/index.html"&gt;reference manual&lt;/a&gt;
&lt;li&gt;&lt;a href="http://www.php.net/"&gt;PHP&lt;/a&gt;
&lt;li&gt;&lt;a href="http://pear.php.net/"&gt;PEAR&lt;/a&gt;
&lt;li&gt;&lt;a href="http://www.snort.org/"&gt;Snort&lt;/a&gt;
&lt;li&gt;&lt;a href="http://httpd.apache.org/"&gt;Apache HTTP Server Project&lt;/a&gt;
&lt;li&gt;&lt;a href="http://adodb.sourceforge.net/"&gt;ADOdb&lt;/a&gt;&lt;/ul&gt;
&lt;p&gt;&lt;b&gt;Other Resources&lt;/b&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://www.sun.com/bigadmin/features/articles/intrusion_detection.html"&gt;Introduction to Intrusion Detection With Snort&lt;/a&gt;
&lt;li&gt;&lt;a href="http://www.cert.org/kb/aircert/"&gt;AirCERT&lt;/a&gt; project 
&lt;li&gt;&lt;a href="http://isc.sans.org/"&gt;SANS Internet Storm Center&lt;/a&gt;&lt;/ul&gt;&lt;img src="http://c.services.spaces.live.com/CollectionWebService/c.gif?cid=3114088440382333141&amp;page=RSS%3a+Analyzing+Snort+Data+With+the+Basic+Analysis+and+Security+Engine+(BASE)&amp;referrer=" width="1px" height="1px" border="0" alt=""&gt;&lt;img style="position:absolute" alt="" width="0px" height="0px" src="http://c.live.com/c.gif?NC=31263&amp;amp;NA=1149&amp;amp;PI=73329&amp;amp;RF=&amp;amp;DI=3919&amp;amp;PS=85545&amp;amp;TP=yizh1977.spaces.live.com&amp;amp;GT1=yizh1977"&gt;</description><comments>http://yizh1977.spaces.live.com/Blog/cns!2B3776EFF823A0D5!206.entry#comment</comments><guid isPermaLink="true">http://yizh1977.spaces.live.com/Blog/cns!2B3776EFF823A0D5!206.entry</guid><pubDate>Sat, 15 Dec 2007 08:14:27 GMT</pubDate><slash:comments>0</slash:comments><msn:type>blogentry</msn:type><live:type>blogentry</live:type><live:typelabel>Blog entry</live:typelabel><wfw:commentRss>http://yizh1977.spaces.live.com/blog/cns!2B3776EFF823A0D5!206/comments/feed.rss</wfw:commentRss><wfw:comment>http://yizh1977.spaces.live.com/Blog/cns!2B3776EFF823A0D5!206.entry#comment</wfw:comment><dcterms:modified>2007-12-15T08:14:27Z</dcterms:modified></item><item><title>centso 下的snort base终于工作了</title><link>http://yizh1977.spaces.live.com/Blog/cns!2B3776EFF823A0D5!187.entry</link><description>&lt;a href="http://byfiles.storage.live.com/y1pW9q1nnvcwsgb3b2eor9A8_znwCaQSuNWOCaE4eYeOVNGCrDM4Ua9al-cVpZ3bKcfGbEDG-yOno4" target="_blank"&gt;&lt;/a&gt;
&lt;div&gt;&lt;img title="大笑" style="vertical-align:middle" height=19 alt="大笑" src="http://shared.live.com/HjKMzTS-xzcms40!CabizA/emoticons/smile_teeth.gif" width=19&gt;&lt;img title="大笑" style="vertical-align:middle" height=19 alt="大笑" src="http://shared.live.com/HjKMzTS-xzcms40!CabizA/emoticons/smile_teeth.gif" width=19&gt;&lt;/div&gt;
&lt;div&gt;值得开心的是。。。经过三个周的攻坚，终于在这个时候，Base开始工作了，终于走进了这个免费IDS的空间。安装过程一波三折，郁闷之极，但是结果确令人愉快，攻略是写不动了，先贴个图表示庆贺。&lt;/div&gt;
&lt;div&gt;&lt;a href="http://byfiles.storage.live.com/y1pW9q1nnvcwsi6apgfRFEnXjGHiMJG1e42Cer6lypH6qdExOpfLCtL3ssNXQ5JuXRurd6cgzWm6m8" target="_blank"&gt;&lt;img height=200 alt=baseok src="http://byfiles.storage.live.com/y1pW9q1nnvcwsi6apgfRFEnXjGHiMJG1e42Cer6lypH6qdExOpfLCtL3ssNXQ5JuXRurd6cgzWm6m8" width=250&gt;&lt;/a&gt;&lt;/div&gt;&lt;img src="http://c.services.spaces.live.com/CollectionWebService/c.gif?cid=3114088440382333141&amp;page=RSS%3a+centso+%e4%b8%8b%e7%9a%84snort+base%e7%bb%88%e4%ba%8e%e5%b7%a5%e4%bd%9c%e4%ba%86&amp;referrer=" width="1px" height="1px" border="0" alt=""&gt;&lt;img style="position:absolute" alt="" width="0px" height="0px" src="http://c.live.com/c.gif?NC=31263&amp;amp;NA=1149&amp;amp;PI=73329&amp;amp;RF=&amp;amp;DI=3919&amp;amp;PS=85545&amp;amp;TP=yizh1977.spaces.live.com&amp;amp;GT1=yizh1977"&gt;</description><comments>http://yizh1977.spaces.live.com/Blog/cns!2B3776EFF823A0D5!187.entry#comment</comments><guid isPermaLink="true">http://yizh1977.spaces.live.com/Blog/cns!2B3776EFF823A0D5!187.entry</guid><pubDate>Tue, 11 Dec 2007 10:18:30 GMT</pubDate><slash:comments>1</slash:comments><msn:type>blogentry</msn:type><live:type>blogentry</live:type><live:typelabel>Blog entry</live:typelabel><wfw:commentRss>http://yizh1977.spaces.live.com/blog/cns!2B3776EFF823A0D5!187/comments/feed.rss</wfw:commentRss><wfw:comment>http://yizh1977.spaces.live.com/Blog/cns!2B3776EFF823A0D5!187.entry#comment</wfw:comment><dcterms:modified>2007-12-11T10:18:30Z</dcterms:modified></item></channel></rss>