Loading...
Loading...
Guides authoring, review, optimization, and false-positive debugging of YARA-X detection rules for malware identification across PE, script, npm, Office, Chrome extensions (crx module), and Android DEX (dex module). Covers string and atom quality, condition short-circuiting, legacy YARA migration, yarGen/FLOSS workflows, goodware validation, and production deployment—not full malware reverse engineering, network IDS (Suricata/Snort), or memory forensics (Volatility). Use when the user asks to write YARA rule, YARA-X, yr check, yr scan, false positive YARA, yarGen, malware detection rule, crx module, dex module, optimize YARA performance, or migrate legacy YARA.
npx skill4agent add daemon-blockint-tech/agentic-enteprises-skill yara-rule-authoringTarget runtime: YARA-X (Rust successor to legacy YARA). Install:orbrew install yara-x. Essential CLI:cargo install yara-x,yr check,yr scan,yr fmt.yr dump
any ofall ofcrxdexreverse-engineerdigital-forensics-analystcybersecuritycompliance-engineerdevsecopsai-redteam| Need | Skill |
|---|---|
| Security program, IR strategy, detection philosophy | |
| SIEM/EDR rules, logging, control implementation | |
| Audit evidence, control mapping, CCM | |
| Pipeline gates, artifact scanning, SBOM | |
| Binary RE, unpacking, patch diff | |
| SOC alert triage and detection tuning (non-YARA) | |
| Proactive threat hunts and ATT&CK campaigns | |
| CTI briefs, IOC/TTP production | |
| Adversarial AI / prompt injection testing | |
| Disk imaging and forensic reports | |
filesize| Tool | Purpose |
|---|---|
| yarGen | Candidate strings from samples ( |
| FLOSS | Obfuscated/stack strings when yarGen fails |
| yr | |
| YARA-CI / VT retrohunt | Goodware corpus testing before deploy |
import "crx"import "dex"references/yara_x_scope_and_tooling.mdC:\Windows\requirefetchreferences/string_selection_and_atoms.mdrule MAL_Win_Example_Loader_Jan26
{
meta:
description = "Detects Example loader via unique mutex and config path"
author = "Team <team@example.com>"
reference = "https://example.com/analysis"
date = "2026-01-15"
strings:
$mutex = "Global\\ExampleMutex" ascii wide
$cfg = "/api/beacon/check" ascii
condition:
filesize < 10MB and
uint16(0) == 0x5A4D and
all of ($mutex, $cfg)
}filesizepecrxdexreferences/conditions_and_performance.mdyr check rule.yar && yr fmt -w rule.yar
yr scan -s rule.yar malware_samples/ # must match all targets
yr scan -c rule.yar goodware_corpus/ # must be zeroyr scan -sreferences/testing_goodware_and_fp_debugging.mdimport "crx"permhash()crx.is_crximport "dex"dex.contains_class()contains_method()contains_string()references/platform_modules_pe_crx_dex.md{CATEGORY}_{PLATFORM}_{FAMILY}_{VARIANT}_{DATE}MAL_Win_Emotet_Loader_Jan26references/style_metadata_and_deployment.md< 4 bytes? → reject
Repeated bytes (0000, 9090)? → reject
API name or common path? → reject
Unique to family? → use
Common across malware? → combine with family-specific markerany ofall ofany of ($a*)all of ($a*)all of ($core_*) and any of ($variant_*)any of ($network_*)fetchaxioshttpyr dump -m pemath.entropy()yr check --relaxed-re-syntax rules/ # diagnostic only
yr check rules/ # fix until clean\{@a[-1]@a[#a - 1]| Thought | Reality |
|---|---|
| "yarGen gave me these strings" | yarGen suggests; you validate each string |
| "It works on 10 samples" | Test goodware corpus before deploy |
| "I'll tighten after FPs" | FPs burn trust — write tight rules upfront |
| "This API name is malicious" | Legitimate software uses the same APIs |
| "any of them is fine" | Common strings + |
{CATEGORY}_{PLATFORM}_{FAMILY}_{VARIANT}_{DATE}.*filesizeyr checkyr fmt --check| Topic | Reference |
|---|---|
| YARA-X install, CLI, migration, toolkit | |
| String quality, types, modifiers | |
| Atoms, condition order, regex, loops | |
| PE, macOS, JS, crx, dex patterns | |
| Goodware testing, FP debugging | |
| Naming, metadata, deployment | |