【问题标题】:Suricata - base64_decode and base64_dataSuricata - base64_decode 和 base64_data
【发布时间】:2020-05-13 01:12:14
【问题描述】:

最新的 Suricata 添加了对 base64_decode 和 base64_data 的支持 (https://suricata.readthedocs.io/en/latest/rules/base64-keywords.html)。另一方面,无法将规则仅应用于 HTTP 客户端主体。例如,类似:

alert http any any -> any any (msg:"Example"; http_client_body; base64_decode; pcre:"..."; sid:10001; rev:1;)

有没有办法只解码请求正文?

【问题讨论】:

    标签: suricata


    【解决方案1】:

    您能否详细说明一下为什么在这里使用 PCRE 以及您的目标是什么?据我所知,PCRE 不能与 Suricata base64_* 关键字一起使用。

        alert http any any -> any any (msg:"Example"; http.request_body; base64_decode:offset 0; base64_data; content:"..."; sid:10001; rev:1;)
    

    这是对您的规则的修改和我所做的更改:

    1. 删除了“http_client_body”,因为我们在 Suricata 5.0 中有“http.request_body”。此外,如果您确实想使用“http_client_body”,它会出现在您希望匹配的内容之后。 'http.request_body' 是一个粘性缓冲区,因此它后面的所有内容都被视为该缓冲区的一部分。
    2. 添加了“偏移量 0”以指示您要开始提取 base64 字符串的位置(在本例中为缓冲区的开头)。
    3. 添加了“base64_data”,这是在 Suricata 5.0 中使用 base64 解码功能时的要求(根据文档)。
    4. 将 PCRE 转换为标准内容“缓冲区”。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-07-27
      • 1970-01-01
      • 2017-12-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-01-12
      • 1970-01-01
      相关资源
      最近更新 更多