Skip to content
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

Recommended changes to YARA rule #3

Closed
wants to merge 2 commits into from
Closed

Conversation

Neo23x0
Copy link

@Neo23x0 Neo23x0 commented Feb 17, 2023

Important changes:

  • 2 condition bugs
  • Regex using .*

Optional changes:

  • Regex split up to strings

@Neo23x0
Copy link
Author

Neo23x0 commented Feb 18, 2023

Further explanations:

($oep at pe.entry_point or $oep)

^ this part of the condition is just as saying $oep

or (any of ($s*) and any of ($r*)) 
          or any of ($r*)

^ this is just the same logic error. It's basically as if you would say

a and b or b 

@Neo23x0
Copy link
Author

Neo23x0 commented Feb 18, 2023

Regex issue

The regex contains .*, which is discouraged for performance reasons. Many YARA versions printed a warning that this slows down scanning ... because it really does. It's a major performance issue. You should try to avoid using a regex at all or at least reduce it to a range .{1,X}.

See
https://github.com/Neo23x0/YARA-Performance-Guidelines/#regular-expressions

chvancooten added a commit that referenced this pull request Feb 28, 2023
@chvancooten
Copy link
Owner

Thanks for the modifications and explanation, will be included for v1.1!

@chvancooten chvancooten mentioned this pull request Feb 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants