YARA¶
What YARA does¶
Using this tool
YARA supports malware analysis. In this guide, you will use it to write or apply a focused rule to identify a known known training sample. Follow the steps below and keep the output with your notes.
Tool guide at a glance¶
Write or apply a focused rule to identify a known known training sample.
An inert or purpose built training sample stored in a disposable isolated analysis VM.
A static observation or capability finding with sample hash, tool output, and confidence statement.
Evidence and safety
Do not execute unknown samples on SUSA. Disable shared folders and credentials, and use only authorised training material. Record the input identifier, tool version, relevant commands or settings, time and time zone, output location, and any errors or limitations as you work.
Choose your journey¶
01Understand the evidenceLearn the malware analysis concepts and limitations.Complete when you can explain what the evidence can and cannot show.Beginner · No tool required 02Follow the YARA guideFollow the steps and screenshots below.Complete when the documented workflow produces its expected output.Guided · SUSA workstation · Time varies 03Interactive labPractise the tool workflow in a safe browser simulation.Complete when the guided result is supported by the case evidence.Beginner · Browser only 04Full LabUse your own training data, keep the output and explain what you found.Complete when another analyst can reproduce and verify the outcome.Intermediate · Isolated lab
How the labs complement this guide
The Interactive Lab uses example records to practise investigation decisions. It does not run the installed tool or establish how that version behaves. The Full Lab uses your own training environment and evidence. Obtain or create the required input before starting; a case name in an exercise is not a download.
Accessing YARA in SUSA¶
YARA is a cross platform tool that runs on Windows, Linux, and macOS, allowing analysts to quickly scan suspicious files against a set of detection rules. It compares target files to a collection of signatures and reports any matches, making it useful for malware identification and threat hunting.
Download YARA from VirusTotal’s official GitHub release page.
Move the downloaded ZIP archives to C:\Tools\YARA folder and extract the contents to this directory.
Testing YARA¶
Create powershell_test.ps1:
Create a YARA rule called powershell.yar:
rule Suspicious_PowerShell_Download
{
strings:
$iex = "IEX" nocase
$download = "DownloadString" nocase
condition:
all of them
}
Open an administrator Command Prompt and navigate to C:\Tools\Yara and run:
This simulates finding a malicious PowerShell script during an investigation.