配置snort
0.如果要输出到mysql,请安装barnyard2
在此之前,请启动并配置mysql
git clone https://github.com/firnsy/barnyard2
cd barnyard2
./autogen.sh
./configure --with-mysql-libraries=/usr/lib64/mysql
make
make install
1.配置snort.conf
mkdir /etc/snort
mkdir /usr/local/lib/snort_dynamicrules
mkdir /var/log/snort
把安装文件etc目录的文件全部复制到/etc/snort里面,进入snort源码目录(sid-msg.map在规则包里面),然后
cp /etc/* /etc/snort/
把rule文件拷贝至/etc/snort/下面
拷贝rules、so_rules、preproc_rules到/etc/snort/下
(或者下载snort规则直接解压到/etc/snort/)
进入snort源码目录的/so_rules/precompiled/RHEL-6-0/x86-64/2.9.6.2
cp * /usr/local/lib/snort_dynamicrules
snort.conf分为9部分
1:Set the network variables
2:Configure the decoder
3:Configure the base detection engine
4:Configure dynamic loaded libraries
5:Configure preprocessors
6:Configure output plugins
7:Customize your rule set
8:Customize preprocessor and decoder rule set
9:Customize shared object rule set
第一部分:
a.最新的snort版本支持ipv6,如果你的网络没有ipv6的话,把ipvar都改成var
b.把变量HOME_NET改为自己的网络 如 192.168.0.1/24
c.把EXTERNAL_NET改为!$HOME_NET
var RULE_PATH ../rules
var SO_RULE_PATH ../so_rules
var PREPROC_RULE_PATH ../preproc_rules
都改成相应的绝对路径,比如/etc/snort/rules等
然后
touch /etc/snort/rules/white_list.rules
touch /etc/snort/rules/black_list.rules
第二部分:
只需要把最后一行改为:config logdir: /var/log/snort 注意:去掉前面的#
第三部分:不需要修改
第四部分:不需要修改
第五部分:不需要修改
第六部分:配置输入插件,注意同时只能有一个插件同时存在,在output unified2:后另加一行
output unified2: filename snort.log, limit 128
第七部分:这里主要是配置snort启动时候需要读取哪些规则文件,这里根据实际情况决定是否保留,刚开始建议注释掉除local.rules之外所有的规则文件。
第八部分:取消注释所有
第九部分:取消注释所有
至此snort安装并配置完毕,下面说下barnyard2的安装和配置
2.配置barnyard2.conf
复制barnyard2.conf文件至/etc/snort
建立barnyard2日志目录
mkdir /var/log/barnyard2
建立一个barnyard2需要的空白文件
touch /var/log/snort/barnyard2.waldo
Barnyard2.conf有三部分:
1:configure the variable declarations
2:setup the input plugins
3 :setup the output plugins
第一部分:
config reference_file: ../etc/snort/reference.config
config classification_file: ../etc/snort/classification.config
config gen_file: ../etc/snort/gen-msg.map
config sid_file: ../etc/snort/sid-msg.map
这些文件是否存在
然后找到下面的行,取消注释并修改配置如下:
config logdir: /var/log/barnyard2
config hostname: localhost
config interface: eth0
config waldo_file: /var/log/snort/barnyard2.waldo
第二部分:不需要修改
第三部分:注释掉alert_fast
在最后新增
output database: log, mysql, user=snort password=snortpass dbname=snort host=localhost
PS密码不需要加引号
至此Barnyard2安装完成
(如果继续安装snorby,则暂时不需要简历mysql表)
运行:
barnyard2 -c /etc/snort/barnyard2.conf -d /var/log/snort -f snort.log -w /etc/snort/bylog.waldo -C /etc/snort/classification.config
snort --daq-dir=/usr/local/lib/daq --daq pfring --daq-mode passive -u root -g root -c /etc/snort/snort.conf -i eth0 -v -e
配置snort的更多相关文章
- Windows 下如何安装配置Snort视频教程
Windows 下如何安装配置Snort视频教程: 第一步: http://www.tudou.com/programs/view/UUbIQCng360/ 第二部: http://www.tudou ...
- wstngfw中配置snort
wstngfw中配置snort 概述 Snort是入侵检测和预防系统.它可以将检测到的网络事件记录到日志并阻止它们.Snort使用称为规则的检测签名进行操作. Snort规则可以由用户自定义创建,或者 ...
- 安装配置Snort和barnyard2
1.安装依赖包 yum install –y gcc flex bison zlib* libpcap* tcpdump gcc-c++ zlib* libdnet libdnet-devel pcr ...
- 实验 snort安装配置与规则编写
1 实验目的 在linux或windows任意一个平台下完成snort的安装,使snort工作在NIDS模式下,并编写符合相关情景要求的snort规则. 2 实验环境 物理机:windows 8.1 ...
- Snort - 配置文件
Snort.conf 版本 2.9.8.3 编译可用选项: --enable-gre --enable-mpls --enable-targetbased --enable-ppm --enable- ...
- Aho-Corasick算法、多模正则匹配、Snort入门学习
希望解决的问题 . 在一些高流量.高IO的WAF中,是如何对规则库(POST.GET)中的字符串进行多正则匹配的,是单条轮询执行,还是多模式并发执行 . Snort是怎么组织.匹配高达上千条的正则规则 ...
- snort使用
http://jingyan.baidu.com/article/d8072ac45a626fec95cefd85.html 接上篇,如果编译安装snort并指定了prefix,那么须指定一个软链接, ...
- ubuntu 12.04 安装snort acidbase相关注意事项
一.安装Snort 1.安装libpcap 1 apt-get install libpcap-dev 2.安装snort 1 2 apt-get install snort apt-get inst ...
- 配置suricata
yum -y install libpcap libpcap-devel libnet libnet-devel pcre \ pcre-devel gcc gcc-c++ automake auto ...
随机推荐
- Loadrunner中参数和变量的使用
//字符串复制strcpy(str,"Hello ") ; //字符串连接strcat(str,"World !");lr_message("str: ...
- H5页面适配所有iPhone和安卓机型的六个技巧
http://www.th7.cn/web/html-css/201605/166006.shtml http://www.th7.cn/web/html-css/201601/153127.shtm ...
- nefu 1116 字符串加密
字符串加密 Problem : 1116 Time Limit : 1000ms Memory Limit : 65536K description 给你一段经过加密的字符串,我们称之为密文,现在请你 ...
- ios根据颜色返回图片
+(UIImage*) createImageWithColor:(UIColor*) color { CGRect rect=CGRectMake(0.0f, 0.0f, 1.0f, 1.0f); ...
- CATransform3D的使用以及各个参数的含义
1. 缩放 CABasicAnimation *theAnimation=[CABasicAnimation animationWithKeyPath:@"transform"]; ...
- centos配置samba
一.samba服务器的安装与配置 [root@localhost ~]# yum -y install samba samba-common samba-client samba服务器所 ...
- CSS中常见中文字体的英文名称(Microsoft YaHei,SimHei)
Mac OS的一些: 华文细黑:STHeiti Light [STXihei]华文黑体:STHeiti华文楷体:STKaiti华文宋体:STSong华文仿宋:STFangsong儷黑 Pro:LiHe ...
- 获取表空间的语句 以及 建表和索引的ddl
alter session set container=PHD1; SET SERVEROUTPUT ON SET LINESIZE SET FEEDBACK OFF SET PAGESIZE sel ...
- 由浅到深理解java反射
1.基础概念 class类: 1.1java是面向对象的,但是在java中存在两种东西不是面向对象的 一种是普通的数据类型,这也是封装数据类存在的原因. 二种是静态静态成员. 1.2所以我们首先要理解 ...
- TextureView+SurfaceTexture+OpenGL ES来播放视频(三)
引自:http://www.jianshu.com/p/291ff6ddc164 做好的Demo截图 opengl-video 前言 讲了这么多,可能有人要问了,播放视频用个android封装的Vid ...