snort安装使用教程(CentOS6.5)

 

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

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

 

2.安装

2.1安装依赖
yum install libpcap libpcap-devel zlib zlib-deve* -y
yum install glibc-headers gcc-c++ make  -y
tar -zxf libdnet-1.11.tar.gz
cd libdnet-1.11
./configure && make && make install

tar zxf pcre-8.39.tar.gz
./configure

make && make install


复制代码

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

 

2.2安装daq
tar -zxf daq-2.0.6.tar.gz                
cd daq-2.0.6
./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
tar -zxf snort-2.9.11.tar.gz                   
cd snort-2.9.11
./configure --enable-sourcefire --disable-open-appid
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/24 -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

转载于:https://www.cnblogs.com/guarderming/p/10281061.html

  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
2021-03-26 20:54:33,596 - Model - INFO - Epoch 1 (1/200): 2021-03-26 20:57:40,380 - Model - INFO - Train Instance Accuracy: 0.571037 2021-03-26 20:58:16,623 - Model - INFO - Test Instance Accuracy: 0.718528, Class Accuracy: 0.627357 2021-03-26 20:58:16,623 - Model - INFO - Best Instance Accuracy: 0.718528, Class Accuracy: 0.627357 2021-03-26 20:58:16,623 - Model - INFO - Save model... 2021-03-26 20:58:16,623 - Model - INFO - Saving at log/classification/pointnet2_msg_normals/checkpoints/best_model.pth 2021-03-26 20:58:16,698 - Model - INFO - Epoch 2 (2/200): 2021-03-26 21:01:26,685 - Model - INFO - Train Instance Accuracy: 0.727947 2021-03-26 21:02:03,642 - Model - INFO - Test Instance Accuracy: 0.790858, Class Accuracy: 0.702316 2021-03-26 21:02:03,642 - Model - INFO - Best Instance Accuracy: 0.790858, Class Accuracy: 0.702316 2021-03-26 21:02:03,642 - Model - INFO - Save model... 2021-03-26 21:02:03,643 - Model - INFO - Saving at log/classification/pointnet2_msg_normals/checkpoints/best_model.pth 2021-03-26 21:02:03,746 - Model - INFO - Epoch 3 (3/200): 2021-03-26 21:05:15,349 - Model - INFO - Train Instance Accuracy: 0.781606 2021-03-26 21:05:51,538 - Model - INFO - Test Instance Accuracy: 0.803641, Class Accuracy: 0.738575 2021-03-26 21:05:51,538 - Model - INFO - Best Instance Accuracy: 0.803641, Class Accuracy: 0.738575 2021-03-26 21:05:51,539 - Model - INFO - Save model... 2021-03-26 21:05:51,539 - Model - INFO - Saving at log/classification/pointnet2_msg_normals/checkpoints/best_model.pth 我有类似于这样的一段txt文件,请你帮我写一段代码来可视化这些训练结果
02-06
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值