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

HabrMalware & Botnets

Kaspersky Details MovieReaper Malware Framework Distributed via Compromised Torrent Trackers

Kaspersky researchers have uncovered MovieReaper, a previously unknown modular malware framework that spreads through popular torrent sites by masquerading as movies, games, and other content. The campaign began after attackers compromised the itorrents repository in October 2025, allowing malicious torrents to propagate across multiple trackers and infect hundreds of users across Europe, Asia, and Africa. MovieReaper uses a multi-stage infection chain that includes a fake executable with a VLC icon, shellcode delivery from an initial C2, and a secondary C2 address retrieved from the Solana blockchain to improve resilience against takedowns. Subsequent stages bypass Windows UAC for persistence before deploying a final module with 21 commands for file system access, exfiltration, and potential additional payload deployment. The same report also covers NightEagle attacks on Russian infrastructure and the PAYLOAD extortion campaign using Active Directory Group Policy. Separate research highlights new side-channel attacks such as InjectEave on headphones and DDRop against Intel TDX and AMD SEV-SNP protections, along with a zero-day in Google Pixel radio modules and the arrest of TeamPCP members facilitated by Google Threat Intelligence Group.

AntiMalwareMalware & Botnets

MacSync Malware Evolves to Steal Cryptocurrency and Conceal Components in iCloud

Updated MacSync malware for macOS now arrives bundled with a stealer and backdoor, allowing attackers to harvest browser history, cookies, passwords, Telegram data, and cryptocurrency wallet details while maintaining persistent remote access. Discovered by Kaspersky researchers in September 2026, the new variant uses a multi-stage infection chain that begins with a fake application download, such as a document collaboration tool or crypto wallet. One component is delivered through a publicly shared iCloud calendar entry in ICS format, bypassing traditional loaders. After execution, MacSync requests administrator credentials, displays a fake macOS damage notification, and installs the stealer alongside a Finder-masquerading backdoor. The backdoor enables arbitrary code execution, file theft, browser extension installation, and replacement of the legitimate Ledger application with a malicious version to drain cryptocurrency funds. Users are advised to download software only from trusted sources and remain cautious of unexpected administrator password prompts.

HabrMalware & Botnets

Network Traffic Analysis Reveals 75% Malware Threats Over 10 Months of Monitoring

Positive Technologies analyzed anonymized data from PT Sandbox and PT Network Attack Discovery collected between October 2025 and July 2026. The study found that malicious software accounted for 75% of all detected threats in organizational network traffic. Information-stealing trojans made up 24% of malware samples, with 85% of those focused on credential theft. RATs, loaders, and ransomware each represented smaller but high-impact shares. Legacy vulnerabilities such as CVE-2017-0199 and CVE-2017-11882 remained active attack vectors. Activity from groups including MustangPanda, TA505, and APT37 was observed across finance, manufacturing, and government sectors.

BoletimSecMalware & Botnets

HEAVYGRAM Spyware Uses Telegram Bots for Command and Control Against Iranian Targets

Researchers at Group-IB have published a detailed analysis of HEAVYGRAM, a spyware family that abuses the Telegram messaging platform as its command-and-control infrastructure. The malware family was first observed in the second half of 2023 and has since been linked with moderate confidence to the Handala Hack group. Instead of operating dedicated servers, the operators rely on Telegram bots, accounts, and groups to register infected hosts, receive commands, exfiltrate stolen data, and deliver additional payloads. Once active, HEAVYGRAM captures screenshots, records audio, harvests cached files, and steals data from Telegram Desktop installed on the victim machine. The campaign primarily targets Iranian journalists, dissidents, and individuals opposed to the Iranian government. Infection vectors include malicious files distributed via messengers, disguised as legitimate applications such as Pictory, KeePass, or Telegram-related tools, sometimes delivered as HTML applications or scripts.