官网:https://www.snort.org/

官方文档:https://www.snort.org/documents

2.安装

2.1安装依赖

yum install flex bison -y
yum install libpcap libpcap-devel -y wget https://nchc.dl.sourceforge.net/project/libdnet/libdnet/libdnet-1.11/libdnet-1.11.tar.gz
tar -zxf libdnet-1.11.tar.gz
cd libdnet-1.11
./configure && make && make install

如果不安装这些依赖,在后边执行configure时会有报错

2.2安装daq

wget https://www.snort.org/downloads/snort/daq-2.0.6.tar.gz
tar -zxf daq-2.0..tar.gz
cd daq-2.0.
./configure
make
make install

configure报错:configure: error: Your operating system's lex is insufficient to compile libsfbpf. You should install both bison and flex.

处理:yum install flex bison -y

configure报错: ERROR!  Libpcap library version >= 1.0.0 not found.

处理: yum install libpcap libpcap-devel -y

2.3安装snort

wget https://www.snort.org/downloads/snort/snort-2.9.11.tar.gz
tar -zxf snort-2.9..tar.gz
cd snort-2.9.
./configure --enable-sourcefire
make
make install

configure报错:ERROR!  dnet header not found, go get it from

处理: wget https://nchc.dl.sourceforge.net/project/libdnet/libdnet/libdnet-1.11/libdnet-1.11.tar.gz

tar -zxf libdnet-1.11.tar.gz

cd libdnet-1.11

./configure && make && make install

2.4安装规则

