Skip to content

meltedinhex/analyst-ai-pack / skills/scanning-samples-with-yara

scanning-samples-with-yara

Verified

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.

FileKindSize
LICENSEother340 B
SKILL.mdskill md3.2 KB
references/api-reference.mdmarkdown1.2 KB
scripts/analyst.pyscript2.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
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: 198kUpdated Claude CodeCodexVerifiedInstall
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: 194kUpdated Claude CodeCodexVerifiedInstall
ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report.Stars: 194kUpdated Claude CodeCodexVerifiedInstall
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: 194kUpdated Claude CodeCodexVerifiedInstall