扫一扫
分享文章到微信
扫一扫
关注官方公众号
至顶头条
在本页阅读全文(共3页)
5.安装 Snort2.0
5.1建立snort配置文件和日志目录
mkdir /etc/snort
mkdir /var/log/snort
tar -zxvf snort-2.x.x.tar.gz
cd snort-2.x.x
./configure --with-mysql=/usr/local/mysql
make
make install
5.2安装规则和配置文件
cd rules (在snort安装目录下)
cp * /etc/snort
cd ../etc
cp snort.conf /etc/snort
cp *.config /etc/snort
5.3修改snort.conf(/etc/snort/snort.conf)
var HOME_NET 10.2.2.0/24 (修改为你的内部网网络地址,我的是 192.168.0.0/24)
var RULE_PATH ../rules 修改为 var RULE_PATH /etc/snort/
改变记录日志数据库:
output database: log, mysql, user=root password=your_password
dbname=snort host=localhost
5.4设置snort为自启动:
在snort安装目录下
cd /contrib
cp S99snort /etc/init.d/snort
vi /etc/init.d/snort
修改snort如下:
CONFIG=/etc/snort/snort.conf
#SNORT_GID=nogroup (注释掉)
#8194;$SNORT_PATH/snort -c ?$CONFIG -i ?$IFACE ?$OPTIONS
(去掉原文件中的 -g ?$SNORT_GID )
chmod 755 /etc/init.d/snort
cd /etc/rc3.d
ln -s /etc/init.d/snort S99snort
ln -s /etc/init.d/snort K99snort
cd /etc/rc5.d
ln -s /etc/init.d/snort S99snort
ln -s /etc/init.d/snort K99snort
四.在mysql中建立数据库
/usr/local/mysql/bin/mysql
mysql>SET PASSWORD FOR root@localhost=PASSWORD('your_password');
mysql>create database snort;
mysql>grant INSERT,SELECT on root.* to snort@localhost;
mysql>quit;
进入snort安装目录:
/usr/local/mysql/bin/mysql -p <./contrib/create_mysql snort
gt;Enter password:
安装DB表:(在contrib目录)
zcat snortdb-extra.gz | /usr/local/mysql/bin/mysql -p snort
进入mysql数据库,看看snort数据库中的表:
/usr/local/mysql/bin/mysql -p
gt;Enter password:
mysql>show databases;
+------------+
| Database
+------------+
| mysql
| snort
| test
+------------+
3 rows in set (0.00 sec)
mysql>use snort;
mysql>show tables;
将会有这些:
+------------------+
| Tables_in_snort |
+------------------+
| data
| detail
| encoding
| event
| flags
| icmphdr
| iphdr
| opt
| protocols
| reference
| reference_system
schema
| sensor
| services
| sig_class
| sig_reference
| signature
| tcphdr
| udphdr
+------------------+
19 rows in set (0.00 sec)
mysql>exit
如果您非常迫切的想了解IT领域最新产品与技术信息,那么订阅至顶网技术邮件将是您的最佳途径之一。
现场直击|2021世界人工智能大会
直击5G创新地带,就在2021MWC上海
5G已至 转型当时——服务提供商如何把握转型的绝佳时机
寻找自己的Flag
华为开发者大会2020(Cloud)- 科技行者