-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Iterating over constant strings in yara conditions block #1765
Comments
I've had a need for this in the past and just ended up doing a long |
I think it makes sense that iterators work on lists of strings too. It's more intuitive than a long sequence of |
OK, I'll take a shot at implementing this in the coming weeks. |
I've taken a shot at this and am having a hard time getting it to work correctly in the grammar. It seems there is a conflict with the way integer sets are built. Also there is #1338, which might make this issue obsolete. As such, I'm going to put this on hold until I can come up with a way to make it work or someone with more knowledge than me can do it. |
After being shown the path by @plusvic I've got this implemented and up for review now. Thanks, again, Victor! |
Hello,
I recently had a use-case where I wanted to have a list of strings in the
conditions
block in a yara rule. I'm using yara v4.0.5. A minimal example is: comparing the SHA1 of a file with a known set of hashes. This is a working yara rule:test.yar
:For readability, this is alright when there are, say, 5 hashes. But if there are 100 hashes, then the rule file becomes messy. Is there a way in yara to have non-search strings in one variable? And I'm not referring to the
strings
block because those strings are searched in the file. I'm referring to a string variable (containing a list of strings) which is not searched in the file and can purely be used in theconditions
block. Also, I assumehash.sha1
will be computed only once? (caching: #592)Something like:
The above doesn't work:
Thanks for the help!
The text was updated successfully, but these errors were encountered: