码迷,mamicode.com
首页 > 其他好文 > 详细

Snort规则中的逻辑关系

时间:2016-09-26 17:40:38      阅读:115      评论:0      收藏:0      [点我收藏+]

标签:

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";)
发现上面两条都匹配不到了,说明所有关键词之间都是“逻辑与”的关系。



文/小天是我见过最单纯善良的人(简书作者)
原文链接:http://www.jianshu.com/p/9d11a3e039e9
著作权归作者所有,转载请联系作者获得授权,并标注“简书作者”。

Snort规则中的逻辑关系

标签:

原文地址:http://www.cnblogs.com/UnGeek/p/5909776.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!