Windows上的Snort动态引擎问题

时间:2016-06-01 07:17:09

标签: windows networking snort

我似乎无法找到这个问题的答案。存在许多类似错误的主题,但它们都是基于Linux的。

我遇到的问题是,当尝试运行Snort(snort.exe -v -I)时,它将捕获任何内容,但我认为这是因为我没有设置接口。运行 snort.exe -W 之后,我找到了要使用的接口并在命令行中指定了这个,但是我收到以下错误 - 错误:无法将DAQ BPF过滤器设置为' 2'

我暂时跳过此错误尝试使用-T和-c测试Snort以指定配置文件,但它出现以下错误 - 缺少/不正确的动态引擎lib说明符。我将此行放在配置文件中,并将其从 /usr/local/snort_dynamicengine/libsf_engine.so 更改为 c:\ Snort \ lib \ snort_dynamicengine \ sf_engine.dll (正确的路径和文件名)但错误仍然存​​在。

我记得几个月前在Windows Server 2012部署上安装了Snort,没有任何问题。

知道是什么导致了这个错误吗?

注意:我还纠正了其他路径,即规则。

4 个答案:

答案 0 :(得分:0)

我知道答案很晚,但我仍然遇到了这个问题,我认为应该提供一个有效的答案。无论如何,问题是基于路径,所有snort.conf文件都是相对于linux特定位置的路径。这就是第一个问题,第二个问题来自于snort解析你在-c选项中提供它的任何路径并将它预先添加到所有规则路径(我知道,很奇怪)如果你(并且大多数情况下)这不应该发生windows用户)使用绝对路径。所以我提出的解决方案是:

请注意,每个路径都有错误,以下代码段只能帮助您前进一步,此后,您需要更正所有文件路径。

在snort.conf文件中(通常为c:\ snort \ etc \ snort.conf)

###################################################
# Step #4: Configure dynamic loaded libraries.  
# For more information, see Snort Manual, Configuring Snort - Dynamic Modules
###################################################

# path to dynamic preprocessor libraries
dynamicpreprocessor directory C:\Snort\lib\snort_dynamicpreprocessor

# path to base preprocessor engine
dynamicengine C:\Snort\lib\snort_dynamicengine\sf_engine.dll

# path to dynamic rules libraries
# dynamicdetection directory /usr/local/lib/snort_dynamicrules

答案 1 :(得分:0)

要记住的规则

始终使用适当的文本编辑器来编辑诸如this之类的配置文件,因为有时您将代码复制并粘贴到记事本中并进行编辑时,会在文本中添加一些额外的空格,这会导致字节增加或更改代码语句。 好的事情是有些编辑器提供了适当的行号,因此您可以在命令提示符下通过snort轻松导航到错误显示。

解决方案

在我的场景中

enter image description here

由于此

enter image description here

这是因为

之后添加了一些空格
  

     

将代码语句留在下一行是不正确的,并且   这将在执行snort期间读取,因为这已不再是注释了,因为>您从注释部分中将其取出标记为(每行),这是由于复制时添加了空格并将代码粘贴到一些不良的编辑器中。

删除空格后

enter image description here

enter image description here

最终动态引擎行应如下所示

enter image description here

答案 2 :(得分:0)

我也遇到了问题,并解决了这个问题,删除一个/

ERROR:: c:\snort\etc\snort.conf (246) Missing/incorrect dynamic engine lib specifie.

所以我编辑:

dynamicpreprocessor directory c:\snort\lib\snort_dynamicpreprocessor\ <---*

此“ \”是错误的

答案 3 :(得分:0)

请检查任何 Microsoft Windows 7+ 操作系统的步骤 4 的正确内容是否应如下所示(如有必要,调整绝对路径):

###################################################
# Step #4: Configure dynamic loaded libraries.
# For more information, see Snort Manual, Configuring Snort - Dynamic Modules
###################################################

# path to dynamic preprocessor libraries
# dynamicpreprocessor directory /usr/local/lib/snort_dynamicpreprocessor/
dynamicpreprocessor directory C:\snort\lib\snort_dynamicpreprocessor

# path to base preprocessor engine
# dynamicengine /usr/local/lib/snort_dynamicengine/libsf_engine.so
dynamicengine C:\snort\lib\snort_dynamicengine\sf_engine.dll

# path to dynamic rules libraries
# dynamicdetection directory /usr/local/lib/snort_dynamicrules
# dynamicdetection directory C:\snort\lib\snort_dynamicrules (# under Microsoft Windows)

还要注意以下方面的正确值:

  • HOME_NET(例如 ipvar HOME_NET 192.168.1.1/24ipvar HOME_NET 192.168.0.0/16,或者基本上是 ipvar HOME_NET any
  • EXTERNAL_NET(有人建议 ipvar EXTERNAL_NET !$HOST_NET 这对我不起作用,所以我把它留在 ipvar EXTERNAL_NET any

另外,必须定义白名单和黑名单目录:

# If you are using reputation preprocessor set these
# Currently there is a bug with relative paths, they are relative to where snort is
# not relative to snort.conf like the above variables
# This is completely inconsistent with how other vars work, BUG 89986
# Set the absolute path appropriately
# var WHITE_LIST_PATH ../rules
var WHITE_LIST_PATH C:\snort\whitelist_rules
# var BLACK_LIST_PATH ../rules
var BLACK_LIST_PATH C:\snort\blacklist_rules

请注意,您必须自己mkdir 这些目录。

此外,您需要在这些目录中定义(甚至是空的)文件:

touch C:\snort\whitelist_rules\white_list.rules
touch C:\snort\blacklist_rules\black_list.rules

虽然您似乎可以命名任意目录名,但文件名必须与提到的 white_list.rulesblack_list.rules 相对应(注意下划线)。

就个人而言,这篇文章对我来说是最好的和最鼓舞人心的“HOWTO”:

https://www.securityarchitecture.com/learning/intrusion-detection-systems-learning-with-snort/configuring-snort/

我的 snort 调用字符串(来自批处理文件)如下所示:snort.exe -A console -i 15 -c C:\snort\etc\snort.conf -l C:\snort\log -K pcap-K pcap 确定可以由 Wireshark 导入的输出格式,从而进一步分析。 -i 15 特定于我的设置 (15 = Wi-Fi) - 在 Microsoft Windows 下使用 snort.exe -W 和 Linux 下使用 snort -w 检查。