YARA
1. Download Ubuntu
Section titled “1. Download Ubuntu”Download the Ubuntu desktop image (.iso) from ubuntu.com/download.

2. Create the VM in VMware Fusion
Section titled “2. Create the VM in VMware Fusion”VMware Fusion and Workstation Pro have been free for personal use since May 2024 (announcement).
-
Open VMware Fusion and choose File › New.

-
Drag the downloaded .iso onto the installer window. The OS details fill in automatically. Click Continue.


-
On Linux Easy Install, untick Use Easy Install, then Continue.

-
On Choose Firmware Type, select Legacy BIOS, then Continue.

-
On Finish, review memory, network and cores (Customize Settings to change them), then Finish.

-
Name and save the VM with something descriptive.

-
At the boot screen, choose Try or Install Ubuntu and press Enter. The installation begins.


3. Install Ubuntu
Section titled “3. Install Ubuntu”Follow the installer, then create your account. A restart may be needed.
-
Choose your language.

-
Set your accessibility options.

-
Set the keyboard layout.

-
Choose how to connect to the internet.

-
Apply any updates the installer asks for (not every install needs this).


4. Install YARA
Section titled “4. Install YARA”-
Update the package lists:
Terminal window sudo apt-get update
-
Install YARA:
Terminal window sudo apt-get install yara -y
-
Check the version to confirm it worked:
Terminal window yara --version
5. Write your first rule
Section titled “5. Write your first rule”The example uses a public RedLine Stealer sample. Its hashes:
| Hash | Value |
|---|---|
| MD5 | 0c341e00d3027a4a6ea5438f37f06677 |
| SHA1 | 60717e853262eeae53ccc87da6940adb73aa9ce2 |
| SHA256 | 1da56a5f2bbdc5215305e5e397bd3ed926f44520e145aa7bf2e6785b33f381e6 |
-
Create a rule file:
Terminal window cd ~/Desktoptouch test_08_yara_rule.yar
-
Open it in a text editor. A rule has three parts: meta (who wrote it and why), strings (what to look for) and condition (when it matches).
-
Write the rule:
rule test_08_potential_RedLineStealer{meta:author = "FName LName"date = "2024-06-27"description = "Test string search"strings:$string1 = "Apriorist.exe"$string2 = "Scripting.FileSystemObject"$string3 = "WScript.Shell"condition:($string1 or $string2 or $string3)} -
Run it against a file:
Terminal window yara test_08_yara_rule.yar <target file>If it matches, YARA prints the rule name and the file.

-
Add
-sto see which strings matched and where:Terminal window yara -s test_08_yara_rule.yar <target file>

One Reverse Look
"A little learning is a dangerous thing." ~ A. Pope
One Reverse Look · Made with ❤ · Your friendly knowledge seeker

