【问题标题】:How to write YARA rules based on IOC script?如何基于 IOC 脚本编写 YARA 规则?
【发布时间】:2013-08-17 10:18:14
【问题描述】:

谁能帮助将一小部分 IOC 脚本转换为 YARA 规则以识别恶意软件?

我将尝试根据任何人为我编写的示例来学习如何编写 YARA 规则。

这是 IOC 脚本的一小部分:

<IndicatorItem id="50455b63-35bf-4efa-9f06-aeba2980f80a" condition="contains">
<Context document="ProcessItem" search="ProcessItem/name" type="mir"/>
<Content type="string">winlogon.exe</Content>
</IndicatorItem>

<IndicatorItem id="b05d9b40-0528-461f-9721-e31d5651abdc" condition="contains">
<Context document="ProcessItem" search="ProcessItem/HandleList/Handle/Type"         type="mir"/><Content type="string">File</Content>
</IndicatorItem>

谁能向我解释如何将其转换为 YARA,我可以使用 Python 来做到这一点吗?非常感谢!!

【问题讨论】:

    标签: python rules malware


    【解决方案1】:

    根据 IOC 脚本 sn-p 中显示的信息,您无法创建 YARA 规则。 YARA 规则是基于文件内容的,所以,你必须寻找与文件内容相关的指标,比如这个:

    <IndicatorItem id="09cd0494-702c-4fe2-bbd4-29538cb3b685" condition="contains">
            <Context document="FileItem" search="FileItem/StringList/string" type="mir" />
            <Content type="string">http://%s/record.asp?device_t=%s</Content>
            <Comment>unique strings found in most samples in family</Comment>
    </IndicatorItem>
    

    此指示器告诉您受感染的文件包含字符串http://%s/record.asp?device_t=%s。 YARA 中表达的相同想法如下:

    rule <a name for your rule here> {
      strings:
         $a = "http://%s/record.asp?device_t=%s"
      condition:
         $a
    }
    

    这里有一个自动将 IOC 转换为 YARA 的工具:

    https://github.com/mandiant/ioc_writer/tree/master/examples/openioc_to_yara

    这里还有一些可能对您有用的幻灯片:

    https://media.blackhat.com/us-13/Arsenal/us-13-Gibb-IOCWriter_11-Slides.pdf

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-02-12
      • 2011-03-16
      • 1970-01-01
      • 2014-12-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多