创建 yara 文件以返回十六进制字符串的匹配项

发布于 2025-01-16 14:29:18 字数 359 浏览 3 评论 0原文

我在 Mac os12.2.1 上尝试运行 yara,它使用基本的十六进制字符串内容返回匹配项。

Yara 规则(文件名:rulehexstr)
Rule hex_new { strings: $hexnew = { 48 65 6c 6c 6f } condition: $hexnew }

对于 yara 文件,我使用了 echo -n "HELLO" | od -A n -t x1 >输入文件

因此,当我调用 yara Rulehexstr inputfile 时,我期望输出 hex_new inputfile,但它什么也不返回。

如何创建一个文件来返回上述规则的匹配项?

I'm on Mac os12.2.1 trying to run yara where it returns a match using basic hex string content.

Yara rule (file name: rulehexstr)
rule hex_new { strings: $hexnew = { 48 65 6c 6c 6f } condition: $hexnew }

For the yara file, I used echo -n "HELLO" | od -A n -t x1 > inputfile.

So, when I call yara rulehexstr inputfile, I expect output of hex_new inputfile, but it returns nothing.

How do I create a file that will return a match on the above rule?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

树深时见影 2025-01-23 14:29:18

我的十六进制对于大写字母是错误的。使用这篇帖子,我做到了
echo -n $'\x48\x45\x4c\x4c\x4f' > filehexstr-uppercase-hello.dat

然后,运行 yara Rulehexstr filehexstr-uppercase-hello.dat 返回 hex_new filehexstr-uppercase-hello.dat

My hex was wrong for uppercase letters. And using this post, I did
echo -n $'\x48\x45\x4c\x4c\x4f' > filehexstr-uppercase-hello.dat

Then, running yara rulehexstr filehexstr-uppercase-hello.dat returned hex_new filehexstr-uppercase-hello.dat.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文