创建 yara 文件以返回十六进制字符串的匹配项
我在 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我的十六进制对于大写字母是错误的。使用这篇帖子,我做到了
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
returnedhex_new filehexstr-uppercase-hello.dat
.