作者: 王维 出处:51CTO.com
这几个操作的含义和Libpcap相同)
然后,我们将对SNORT作一系列的调试,使其正常运行,也方便管理
[root@kykin-L-linux snort-1.9.0]# cp etc /usr/local/snort19 –r
(复制当前文件夹下的ETC目录到SNORT19下面)
[root@kykin-L-linux snort-1.9.0]# cp rules /usr/local/snort19 –r
(复制全部规则文件)
[root@kykin-L-linux snort-1.9.0]# cp etc/classification.config /root/
[root@kykin-L-linux snort-1.9.0]# cp etc/snort.conf /root/.snortrc
(将调用的文件属性修改)
|
做完这一些,我们的工作已经完成了一大部分。下面我们将完成比较重要的一部分。入侵检测的规则定制
[root@kykin-L-linux snort-1.9.0]#vi /root/.snortrc
# This file contains a sample snort configuration.
# You can take the following steps to create your
# own custom configuration:
#
# 1) Set the network variables for your network
# 2) Configure preprocessors
# 3) Configure output plugins
# 4) Customize your rule set
#
|
# Step #1: Set the network variables:
#
# You must change the following variables to reflect
# your local network. The variable is currently
# setup for an RFC 1918 address space.
#
# You can specify it explicitly as:
#
# var HOME_NET 10.1.1.0/24
|
(内容太多,暂时省略)
首先。我们在整个config文件的102行找到:
这个是本地存放规则的路径,我们必须根据自己的情况,完整写出来
我的文件是这样的:
var RULE_PATH /usr/local/snort19/rules
|
然后,在config文件的590行。我们将会看见:
include $RULE_PATH/bad-traffic.rules
|
从这里开始,一直到后面,就是SNORT的整个规则集合。我们必须根据自己的情况作出详细的调试
include $RULE_PATH/bad-traffic.rules
include $RULE_PATH/exploit.rules
include $RULE_PATH/scan.rules
include $RULE_PATH/finger.rules
include $RULE_PATH/ftp.rules
include $RULE_PATH/telnet.rules
include $RULE_PATH/rpc.rules
include $RULE_PATH/rservices.rules
include $RULE_PATH/dos.rules
|
(文件的内容太多,暂时省略)
你可以针对自己的系统的具体环境做出详细的规则说明,不需要的规则,就采取#注释的方法来去掉
为了可执行指令:SNORT的方便调用,我们将做出连接说明
[root@kykin-L-linuxsnort-1.9.0]#ln –s /usr/local/snort19/bin/snort /usr/sbin/snort
|
然后。我们将建立一个新的目录来存放SNORT日志文件
[root@kykin-L-linux snort-1.9.0]#cd /var/log
[root@kykin-L-linux snort-1.9.0]#mkdir snort
|
做完上面的一切,基本上完成了整个IDS的初步设定,下面我们将测试是否成功
[root@kykin-L-linux snort-1.9.0]#snort
Initializing Output Plugins!
Log directory = /var/log/snort
Initializing Network Interface eth0
using config file /root/.snortrc
Initializing Preprocessors!
Initializing Plug-ins!
Parsing Rules file /root/.snortrc
|
Initializing rule chains...
No arguments to frag2 directive, setting defaults to:
Fragment timeout: 60 seconds
Fragment memory cap: 4194304 bytes<
|
阅读(309) | 评论(0) | 转发(0) |