Getting it into your agent
It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.
git clone --depth 1 https://github.com/akashrpatil/awesome-offensive-security-skillsnpx agentmods add skills/akashrpatil/awesome-offensive-security-skills/yara-rule-writing-malwareWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/akashrpatil/awesome-offensive-security-skills/yara-rule-writing-malware)<a href="https://agentmods.dev/skills/akashrpatil/awesome-offensive-security-skills/yara-rule-writing-malware"><img src="https://agentmods.dev/badge/skills/akashrpatil/awesome-offensive-security-skills/yara-rule-writing-malware/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/akashrpatil/awesome-offensive-security-skills/yara-rule-writing-malware"><img src="https://agentmods.dev/badge/skills/akashrpatil/awesome-offensive-security-skills/yara-rule-writing-malware.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00052 | $0.01183 |
| Opus 5 | $0.00026 | $0.00592 |
| Sonnet 5 | $0.00010 | $0.00237 |
| Haiku 4.5 | $0.00005 | $0.00118 |
Grade A, and why
yara-rule-writing-malware scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 9d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 153 lines — stays where its author put it; the contents beside it link to each section on GitHub.
YARA Rule Writing for Malware Detection
When to Use
- When performing incident response and you need to scan the entire environment for indicators of compromise (IoCs) related to a specific malware family.
- After extracting unique string patterns, mutexes, paths, or code blocks from a malware sample during static/dynamic analysis.
Prerequisites
- Authorized scope and rules of engagement for the target environment
- Appropriate tools installed on the attack/analysis platform
- Understanding of the target technology stack and architecture
- Documentation template ready for findings and evidence capture
Workflow
Phase 1: Understanding Basic YARA Structure
# Concept: Rule syntax rule Basic_Ransomware_Detection {
meta:
description = "Detects generic ransomware strings"
author = "CyberSkills"
date = "2024-05-10"
strings:
$s1 = "Your files have been encrypted" ascii wide nocase
$s2 = "比特币" // Bitcoin in Chinese (UTF-8)
$s3 = "vssadmin.exe Delete Shadows /All /Quiet" ascii wide
condition:
2 of them
}
Phase 2: Utilizing Hexadecimal Signatures
# rule Emotet_Hex_Pattern {
meta:
description = "Detects Emotet unpacking loop pattern"
strings:
// 8B 45 ?? 03 45 ?? 50 FF 15
$hex_pattern = { 8B 45 ?? 03 45 ?? 50 FF 15 [4] }
condition:
$hex_pattern
}
Phase 3: Leveraging the PE Module (Windows Executables)
# import module import "pe"
rule Suspicious_Document_Icon {
meta:
description = "Executable disguised as PDF/Word doc"
condition:
uint16(0) == 0x5a4d and // MZ header
pe.number_of_resources > 0 and
(
pe.version_info["OriginalFilename"] contains ".pdf" or
pe.version_info["OriginalFilename"] contains ".docx"
)
}
Phase 4: Validating and Executing the Scan
# yara -r my_rules.yar /path/to/suspicious/files/
What ships with it
2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 9d ago First seen · 153 lines · 52 tokens per session scan A 9e9190541eb1
yara-rule-writing-malware is a skill published in the GitHub repository akashrpatil/awesome-offensive-security-skills (5 stars, last pushed 4mo ago), licensed Apache-2.0. It adds 52 tokens to every session and 1,183 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.
Other skills, from other repositories
writing-yara-rules-from-reversed-code
Turns reverse-engineering findings into durable YARA detections: selecting stable code constructs and constants over volatile strings, extracting opcode/byte patterns with wildcards, and validating rules for low false positives. Activates for requests to write a YARA rule from reversed code, create a detection…
scanning-samples-with-yara
Uses YARA to classify and triage samples at scale: applying rule sets, reading matches and string offsets, tuning for false positives, and organizing rules for malware family identification. Activates for requests to scan files with YARA, apply YARA rules, or classify samples by signature.
analyzing-malicious-pdf-with-peepdf
Perform static analysis of malicious PDF documents using peepdf, pdfid, and pdf-parser to extract embedded JavaScript, shellcode, and suspicious objects. Use when triaging a suspicious PDF attachment from a phishing email, analyzing a PDF-based exploit document, or building detection signatures for weaponized PDF…
analyzing-elf-binaries-on-linux
Statically analyzes Linux ELF malware: ELF header and sections, dynamic symbols and imports, segment permissions, embedded strings, and packing indicators to infer capability without execution. Activates for requests to analyze an ELF binary, Linux malware, or shared object.
analyzing-mach-o-binaries-on-macos
Statically analyzes macOS Mach-O malware: parsing the header and load commands, handling fat/universal binaries, reading linked dylibs and entitlements, and checking code signatures to infer capability and trust. Activates for requests to analyze a Mach-O binary, inspect macOS malware, or parse load commands and…
analyzing-malicious-lnk-files
Analyzes weaponized Windows shortcut (.lnk) files: parsing the shell link structure for the target command, arguments, icon, and working directory, and recovering hidden PowerShell/cmd payloads and embedded content used in phishing. Activates for requests to analyze a malicious LNK, parse a shortcut file, or extract a…