# 首先创建snort配置(及规则)目录
mkdir -p /etc/snort/rules
# 创建运行需要目录
mkdir /usr/local/lib/snort_dynamicrules # 首先将2.3解压出来的etc下的默认配置文件复制到snort配置目录下
cp etc/*.conf* /etc/snort
cp etc/*.map /etc/snort # 下载社区规则并解压到规则目录
wget https://www.snort.org/downloads/community/community-rules.tar.gz
tar -zxf community-rules.tar.gz -C /etc/snort/rules # 注释掉所有默认要加载的规则文件
sudo sed -i 's/include \$RULE\_PATH/#include \$RULE\_PATH/' /etc/snort/snort.conf # 启用社区规则文件
echo '' >> /etc/snort/snort.conf
echo '# enable community rule' >> /etc/snort/snort.conf
echo 'include $RULE_PATH/community-rules/community.rules' >> /etc/snort/snort.conf # 重新设置snort.conf中的变量值
sed -i 's/var RULE_PATH ..\/rules/var RULE_PATH .\/rules/' /etc/snort/snort.conf
sed -i 's/var WHITE_LIST_PATH ..\/rules/var WHITE_LIST_PATH .\/rules/' /etc/snort/snort.conf
sed -i 's/var BLACK_LIST_PATH ..\/rules/var BLACK_LIST_PATH .\/rules/' /etc/snort/snort.conf # 创建默认使用的白名单文件
touch /etc/snort/rules/white_list.rules
# 创建默认的黑名单文件
touch /etc/snort/rules/black_list.rules
# 创建默认自己设置的规则文件,其实我们注意了其他include只include了社区规则,所以这条根本没用这里只是意思一下
touch /etc/snort/rules/local.rules # 测试配置文件是否有误
snort -T -c /etc/snort/snort.conf

3.使用

snort有三种用法:嗅探模式、记录模式和网络入侵检测模式。

3.1嗅探模式

snort -v

该模式打印通信的双方IP及协议头部,类似tcpdump

3.2记录模式

mkdir log
snort -dev -l ./log

该模式将截获的数据包记入文件(此处是当前log目录下),重点是-l

3.3网络入侵检测模式

mkdir log
snort -dev -l ./log -h 192.168.1.0/ -c /etc/snort/snort.conf

该模式将会按指定的规则扫描通信数据包

报错:ERROR: /etc/snort/rules/community-rules/snort.conf(249) Could not stat dynamic module path "/usr/local/lib/snort_dynamicrules": No such file or directory.

处理:mkdir -p /usr/local/lib/snort_dynamicrules

报错:ERROR: /etc/snort/classification.config(0) Unable to open rules file "/etc/snort/classification.config": No such file or directory.

处理:将上边2.3解压出的snort包中的etc/classification.config复制到/etc/snort/classification.config

参考:

http://blog.csdn.net/jackywgw/article/details/51693108

https://upcloud.com/community/tutorials/install-snort-ubuntu/

snort安装使用教程(CentOS6.5)的更多相关文章

  1. Centos6.7安装Cacti教程

    Centos6.7安装Cacti教程# link:http://docs.cacti.net/plugins/ blog地址:http://www.cnblogs.com/caoguo 一.基本环境安 ...

  2. Centos6.7 安装Naigos教程

    Centos6.7 安装Naigos教程参考文档:https://assets.nagios.com/downloads/nagioscore/docs/nagioscore/4/en/quickst ...

  3. 实验 snort安装配置与规则编写

    1 实验目的 在linux或windows任意一个平台下完成snort的安装,使snort工作在NIDS模式下,并编写符合相关情景要求的snort规则. 2 实验环境 物理机:windows 8.1 ...

  4. (转载)Centos下Elasticsearch安装详细教程

    原文地址:http://www.cnblogs.com/sunny1009/articles/7874251.html Centos下Elasticsearch安装详细教程 1.Elasticsear ...

  5. MySQL基础环境_安装配置教程(Windows7 64或Centos7.2 64、MySQL5.7)

    MySQL基础环境_安装配置教程(Windows7 64或Centos7.2 64.MySQL5.7) 安装包版本 1)     VMawre-workstation版本包 地址: https://m ...

  6. Linux基础环境_安装配置教程(CentOS7.2 64、JDK1.8、Tomcat8)

    Linux基础环境_安装配置教程 (CentOS7.2 64.JDK1.8.Tomcat8) 安装包版本 1)     VMawre-workstation版本包 地址: https://my.vmw ...

  7. Centos下Elasticsearch安装详细教程

    Centos下Elasticsearch安装详细教程 1.Elasticsearch简介 ElasticSearch是一个基于Lucene的搜索服务器.它提供了一个分布式多用户能力的全文搜索引擎,基于 ...

  8. IntelliJ IDEA - 热部署插件JRebel 安装使用教程

    IntelliJ IDEA - JRebel 安装使用教程 JRebel 能做什么? JRebel 是一款热部署插件.当你的 Java-web 项目在 tomcat 中 run/debug 的时候 , ...

  9. Zabbix3.x安装图解教程

    准备知识: Zabbix3.x比较之前的2.0界面有了很大的变化,但是安装部署过程与2.x基本完全一样. 1.Zabbix2.x安装图解教程 http://www.osyunwei.com/archi ...

随机推荐

  1. Jquery中的DOM操作:

    DOM是 Document Object Model的缩写,是一种与浏览器,平台,语言无关的接口,使用该接口可以访问页面中所有的标准组件,下面介绍一下常用的一些DOM操作: 选择节点: 将在下篇博客中 ...

  2. colgroup和col的区别

    转载自:http://blog.csdn.net/carefree31441/article/details/3291397 colgroup和col一般出现在表格当中定义表格单独列的任意属性col能 ...

  3. JavaSE习题 第四章 类与对象

    问答题: 1.在声明类时,类名应该遵守哪些习惯? 1.与文件名相同2.首字母大写 2.类体内容中有那两类比较重要的成员? 1.成员变量2.方法 3.实例方法可以操作类变量吗?类方法可以操作实例变量吗? ...

  4. [原][粒子特效][spark]发射器emitter

    深入浅出spark粒子特效连接:https://www.cnblogs.com/lyggqm/p/9956344.html group添加emitter的方式: eimtter: 上图是spark源码 ...

  5. 学习笔记24—win10环境下python版libsvm的安装

    1.前言 由于毕业设计需要用到libsvm,所以最近专心于配置libsvm,曾经尝试过在matlab中安装,但是没有成功.最终在Python环境中完成安装. 2.LIBSVM介绍 LIBSVM 是台湾 ...

  6. 学习笔记23—window10 64位 python2.7 安装liblinear

    最近在使用pythin,因为要使用libsvm,所以到官网去下载libsvm.官网地址为libsvm(https://www.csie.ntu.edu.tw/~cjlin/libsvm/)结果下载下来 ...

  7. 2018年浙江理工大学程序设计竞赛校赛 Problem I: 沙僧

    沙僧 思路: dfs序+差分数组 分层考虑,通过dfs序来查找修改的区间段,然后用差分数组修改 代码: #include<bits/stdc++.h> using namespace st ...

  8. Mongodb 分享(一)

    Mongodb使用基础知识: 一.简介 1.mongodb是什么? 1)MongoDB 是一个基于分布式文件存储的数据库.由 )mongodb 客户端:NoSQL Manager for MongoD ...

  9. Elasticsearch-基础介绍及索引原理分析

    介绍 Elasticsearch 是一个分布式可扩展的实时搜索和分析引擎,一个建立在全文搜索引擎 Apache Lucene(TM) 基础上的搜索引擎.当然 Elasticsearch 并不仅仅是 L ...

  10. 【源码分析】FastJson全局配置日期格式导致@JSONField(format = "yyyy-MM-dd")注解失效

    出现的问题 我全局配置的时间格式是:yyyy-MM-dd HH:mm:ss @JSONField注解配置的时间格式是:yyyy-MM-dd 最终的返回结果是:yyyy-MM-dd HH:mm:ss 问 ...