Conversation
Replace bitwise & between boolean export check and integer characteristics with type-safe and != 0 for yara-x E002.
PlugX path separator, PoetRAT empty alternative, ChineseSpam escaped brace.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #451
Summary
malware/APT_CrashOverride.yar: replacepe.exports(Crash) & pe.characteristicswithpe.exports(Crash) and pe.characteristics != 0.malware/RAT_PlugX.yar: add missing path separator beforeVMwareCplLauncher(\\Vnot\V).malware/RAT_PoetRATPython.yar: remove trailing|that made the regex match empty strings.webshells/Wshell_ChineseSpam.yar: escape literal{as\{.CrashOverride note
pe.exports()is boolean in yara-x; legacy YARA coerced the old&conjunct. We useand pe.characteristics != 0for type-safe parity with that behavior rather than guessing a specific PE characteristics bit mask or deleting the clause. Valid PE files almost never havecharacteristics == 0, so this remains a no-op once the export check passes.Verification
yr compile index.yar— exit 0yara64.exe index.yar dummy.bin— exit 0 (no syntax errors on stderr)Engines tested: yara-x-cli 1.21.0 (
yr -V); YARA 4.5.5 (yara64.exe --version, VirusTotal v4.5.5-2368-win64.zip fallback).