An LLM Agent Skill that orchestrates VirusTotal, yarGen, and YARA rule expertise into a unified detection engineering pipeline.
Hash β VirusTotal β Download Sample β yarGen β Generate Rule β YARA Expert β Improve Rule β Deliver
This skill combines three existing skills into one seamless workflow:
- VirusTotal API - Download samples by hash, get threat context
- yarGen - Generate YARA rules from malware samples
- YARA Rule Expert - Post-process and optimize generated rules
# Full pipeline
detection-engineer.sh generate-from-hash d41d8cd98f00b204e9800998ecf8427e \
--author "Florian Roth" \
--output MAL_Backdoor_Feb25.yar# 1. Download from VirusTotal
detection-engineer.sh download d41d8cd98f00b204e9800998ecf8427e \
--save-sample /tmp/malware.bin
# 2. Generate YARA rule
detection-engineer.sh generate /tmp/malware.bin \
--author "Security Team" \
--output draft.yar
# 3. Review with YARA expert
detection-engineer.sh review draft.yarAll three component skills must be installed:
# 1. VirusTotal API skill
ls ~/.openclaw/skills/virustotal-api/SKILL.md
# 2. yarGen skill
ls ~/.openclaw/skills/yargen/SKILL.md
# 3. YARA Rule skill (packaged or directory)
ls ~/.openclaw/skills/yara-skill.skill
# OR
ls ~/.openclaw/skills/yara-rule-skill/SKILL.md# Clone to skills folder
git clone https://github.com/YOURORG/detection-engineering-skill.git \
~/.openclaw/skills/detection-engineering
# Or copy from local workspace
cp -r ~/clawd/skills/detection-engineering ~/.openclaw/skills/# Set API key
echo "your-vt-api-key" > ~/.virustotal/apikey# Basic usage
detection-engineer.sh generate-from-hash <hash>
# With all options
detection-engineer.sh generate-from-hash d41d8cd98f00b204e9800998ecf8427e \
--author "Your Name" \
--reference "https://threat-report.example.com" \
--output rule.yar \
--save-sample /samples/malware.bin \
--verbose| Option | Description |
|---|---|
-a, --author <name> |
Rule author name |
-o, --output <file> |
Save rule to file (default: stdout) |
-r, --reference <ref> |
Reference URL or report ID |
--no-vt-context |
Skip VirusTotal metadata enrichment |
--skip-post-process |
Skip YARA expert review |
--save-sample <path> |
Keep downloaded sample |
-v, --verbose |
Show detailed progress |
# Process multiple hashes
for hash in $(cat hashes.txt); do
detection-engineer.sh generate-from-hash $hash \
--author "SOC Team" \
--output "rules/${hash:0:16}.yar"
doneThe final YARA rule includes enrichment from all three stages:
rule MAL_APT_CampaignX_Backdoor_Feb25 {
meta:
description = "Detection for Campaign X backdoor"
author = "Security Team"
date = "2025-02-07"
hash = "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
reference = "https://threat-report.example.com/campaign-x"
vt_detection = "45/72"
vt_tags = "backdoor,apt,trojan"
strings:
$x1 = "unique_campaign_string" fullword ascii
$s1 = "suspicious_api_call" fullword ascii
condition:
uint16(0) == 0x5a4d and
filesize < 500KB and
(1 of ($x*) or 2 of ($s*))
}βββββββββββββββββββ
β User provides β
β hash β
ββββββββββ¬βββββββββ
βΌ
βββββββββββββββββββ βββββββββββββββββββ
β VirusTotal API ββββββΆβ Download β
β (vt-file-*) β β sample β
βββββββββββββββββββ ββββββββββ¬βββββββββ
βΌ
βββββββββββββββββββ
β yarGen Skill β
β (yargen-util β
β submit) β
ββββββββββ¬βββββββββ
βΌ
βββββββββββββββββββ
β YARA Rule β
β Expert β
β (review/ β
β optimize) β
ββββββββββ¬βββββββββ
βΌ
βββββββββββββββββββ
β Final YARA β
β Rule β
βββββββββββββββββββ
- Sample Handling: Downloaded samples are temporary by default
- API Keys: VT API key is read from secure location, never exposed
- Retention: Samples auto-deleted unless
--save-samplespecified - Rule Sharing: Generated rules should be reviewed before distribution
# Generate rules for all hashes in MISP event
misp_event_id=12345
misp-dump-hashes $misp_event_id | \
xargs -I {} detection-engineer.sh generate-from-hash {} \
-o "misp-${misp_event_id}/{}.yar"# Auto-generate rules for IOCs in SIEM alert
alert_id=$1
siem-get-iocs $alert_id | \
detection-engineer.sh generate-from-hash {} \
--reference "SIEM Alert $alert_id"- Full YARA expert integration (currently placeholder)
- Support for URL-based rules (not just file hashes)
- Batch processing with parallelization
- Automatic rule testing against sample corpus
- Integration with threat intel platforms (MISP, OpenCTI)
- Configuration file support
See component skills for their respective licenses:
- VirusTotal API - See VirusTotal terms
- yarGen - See yarGen-Go repository
- YARA Rule Skill - See YARAHQ/yara-rule-skill
This skill is a meta-skill combining the work of:
- Florian Roth (@cyb3rops) - yarGen and YARA expertise
- YARA HQ - YARA rule skill and community
- VirusTotal - Threat intelligence platform