A threat hunter at a fintech company wants to write a YARA rule that detects a family of malicious PowerShell loaders even when attackers alter variable names or add junk comments. Which rule design choice best achieves this?
Select an answer to reveal the explanation.
Short Explanation
Writing a YARA rule on variable names is like identifying a car by its bumper stickers—one scrape and your detection breaks. Focus on the underlying engine parts that attackers cannot easily swap out without rewriting the loader.
Full Explanation
To survive superficial obfuscation such as renamed variables or inserted comments, a YARA signature must target functional invariants. When you combine invariant API call strings with structural hex patterns and boolean conditions, the rule anchors on core execution mechanics and required operational logic rather than cosmetic text. Match on the exact cryptographic hash of the original loader file fails because changing a single comment character alters the entire file hash and breaks detection. Include the original filename and creation timestamp as required strings is equally brittle, as attackers trivially rename files and forge timestamps across deployments. Require every observed command-line argument to appear in exact order also fails because reordering flags or substituting aliases bypasses rigid sequence matching while leaving the payload functional. As a caveat, overly broad boolean conditions matching common administrative APIs can trigger false positives across legitimate scripts. Operational check: test your finalized YARA rule against both mutated loader samples and a clean corpus of enterprise administrative PowerShell scripts to confirm high detection fidelity with zero false positives.