suricata规则reject http any any -> any any (msg:"[ REJECT HTTP -> NNDSSK ]"; content:"nndssk.com"; http_host; sid:2; rev:1;)
时间: 2024-03-29 15:38:40 浏览: 24
这是一条Suricata规则,它用于检测HTTP流量并拒绝(reject)包含特定HTTP Host头部字段的请求。这条规则的源IP和源端口可以是任何值,目标IP和目标端口也可以是任何值。规则的内容匹配部分(content)是“nndssk.com”,它指定了要匹配的HTTP Host头部字段的值。这个匹配是通过http_host关键字执行的,它表示只匹配HTTP Host头部字段而不是整个HTTP请求。规则的消息(msg)是“[ REJECT HTTP -> NNDSSK ]”,它会在日志中显示。这条规则的唯一标识符(sid)是2,版本号(rev)是1。如果Suricata检测到符合这条规则的HTTP流量,它会拒绝这个请求并记录一条日志。
相关问题
alert http any any -> any any (msg:"hhit pkg.loongnix.cn...";content:"pkg.loongnix.cn"; reference:url, www.pkg.loongnix.cn;) reject http any any -> any any (msg:"hit pkg.loongnix.cn...";content:"pkg.loongnix.cn"; reference:url, www.pkg.loongnix.cn;)这个规则会报错11/6/2023 -- 10:48:39 - <Error> - [ERRCODE: SC_ERR_DUPLICATE_SIG(176)] - Duplicate signature "reject http any any -> any any (msg:"hit pkg.loongnix.cn...";content:"pkg.loongnix.cn"; reference:url, www.pkg.loongnix.cn;)" 11/6/2023 -- 10:48:39 - <Error> - [ERRCODE: SC_ERR_INVALID_SIGNATURE(39)] - error parsing signature "reject http any any -> any any (msg:"hit pkg.loongnix.cn...";content:"pkg.loongnix.cn"; reference:url, www.pkg.loongnix.cn;)" from file /home/wzw/gy_tsource_zw/pack/rules/test.rules at line 6 11/6/2023 -- 10:48:39 - <Warning> - [ERRCODE: SC_ERR_NOT_SUPPORTED(225)] - Eve-log support not compiled in. Reconfigure/recompile with libjansson and its development files installed to add eve-log support.如何修改
这个错误提示表明你的规则文件中有一个重复的规则,即出现了两个具有相同签名的规则。具体错误是"Duplicate signature",这表示规则的签名重复了。
你需要将这两个规则合并为一个规则,将它们的动作(alert或reject)合并为一个,将它们的消息内容和匹配模式合并为一个。修改后的规则如下:
alert http any any -> any any (msg:"hit pkg.loongnix.cn...";content:"pkg.loongnix.cn"; reference:url, www.pkg.loongnix.cn;)
reject http any any -> any any (msg:"hit pkg.loongnix.cn...";content:"pkg.loongnix.cn"; reference:url, www.pkg.loongnix.cn;)
这个规则将匹配HTTP流量中是否包含"pkg.loongnix.cn"字符串。如果匹配成功,它将发出一个警报并拒绝这个HTTP请求。另外,这个错误提示后面还有一个警告,提示你的Suricata版本不支持Eve-log,你需要重新编译Suricata,安装libjansson及其开发文件,才能支持Eve-log。
alert http any any -> any any (msg:"hit pkg.loongnix.cn...";content:"pkg.loongnix.cn"; reference:url, www.pkg.loongnix.cn;)我想把这条suricata的规则改成reject
要将这个规则改为reject,需要将alert关键字替换为reject。修改后的规则如下:
reject http any any -> any any (msg:"hit pkg.loongnix.cn...";content:"pkg.loongnix.cn"; reference:url, www.pkg.loongnix.cn;)
这个规则将匹配HTTP流量中是否包含"pkg.loongnix.cn"字符串。如果匹配成功,则会拒绝这个HTTP请求,并发出一个警报。
相关推荐
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)