YARA-X is an open-source pattern-matching engine developed by VirusTotal as a complete rewrite of the original YARA project. Written in Rust, it is designed to identify malware, suspicious files, and other digital artifacts using customizable text and binary signatures.
The project retains the familiar rule-based approach of YARA while introducing enhancements in performance, security, diagnostics, and developer integration. It is particularly useful for malware researchers, incident responders, threat hunters, and security engineers who need to scan files, analyze suspicious samples, or integrate signature-based detection into their own applications.
YARA-X is intended to serve as the primary implementation for the future development of YARA. However, the original YARA project remains maintained, so existing implementations do not need to migrate immediately.
Download YARA-X v1.25.0 - Software Mirrors |
|---|
YARA-X v1.25.0 for Windowsyara-x-v1.25.0-x86_64-pc-windows-msvc.zip | 8.73 MB yara-x-v1.25.0-aarch64-pc-windows-msvc.zip | 7.54 MB |
YARA-X v1.25.0 for macOS |
YARA-X v1.25.0 for Linux |
YARA-X v1.25.0 Source Code |
YARA-X v1.25.0 Release Notes: Replace
Contributors: @dannyota, @debugactiveprocess |
Features
1. YARA-Compatible Rule Engine
YARA-X uses a rule-based detection system that describes files through strings, binary patterns, and logical conditions.
Rules can identify specific malware families, suspicious file characteristics, or other patterns relevant to security investigations. They support:
Text strings with case-insensitive matching.
Hexadecimal patterns with wildcards and jumps.
Regular expressions.
Base64 and wide-string modifiers.
Logical operators and conditional expressions.
Rule metadata and tags.
External variables and imported modules.
References to other rules.
Most existing YARA rules are compatible with YARA-X without modification. The project targets approximately 99% rule-level compatibility, although some syntax and behavioral differences remain.
This makes it practical for organizations to reuse existing detection rules while gradually adopting the newer engine.
2. Fast File and Directory Scanning
The yr scan command provides a straightforward way to scan individual files or entire directory structures against one or more rule files.
YARA-X includes several performance improvements, particularly for complex rules involving regular expressions and large collections of patterns. It also uses optimized pattern-matching techniques, including SIMD acceleration for certain matching operations.
Additional scanning capabilities include:
Recursive directory scanning.
Multiple rule files and namespaces.
Scanning with compiled rules.
JSON and other structured output options.
Scan timeouts and resource controls.
CPU usage limiting.
Configurable maximum matches per pattern.
Fast scanning mode.
The CPU limit is particularly useful when running background scans on production systems where unrestricted scanning could interfere with other workloads.
Fast scan mode can improve performance by reducing the number of reported matches. However, it does not provide every occurrence of every matching pattern, so it should not be used when a complete match inventory is required.
3. Extensive Module Support
YARA-X includes specialized modules that allow rules to inspect structured file formats and extract information beyond ordinary string matching.
Available modules include:
PE: Analyze Windows Portable Executable files, including headers, sections, imports, exports, and other executable metadata.
ELF: Inspect Linux and Unix executable files and their structural information.
Mach-O: Examine executable formats used by macOS and other Apple platforms.
DEX: Analyze Android Dalvik executable files.
.NET: Inspect .NET assemblies and related metadata.
ZIP: Examine ZIP archives and their contents.
LNK: Analyze Windows shortcut files.
Hash: Calculate hashes and use them in detection conditions.
Math: Perform mathematical operations, including entropy calculations.
Magic: Identify file types using file signatures.
These modules make rules more context-aware. Instead of relying only on byte sequences, investigators can inspect executable structures, imported functions, file metadata, and other characteristics.
For example, a PE rule can identify suspicious executable sections or inspect imported Windows APIs as part of a more sophisticated detection condition.
4. Compiled Rules
YARA-X can compile source rules into a binary representation that can be reused during subsequent scanning operations.
The yr compile command processes one or more rule files and generates a compiled rules file. The resulting file can then be loaded using the scanner's compiled-rule option.
This provides several advantages:
Avoids recompiling source rules for every scan.
Simplifies distribution of detection rules.
Supports reusable scanning configurations.
Helps separate rule development from production scanning.
Makes it easier to integrate rule compilation into automated pipelines.
Compiled rules are particularly useful when building applications that repeatedly scan large numbers of files using an established rule set.
One important consideration is that compiled-rule serialization can change between releases. For example, a recent release replaced the previous serialization format, requiring existing compiled rules to be rebuilt.
5. Developer APIs and Language Bindings
YARA-X is not limited to its command-line interface. It provides APIs that allow developers to integrate the scanning engine into security products, forensic applications, and automated analysis systems.
Supported interfaces include:
Rust: Native integration with Rust applications and libraries.
C/C++: A C API that allows integration into native applications and existing software written in C or C++.
Python: A Python package for malware analysis, automation, and scripting.
Go: Bindings for applications and security tools written in Go.
The APIs support rule compilation, scanner creation, scanning operations, and retrieval of matching results.
Python integration is particularly convenient for malware research workflows. Developers can compile rules directly from Python code, scan file contents in memory, and inspect matching rules and pattern offsets.
The C API also supports multiple scanners using the same compiled rule set, allowing applications to perform parallel scanning with separate scanner instances.
6. Rule Development and Diagnostics
YARA-X provides improved diagnostics that make writing and maintaining detection rules easier.
Its compiler reports detailed errors and warnings, including the location of problematic expressions and explanations of why a rule cannot be compiled.
The command-line interface also includes utilities for rule maintenance:
yr fmtformats rule source files.yr fixprovides utilities for correcting common rule issues.yr depsdisplays dependencies between rules and imported modules.yr dumpextracts information produced by supported modules.yr compilevalidates and compiles rule collections.
These utilities are useful when maintaining large repositories of detection signatures. The dependency command is especially helpful for identifying which modules and other rules are required by a particular detection rule.
7. Language Server and Playground
YARA-X provides a Language Server Protocol implementation for integration with compatible code editors.
This improves the rule-writing experience with development features such as diagnostics, completion, and workspace symbol support. It is useful for developers maintaining large collections of YARA rules.
The project also provides a browser-based playground where users can experiment with rules and test pattern-matching behavior without immediately installing the command-line application.
Together, these tools make YARA-X more approachable for rule developers and help reduce mistakes during detection development.
8. WebAssembly Support
YARA-X includes a WebAssembly implementation that allows its functionality to be used in compatible browser and JavaScript environments.
This opens possibilities for web-based malware analysis tools, browser-based rule testing, and applications that need to perform pattern matching without requiring a separate native scanning service.
The WebAssembly component is part of the broader YARA-X ecosystem, alongside its native command-line application and language bindings.
Performance and Compatibility
YARA-X is written in Rust and designed to improve upon the original YARA engine in performance, memory safety, and usability.
Its optimized pattern-matching implementation can provide significant improvements for certain workloads, particularly when scanning with large rule collections or complex regular expressions. However, actual performance depends on the rules, file formats, sample sizes, and scanning environment. It should not be assumed that every workload will be faster.
The application provides prebuilt binaries for Linux, Windows, and macOS. Its Python package supports Python 3.9 and later across these operating systems.
One important consideration is rule compatibility. Although most existing YARA rules work without changes, some differences can affect migration:
Regular expressions require stricter escaping in certain situations.
Base64 patterns shorter than three characters are not supported.
Some rule modifiers and expressions have different validation behavior.
Certain legacy syntax is handled differently.
Some modules and module behaviors differ from the original implementation.
YARA-X provides a compatibility guide and a relaxed regular-expression syntax option to help with migration. Existing rule collections should still be tested against representative samples before being deployed in production.
It is also important to understand that YARA-X is a detection engine, not a complete antivirus or endpoint detection and response platform. It identifies patterns in files and data but does not independently provide continuous endpoint monitoring, malware remediation, or centralized security management.
System Requirements
YARA-X does not impose one universal hardware requirement. Its resource consumption depends on the size of the scanned files, complexity of the rules, and number of concurrent scanning operations.
General requirements include:
Operating Systems: Windows, Linux, and macOS.
Architecture: Supported architectures depend on the release build. Check the available release archives for the required platform.
Python: Python 3.9 or later when using the Python package.
Source Compilation: A recent Rust toolchain is required.
Rule Files: YARA-compatible source files using supported YARA-X syntax.
Storage: Sufficient disk space for the application, rule collections, compiled rules, and scanned data.
Prebuilt binaries are the easiest installation option for most users. Developers building from source will need the Rust toolchain and any additional dependencies required by their selected components.
Pros and Cons
Pros
Open-source YARA rewrite developed by VirusTotal.
Written in Rust with a focus on performance and memory safety.
High compatibility with existing YARA rules.
Supports textual, hexadecimal, and regular-expression patterns.
Extensive modules for PE, ELF, Mach-O, DEX, .NET, ZIP, and other formats.
Efficient scanning with SIMD-accelerated matching.
Supports compiled rules for reusable scanning workloads.
CPU limits and scanning controls help manage resource consumption.
C/C++, Rust, Go, and Python integration.
Includes rule formatting, diagnostics, and dependency inspection.
Language Server and browser-based playground improve rule development.
Supports Linux, Windows, and macOS.
BSD 3-Clause license.
Cons
Not every existing YARA rule is fully compatible.
Rule migration requires testing and occasional syntax adjustments.
Fast scan mode may omit additional pattern matches.
Advanced detection rules require knowledge of YARA syntax and file formats.
Performance varies depending on rules and scanning workloads.
Compiled rules may need to be regenerated after format changes.
Does not provide a complete antivirus, EDR, or centralized endpoint management solution.
Some advanced integrations require programming knowledge.
How to Install
The easiest way to install YARA-X is to download a prebuilt binary from the project's GitHub releases.
Linux, Windows, and macOS:
Open the official YARA-X GitHub repository.
Navigate to the Releases section.
Download the archive matching your operating system and architecture.
Extract the archive and make the
yrexecutable available in your system PATH.Open a terminal and verify the installation:
yr --version
macOS using Homebrew:
brew install yara-xBuild from source:
If you prefer compiling the application yourself, install a recent Rust toolchain and run:
git clone https://github.com/VirusTotal/yara-x
cd yara-x
cargo install --path cliExample scan:
yr scan rules.yar /path/to/suspicious/filesCompile rules:
yr compile rules.yar --output rules.yarcScan using compiled rules:
yr scan --compiled-rules rules.yarc /path/to/suspicious/filesFor Python integration, install the package using:
pip install yara-xSources
Final Verdict
YARA-X is a major evolution of the YARA ecosystem, bringing a modern Rust implementation to one of the most widely used pattern-matching approaches in malware research. Its combination of optimized scanning, extensive file-format modules, compiled rules, and multiple programming language APIs makes it a strong foundation for building malware detection and forensic analysis tools.
Its biggest advantage is versatility. Security researchers can use the command-line scanner for manual investigations, automate analysis through Python, or embed the engine into larger applications using its native APIs. The improved diagnostics and development tools also make maintaining complex rule collections more manageable.
The main limitation is compatibility. Although most existing YARA rules work, differences in syntax and behavior mean that migration should involve testing rather than simply replacing the original engine. It is also important to remember that YARA-X focuses on pattern matching and does not replace a complete endpoint security platform.
Overall, YARA-X is an excellent choice for malware researchers, threat intelligence teams, incident responders, and developers who need a modern, extensible, and high-performance signature-matching engine.




