HabrJuly 23, 2026🇷🇺Translated from Russian

YARA Style Guide: Comprehensive Best Practices for Naming, Structuring and Maintaining Detection Rules

Florian Roth’s YARA Style Guide has been translated and adapted by security specialist Maxim Motikov of the Russian company Garda to help teams maintain large, consistent collections of detection rules. The guide addresses the common problem that YARA lacks a strict naming or formatting standard, causing rulebases to become disorganized over time.

Rule Naming Conventions

Rule names should combine threat category, context, target platform and creation date so that analysts can understand the purpose of a rule without opening the file. Recommended category prefixes include MAL for malware, HKTL for hacktools, WEBSHELL, EXPL for exploits, VULN for vulnerabilities, SUSP for suspicious patterns and PUA for potentially unwanted applications.

Context tags such as APT, CRIME, RANSOM and ANOMALY can be added, followed by malware type indicators like RAT, Implant, Stealer, Loader or Crypter. Platform and technology suffixes cover operating systems (WIN, LNX, MacOS), architectures (X64, X86, ARM) and file formats or languages (PE, ELF, PS1, VBS, JS, NET, Go, Rust, PHP and others).

Packers such as UPX, Themida and NSIS should be noted when relevant, and specific threat actor or family names (Lazarus, CozyBear, CobaltStrike, PlugX, QakBot) are written in full. Unique suffixes such as May23 or _1 help prevent naming collisions.

Rule Structure and Metadata

Every rule follows a consistent layout with meta, strings and condition sections. Mandatory metadata fields are description (starting with “Detects …”), author, reference and date in YYYY-MM-DD format. Optional but recommended fields include score (0–100), hash (preferably SHA256), modified date and license.

The score helps prioritize alerts: values above 85 indicate high-confidence detections, while lower scores flag generic or low-severity indicators. Additional tags can be stored in a dedicated meta field when they are not central enough for the rule name.

String Organization and Readability

Strings are categorized into three groups: high-specificity strings prefixed with $x*, group strings prefixed with $s* and preliminary filter strings prefixed with $a*. False-positive indicators receive the $fp* prefix so that matches on legitimate patterns can suppress alerts.

Hexadecimal byte sequences should be accompanied by ASCII comments when possible, and long values may be split into 16-byte segments. Simple text strings must never be written as hex unless they contain control characters.

Condition Formatting

Conditions should follow a logical order: header checks, file-size limitations, other constraints, string combinations and finally false-positive filters. Each “and” clause is placed on a new line, and “or” groups are indented for clarity.

By adopting these conventions, teams can create self-documenting rules that remain understandable months or years after creation and reduce the time required to triage large numbers of alerts.

Related articles

AntiMalwareMalware & Botnets

Palo Alto Networks Unit 42 Uncovers Kimwolf v7 Botnet Infecting Android Set-Top Boxes via Open ADB

Researchers at Palo Alto Networks Unit 42 have identified Kimwolf v7, an updated botnet that compromises Android set-top boxes and other IoT devices to conduct DDoS attacks. The malware now employs HTTP/2 flooding with realistic browser fingerprints to blend malicious traffic with legitimate user activity. Command-and-control infrastructure is hardened through Ethereum Name Service lookups and public Ethereum RPC services, with a Tor fallback address embedded in the binary. Operators have removed scanning, exploitation, and brute-force capabilities from this version, indicating a division of labor where a separate loader handles initial infection. The botnet uses 15 numbered methods focused on high-performance UDP floods optimized for ARM processors. Infections typically occur through residential proxies targeting devices with open Android Debug Bridge on port 5555, after which the malware masquerades as system processes. Unit 42 advises treating Android set-top boxes as untrusted devices and disabling ADB or restricting it to USB access only.

BoletimSecMalware & Botnets

Google Play Apps Hide Anatsa Banking Trojan Using Stealthy Loaders

Malicious applications distributed through Google Play are employing stealthy loaders to install the Anatsa banking trojan for Android, putting victims' financial accounts at risk. The campaign relies on seemingly legitimate programs to conceal the initial infection stage, with one identified case involving a modified PDF reader that displays a fake update prompt to trick users into installing an additional component. Another loader discovered in the Cleanova application collects data from analytics SDKs, including installation source details, and forwards this information to a command-and-control server. The server then decides whether to deliver the malicious payload based on predefined criteria, leaving the code inactive for non-targeted victims to evade automated analysis. Once Anatsa is installed, the threat can facilitate theft of credentials used for financial services and enable fraudulent transactions. Banking trojans represented 30.77 percent of detected malicious mobile applications in the second quarter of 2026, during which more than 1.99 million attacks involving malware, adware, or unwanted programs were blocked and 93,574 banking trojan installation packages were identified.

AntiMalwareMalware & Botnets

Android Banking Trojans Hide in Droppers to Bypass Google Play Checks

Kaspersky solutions blocked 1.99 million attacks involving Android malware, adware and potentially unwanted programs in the second quarter of 2026, down from 2.68 million the previous quarter. Researchers still recorded 304,000 malicious installation packages, among them 93,600 banking trojans that retained the largest share at 30.77 percent. Operators increasingly rely on droppers that pass initial store review and later download the real payload. One PDF reader application distributed through Google Play displayed a fake update prompt that installed the Anatsa banking trojan. The Cleanova dropper collected installation-source data and delivered its payload only under attacker-chosen conditions, avoiding analysis environments. The share of users hit by Trojan-Dropper.AndroidOS.Banker.dd rose sharply from 0.01 percent to 2.16 percent, while the Mamont and Creduz families continued to expand with new variants.

HabrMalware & Botnets

Reverse Engineering Tutorial Explores Hybrid Analysis of Linux x86-64 Crackme Using Ghidra and GDB

A detailed three-part tutorial series examines the crackme binary Getting started keygen by Mazzotti on Linux x86-64. The first installment covers initial file inspection with file and strings utilities, identification of the ELF format and PIE properties, and loading the stripped binary into Ghidra to locate the entry point and main function. Analysts reconstruct stack frames, resolve optimized prologues, and correct Ghidra's variable sizing errors through dynamic confirmation in GDB. The series emphasizes hybrid static-dynamic methodology: decompiler hypotheses are tested with breakpoints and memory examination, then fed back to refine types and structures. Future parts will cover mutation testing, hidden C++ structures, and full Python reconstruction of the validation algorithm without patching branches.