YARA rules
YARA stands for - Yet Another Ridiculous Acronym. It is one of the most powerful threat hunting and detection opensource tool. It takes a rule file and detects malware based on those rules.
yara
yara64Example syntax-
Example.yara
rule Yara_example {
meta:
description = "Yara example"
author = "PMAT"
date = "2021-10-15"
strings:
$string1="YOURTHEMANNOWDOG" ascii
$string2="nim"
$PE_magic_byte = "MZ"
$sus_hex_string={ FF E4 ?? 00 FF}
condition:
$PE_magic_byte at 0 and
($string1 or $string2) or
$sus_hex_string
}
Command used-
-p gives the threads-w suppresses warnings

A malware has been detected.
Add the -s flag to know which part of the rule triggered the result.

The $string2 variable triggered the result. To recursively search in the current working directory, use . instead of the file name.
For any other directory , use the directory location and -r flag instead of . .
Use // in the rule to add comments.
Last updated