Works with the AI Agents you already use
YARA Rule Generator
Automated YARA rule generation, linting, and scanning for malware detection and incident response.
$1
YARA Rule Generator
Example session with this skill installed
I have a malware sample in ./samples/malware.exe. Help me write a YARA rule for it that filters out strings found in /usr/bin and lints the final output.
- Read your context and instructions
- Compiled the yara rule generator
I have analyzed the sample and cross-referenced it against the goodware in /usr/bin. I extracted distinctive PDB paths and unique obfuscation strings while ensuring proper PE header anchoring and filesize constraints.
YARA Rule: Trojan_Win32_Generic_Loader
rule Trojan_Win32_Generic_Loader
{
meta:
description = "Detects generic loader variant characterized by specific PDB path and mutex strings"
author = "Security Ops"
date = "2023-10-27"
hash = "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
status = "experimental"
strings:
// PDB Path - High Score
$pdb = "C:\\Users\\Dev\\Documents\\Visual Studio 2019\\Projects\\Loader\\Release\\payload.pdb" ascii
// Obfuscated strings found in sample, not in goodware
$s1 = "Global\\{7A8D2F31-9E4B-4C2A-BD1F-52319A0C}" ascii wide
$s2 = "cmd.exe /c start /B \"\" \"C:\\Windows\\Temp\\" ascii wide
$s3 = "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36" ascii
// Encrypted configuration marker
$hex_marker = { 4D 5A 90 00 03 00 00 00 04 00 00 00 FF FF }
condition:
(uint16(0) == 0x5A4D) and
(filesize < 500KB) and
($pdb or 2 of ($s*)) and
$hex_marker
}
Next steps
- Run
python3 scripts/yara_lint.py rules/Trojan_Win32_Generic_Loader.yarto verify the rule against performance standards. - Execute
python3 scripts/yara_scan.py rules/ ./samples/ --json results.jsonto confirm the rule hits your target sample. - Test the rule against your full goodware repository to ensure zero false positives before deployment.
Connects securely to your tools. The creator never sees your data.
About this skill
Writing production-grade YARA rules is a balancing act between detection efficacy and performance-draining false positives. Manually extracting strings from malware samples while filtering out common goodware artifacts is slow and error-prone. This skill automates the signature development lifecycle, from initial string extraction to linting and scanning.
What it does
- Automated rule generation extracts ASCII and UTF-16LE strings from malware samples while excluding those found in a goodware corpus.
- Heuristic scoring prioritizes high-value indicators like PDB paths, mutexes, and unique format strings over common English words.
- Built-in linting catches syntax errors, unused strings, and performance bottlenecks without requiring a YARA installation.
- Quality enforcement flags risky patterns like unbounded regex, missing filesize bounds, and absent magic-byte anchors.
- Scan wrapping provides a structured interface for testing rules against local directories using
yara-python.
How it works
- Analyze samples by running the generator script against a directory of malicious files and a reference goodware set.
- Refine the output by reviewing the scored strings and selecting structural indicators for the rule condition.
- Run the linter to ensure the rule meets metadata standards and avoids performance-heavy regex or short-string matches.
- Execute test scans to verify detection across samples and confirm zero hits against a known-clean baseline.
Frameworks & tools
This skill uses Python for automation scripts and requires yara-python for scanning capabilities. It generates standard YARA rules compatible with version 3.x and 4.x engines.
Why this beats prompting it yourself
Generic AI prompts often produce rules that are too broad or lack the necessary filesize and uint16(0) anchors required for production performance. This skill enforces specific logic, like automated goodware filtering and nibble-count verification, that manual prompting typically ignores.
Use cases
- Generating signatures for a new malware family based on a small set of PE samples.
- Auditing a repository of legacy rules for performance risks and missing metadata.
- Rapidly creating webshell detection signatures for incident response triage.
- Testing local signature sets against system binaries to minimize false positive rates.
Known limitations
Scanning requires yara-python to be installed in the environment. The automated generator focuses on string-based signatures and does not perform deep behavioral or code-graph analysis.
Scanning requires yara-python. Automated generation focuses on strings (ASCII/UTF-16LE) and basic PE headers; it does not perform advanced behavioral or control-flow analysis.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before any payment.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 1 month ago
Requires