美文网首页
Snort规则中的逻辑关系

Snort规则中的逻辑关系

作者: 小天是我见过最单纯善良的人 | 来源:发表于2015-09-18 16:29 被阅读1810次

0x01

看一条规则
alert tcp any any -> any any (content:"union";http_uri;nocase;content:"select":nocase;http_uri;)
下面这两条会触发哪一条?
http://foo.com?id=union select
http://foo.com?id=select union
实验结果是都会触发。
这个实验说明content如果不加distance之类的修饰符的话,多个content匹配是没有顺序的。

0x02

再看一条规则
alert tcp any any -> any any (content:"union";http_uri;nocase;content:"select":nocase;http_uri; pcre:"/union\s+(all\s+)?select\s+/Ui";)
还是这两条规则:
http://foo.com?id=union select
http://foo.com?id=select union
实验结果是只会触发第一条。
这说明,不同关键词之间(比如content和pcre)是“逻辑与”的关系。

0x03

最后一条规则
alert tcp any any -> any any (content:"union";http_uri;nocase;content:"s3l3ct":nocase;http_uri; pcre:"/union\s+(all\s+)?select\s+/Ui";)
发现上面两条都匹配不到了,说明所有关键词之间都是“逻辑与”的关系。

相关文章

网友评论

      本文标题:Snort规则中的逻辑关系

      本文链接:https://www.haomeiwen.com/subject/rgkbcttx.html