meltedinhex/analyst-ai-pack / skills/scanning-samples-with-yara
scanning-samples-with-yara
VerifiedUses 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.
| File | Kind | Size |
|---|---|---|
| LICENSE | other | 340 B |
| SKILL.md | skill md | 3.2 KB |
| references/api-reference.md | markdown | 1.2 KB |
| scripts/analyst.py | script | 2.6 KB |
references/api-reference.md
View on GitHub# API Reference: Scanning Samples with YARA
## Overview
`scripts/analyst.py` compiles a YARA rule file or directory and scans a file or directory,
reporting matched rules, tags, and matched-string offsets. A `--summary` mode ranks files
with matches for triage.
## Dependencies
| Package | Version | Purpose |
|---------|---------|---------|
| yara-python | >= 4.3 | Compile and match YARA rules |
## External tools
| Tool | Purpose |
|------|---------|
| yara (CLI) | Cross-check matches outside Python |
## Core functions
### `compile_rules(rules_path)`
Compiles a single rule file, or all `.yar`/`.yara` files under a directory (namespaced by
filename stem).
### `scan_file(rules, filepath)`
Returns matched rules with tags and per-string offsets for one file.
### `scan_path(rules_path, target, recursive)`
Scans a file or directory (optionally recursive) and returns per-file results.
## Usage
```bash
pip install yara-python
python scripts/analyst.py rules/ sample.bin
python scripts/analyst.py rules/ ./samples --recursive --summary
```
## Sources
- YARA documentation — https://yara.readthedocs.io/
- yara-python — https://github.com/VirusTotal/yara-python
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack." | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |