cloud-devops-expert
Cloud and DevOps expert including AWS, GCP, Azure, and Terraform
yara-authoring
YARA-X detection rule authoring with expert judgment, linting, atom analysis, and best practices. Teaches how to think like an expert YARA author for malware detection, threat hunting, and indicator-of-compromise identification using YARA-X (the Rust-based successor to legacy YARA).
Full skill instructions
This skill implements Trail of Bits' YARA authoring methodology for the agent-studio framework. YARA-X is the Rust-based successor to legacy YARA, offering improved performance, safety, and new features. This skill teaches you to think and act like an expert YARA author, producing detection rules that are precise, efficient, and maintainable.
Source repository: https://github.com/trailofbits/skills
License: CC-BY-SA-4.0
Target: YARA-X (with legacy YARA compatibility guidance)
yr check and yr debug atoms before deployment.yr) by default — legacy yara/yarac tooling lacks memory safety, performance optimizations, and modern module support; use YARA-X unless backward compatibility is explicitly required.| Feature | Legacy YARA | YARA-X |
|---|---|---|
| Language | C | Rust |
| Safety | Manual memory management | Memory-safe |
| Performance | Good | Better (parallelism) |
| Modules | PE, ELF, math, etc. | Same + new modules |
| Syntax | YARA syntax | Compatible + extensions |
| Toolchain | yara, yarac | yr CLI |
# Scan a file
yr scan rule.yar target_file
# Check rule syntax
yr check rule.yar
# View rule atoms (for efficiency analysis)
yr debug atoms rule.yar
# Format a rule
yr fmt rule.yar
import "pe"
import "math"
rule MalwareFamily_Variant : tag1 tag2 {
meta:
author = "analyst-name"
date = "2026-02-21"
description = "Detects MalwareFamily variant based on [specific indicators]"
reference = "https://example.com/analysis-report"
hash = "sha256-of-sample"
tlp = "WHITE"
score = 75
strings:
// Unique byte sequences from the malware
$hex_pattern1 = { 48 8B 05 ?? ?? ?? ?? 48 89 45 F0 }
$hex_pattern2 = { E8 ?? ?? ?? ?? 85 C0 74 ?? }
// String indicators
$str_mutex = "Global\\MalwareMutex_v2" ascii wide
$str_c2 = "https://evil.example.com/gate.php" ascii
$str_useragent = "Mozilla/5.0 (compatible; MalBot/1.0)" ascii
// Encoded/obfuscated patterns
$b64_config = "aHR0cHM6Ly9ldmlsLmV4YW1wbGUuY29t" ascii // base64
condition:
uint16(0) == 0x5A4D and // MZ header (PE file)
filesize < 5MB and
(
2 of ($hex_*) or
($str_mutex and 1 of ($str_c2, $str_useragent)) or
$b64_config
)
}
| Field | Purpose | Example |
|---|---|---|
author | Who wrote the rule | "Trail of Bits" |
date | When rule was created | "2026-02-21" |
description | What the rule detects | "Detects XYZ malware loader" |
reference | Source analysis/report | "https://..." |
hash | Sample hash for validation | "sha256:abc123..." |
tlp | Traffic Light Protocol | "WHITE", "GREEN", "AMBER", "RED" |
score | Confidence (0-100) | 75 |
// GOOD: Specific bytes with targeted wildcards
$good = { 48 8B 05 ?? ?? ?? ?? 48 89 45 F0 }
// BAD: Too many wildcards (poor atoms)
$bad = { ?? ?? ?? ?? 48 ?? ?? ?? ?? ?? }
// GOOD: Use jumps for variable-length gaps
$jump = { 48 8B 05 [4-8] 48 89 45 }
// GOOD: Use alternations for variant bytes
$alt = { 48 (8B | 89) 05 ?? ?? ?? ?? }
// Case-insensitive matching
$str1 = "CreateRemoteThread" ascii nocase
// Wide strings (UTF-16)
$str2 = "cmd.exe" ascii wide
// Full-word matching (avoid substring false positives)
$str3 = "evil" ascii fullword
// Use sparingly - regex is slower than literal strings
$re1 = /https?:\/\/[a-z0-9\-\.]+\.(xyz|top|club)\//
// Prefer hex patterns over regex for binary content
// WRONG: $re2 = /\x48\x8B\x05/
// RIGHT: $hex2 = { 48 8B 05 }
Atoms are the fixed byte sequences YARA uses to pre-filter which rules to evaluate. Efficient atoms = fast scanning.
# View atoms for a rule
yr debug atoms rule.yar
# Good output: unique 4+ byte atoms
# Atom: 48 8B 05 (from $hex_pattern1)
# Atom: CreateRemoteThread (from $str1)
# Bad output: short or common atoms
# Atom: 00 00 (too common, will match everything)
| Atom Length | Quality | Action |
|---|---|---|
| 1-2 bytes | Poor | Rewrite pattern with more specific bytes |
| 3 bytes | Acceptable | Consider extending if possible |
| 4+ bytes | Good | Ideal for efficient scanning |
| Common bytes (00, FF, 90) | Poor | Avoid patterns starting with common bytes |
Place cheap checks first to enable short-circuit evaluation:
condition:
// 1. File type check (instant)
uint16(0) == 0x5A4D and
// 2. File size check (instant)
filesize < 10MB and
// 3. Simple string matches (fast)
$str_mutex and
// 4. Complex conditions (slower)
2 of ($hex_*) and
// 5. Module calls (slowest)
pe.imports("kernel32.dll", "VirtualAllocEx")
// At least N of a set
2 of ($indicator_*)
// All of a set
all of ($required_*)
// Any of a set
any of ($optional_*)
// String at specific offset
$mz at 0
// String in specific range
$header in (0..1024)
// Count-based
#suspicious_call > 5
Targets specific malware families with high-confidence indicators.
rule APT_Backdoor_SilentMoon {
meta:
description = "Detects SilentMoon backdoor used by APT group"
score = 90
strings:
$config_marker = { 53 4D 43 46 47 } // "SMCFG"
$decrypt_routine = { 31 C0 8A 04 08 34 ?? 88 04 08 41 }
condition:
uint16(0) == 0x5A4D and
$config_marker and
$decrypt_routine
}
Targets specific attack techniques regardless of malware family.
rule TECHNIQUE_ProcessHollowing {
meta:
description = "Detects process hollowing technique indicators"
score = 60
strings:
$api1 = "NtUnmapViewOfSection" ascii
$api2 = "WriteProcessMemory" ascii
$api3 = "SetThreadContext" ascii
$api4 = "ResumeThread" ascii
condition:
uint16(0) == 0x5A4D and
3 of ($api*)
}
Identifies packed or obfuscated executables.
rule PACKER_UPX {
meta:
description = "Detects UPX packed executables"
score = 30
strings:
$upx0 = "UPX0" ascii
$upx1 = "UPX1" ascii
$upx2 = "UPX!" ascii
condition:
uint16(0) == 0x5A4D and
2 of ($upx*)
}
in (range) instead of exact offsets when possible -- variants shift bytes.yr toolchain, not legacy yara/yarac.Before deploying any rule:
yr check rule.yaryr debug atoms rule.yarCATEGORY_FamilyName_Variantbinary-analysis-patterns or memory-forensicsyara-authoring to create detection rulesvariant-analysis to find similar samples for rule tuning| Skill | Relationship |
|---|---|
binary-analysis-patterns | Extract indicators from malware for rule authoring |
memory-forensics | Extract memory artifacts for memory-scanning rules |
variant-analysis | Find malware variants to tune rule coverage |
static-analysis | Automated analysis to complement YARA detection |
protocol-reverse-engineering | Extract network signatures for YARA rules |
| Anti-Pattern | Why It Fails | Correct Approach |
|---|---|---|
Over-broad wildcards (?? ?? ?? ??) | Poor atoms cause rule to run against every file byte; massive performance degradation | Use at least 4 consecutive fixed bytes; scope wildcards to specific positions |
| Skipping atom analysis | Invisible performance sink; rule may have 1-byte atoms causing false positives | Always run yr debug atoms rule.yar before deployment |
| Missing metadata fields | Rules become unauditable; cannot trace origin, sample, or analyst | Always include: author, date, description, reference, hash, tlp, score |
| Conditions before file type checks | Expensive string matching runs on non-matching file types | Place uint16(0) == 0x5A4D (or equivalent) first in every condition |
Using nocase on short strings | Short case-insensitive patterns match everywhere in arbitrary data | Reserve nocase for strings >= 8 bytes; use exact case for shorter patterns |
Before starting: Check for existing YARA rules in the project for naming conventions and pattern reuse.
During authoring: Write rules incrementally, testing each against the target sample. Document atom analysis results.
After completion: Record effective patterns, atom quality metrics, and false positive rates to .claude/context/memory/learnings.md for improving future rule authoring.
Cloud and DevOps expert including AWS, GCP, Azure, and Terraform
Spreadsheet toolkit (.xlsx/.csv). Create/edit with formulas/formatting, analyze data, visualization, recalculate formulas, for spreadsheet processing and analysis.
Automated brownfield codebase analysis with weighted keyword scoring, three-stream analysis, and design pattern recognition. Detects project type, frameworks, dependencies, architecture patterns, and generates comprehensive project profile.
Use when creating, updating, or generating README and documentation files for projects and libraries
Core skill for the deep research and writing tool. Write scientific manuscripts in full paragraphs (never bullet points). Use two-stage process with (1) section outlines with key points using research-lookup then (2) convert to flowing prose. IMRAD structure, citations (APA/AMA/Vancouver), figure...
Comprehensive Android development expert covering Jetpack Compose, Kotlin coroutines/Flow, Architecture Components, Hilt DI, Navigation, testing, performance, Material Design 3, and modern Android patterns (MVI, Clean Architecture).
Efficient database search tool for bioRxiv preprint server. Use this skill when searching for life sciences preprints by keywords, authors, date ranges, or categories, retrieving paper metadata, downloading PDFs, or conducting literature reviews.
Use when the user wants to use Google Gemini for analysis, large files or codebases, sandbox execution, or brainstorming. Uses headless Gemini CLI scripts (no MCP). Triggers on "use Gemini", "analyze with Gemini", "large file", "sandbox", "brainstorm with Gemini".
High-performance toolkit for genomic interval analysis in Rust with Python bindings. Use when working with genomic regions, BED files, coverage tracks, overlap detection, tokenization for ML models, or fragment analysis in computational genomics and machine learning applications.
Defines the structure and implementation of service classes, enforcing the use of interfaces, ServiceImpl classes, DTOs for data transfer, and transactional management.
Diffusion-based molecular docking. Predict protein-ligand binding poses from PDB/SMILES, confidence scores, virtual screening, for structure-based drug design. Not for affinity prediction.
How agents discover and use skills. Use to understand skill invocation protocol.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience