windows下安装snort,以及简单使用

snort手册

下载地址:http://www.oschina.net/action/file/download?id=316&fn=964e9b719e4800c457e0d9d8f4032a451ee067ac
在这里插入图片描述

环境准备

在虚拟机win7下安装snort

准备软件:
疯狂下一步,没什么好说的

  1. snort: https://www.snort.org/downloads
  2. npcap:https://nmap.org/npcap/
    在这里插入图片描述
    完事后,你可以在C盘下看到snort
    在这里插入图片描述

配置环境变量

这一步的主要作用是为了避免非得跑到snort的bin目录下才能运行snort,配置了环境变量你可以在任意位置运行snort。
由上图可以看到snort的bin目录是C:\Snort\bin
在这里插入图片描述

启动snort

如果能够出现这个界面就已经成功一小半了
在这里插入图片描述

配置规则

修改snort的配置文件,它位于C:\Snort\etc\snort.conf,这个配置文件由9个部分组成,我们只需要找到第7部分,并注释掉里面所有的内容,然后手动指定一个路径

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

在这里插入图片描述

排雷

对snort.conf做如下设置:
1:注释如下两行
在这里插入图片描述
2:修改为如下内容
在这里插入图片描述
其中第三个,是需要手动在snort\lib下面新建一个snort_dynamicrules文件夹,不然还是会报错。我的解决到这里就能使用了。
更多雷区,参考https://blog.51cto.com/fupj1/1112013,或者网上搜索

小试牛刀

譬如我这里编写了一条检测DVWA的命令注入漏洞的规则(我的规则是手写的,你可以选择下载snort官方的规则

编写规则

在这里插入图片描述

捕获并过滤出命令注入的数据包

在这里插入图片描述

分析数据包

snort -de -c C:\Snort\etc\snort.conf -l C:\Snort\log -r C:\Users\用户名\Desktop\dvwa抓包\Command.pcapng

在这里插入图片描述

查看结果

在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/weixin_44288604/article/details/108597793
今日推荐