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
Automating Malware Reverse Engineering with Local LLMs, PyGhidra and Neo4j Graphs
A researcher has developed an automated pipeline that uses local large language models to analyze decompiled malware code extracted via PyGhidra. The system loads functions, call graphs, strings and imports into a Neo4j graph database to preserve context across hundreds of functions. Each function is sent to a local Qwen3 model running in LM Studio together with its neighboring call-graph context, producing structured JSON output on purpose, IOCs, tags and evasion techniques. Aggregated capabilities and behavioral patterns such as file encryption and C2 communication are then derived through graph queries. Testing on a WannaCry sample from MalwareBazaar processed 195 functions in 126 minutes and correctly identified File Encryption, C2 Communication and Anti-Analysis behaviors with 100 percent confidence. The approach keeps all sensitive indicators inside a local environment and avoids context overflow and censorship issues common with cloud-based models.
GitHub Removes 10,000 Malware Repositories After Public Exposure but Takes No Further Action
An investigation reveals that GitHub hosts thousands of repositories distributing trojanized ZIP archives, many of which have persisted for two years despite the platform's resources. The malicious repositories follow consistent patterns in README files, including specific headings and links to versioned archives hosted on githubusercontent.com. A detailed article and accompanying script published on Hacker News identified over 10,000 such repositories, prompting GitHub to delete only those specific entries. New repositories matching the same patterns continue to appear and remain active, with no additional proactive measures taken by the security team. The situation highlights questions about Microsoft's approach to automated detection and response on its subsidiary platform.
Dolphin X Malware Adds AI Profiler to Rank and Prioritize High-Value Victims After Infection
Dolphin X is a newly identified Windows infostealer and remote access trojan that integrates an AI Profiler component designed to score infected machines and generate priority rankings for operators. The profiler analyzes telemetry from compromised systems, including application usage, browser domains visited, and installed software, to produce daily summaries that help attackers focus resources on the most valuable targets such as those with cloud access or sensitive tools. Dolphin X claims compatibility with over 300 applications, explicitly covering nine Chromium and Gecko browser families, more than 100 cryptocurrency wallet extensions, 65 desktop wallets, 10 password managers, and over 30 common cloud CLI tools. The malware targets files like .env configurations, SSH keys, cloud access tokens, browser sessions, and cryptocurrency wallet data to accelerate movement from initial credential theft to further compromises in accounts and production environments. Researchers have confirmed the AI Profiler workflow and associated scoring functions in the operator panel, although the underlying AI model itself remains unverified without full analysis of an active sample. The discovery highlights how automated prioritization can significantly shorten the time between mass infections and targeted follow-on attacks, prompting recommendations for reduced local credential storage and enhanced behavioral detection.
187,064 Instructions for One Flag: Reverse Engineering HTB Callfuscated Insane Challenge
A detailed technical breakdown of the HackTheBox Callfuscated reversing challenge reveals an extremely heavy obfuscation scheme built around a custom virtual machine, mixed Boolean-arithmetic transformations, opaque predicates, and call-based junk code. The binary implements a password checker that executes 187,064 instructions even on a short input because every real operation is wrapped inside thousands of call/pop gadgets. The author bypassed static analysis by building a ptrace-based tracer, dumping the 586-cell VM program array, and writing a Python emulator that faithfully replays the recorded execution trace. After fixing several edge cases involving rand() return addresses and operand-size detection, the emulator reproduced the exact register state of the original binary. Dynamic analysis exposed that the VM performs simple big-endian word construction followed by XOR operations with eight constant pairs, allowing the flag to be recovered directly without further symbolic execution.