Snort - Alert Log 分析
解壓縮 Snortsnarf[root@snort darwin]# tar zxvf SnortSnarf-1.0.tar.gz
因為snorfsnarf目錄內缺少Time-modules 所以要去下載安裝
解壓縮/安裝 Time-modules網址: http://www.cpan.org/modules/by-authors/id/MUIR/modules/
[root@snort darwin]# tar zxvf Time-modules-2006.0814.tar.gz
[root@snort darwin]# cd Time-modules-2006.0814
[root@snort Time-modules-2006.0814]# perl Makefile.PL
[root@snort Time-modules-2006.0814]# make
[root@snort Time-modules-2006.0814]# make install
[root@snort darwin]# mkdir /var/www/cgi-bin/snortsnarf //存放一些perl的地方
[root@snort darwin]# mkdir /var/www/html/snortsnarf //輸出index.html的地方
安裝snortsnarf[root@snort darwin]# cd SnortSnarf-1.0
[root@snort SnortSnarf-1.0]# cp cgi/* /var/www/cgi-bin/snortsnarf/
[root@snort SnortSnarf-1.0]# cp -r include/ /var/www/cgi-bin/snortsnarf/
[root@snort SnortSnarf-1.0]# cp snortsnarf.pl /var/www/cgi-bin/snortsnarf/
[root@snort snortsnarf]# cd /var/www/cgi-bin/snortsnarf/
[root@snort snortsnarf]# vi snortsnarf.pl
將第一行 #!/usr/bin/perl –w 的-w去掉
參數的意義如下:
-cgidir是apache中跑perl的地方
-d是輸出成網頁的地方
-homenet是自己的主機IP網段
-color設定顏色,只有yes及no,我當然是用yes啦!!
-rulesdir snort規則地方
/var/log/snort/alert是snort的輸出檔 也就是alert檔案, 作為snortsnarf 分析使用,可以加上snort的相關輸出檔,也可以2個以上, 如果要snort輸出好幾個檔案,那就要在snort.conf中設定, 預設是關掉的
執行結果[root@snort snortsnarf]# perl snortsnarf.pl -cgidir /var/www/cgi-bin/snortsnarf -d /var/www/html/snortsnarf -homenet 102.168.1.* -color='yes' -rulesfile snort.conf -rulesdir /etc/snort/rules /var/log/snort/alert