meltedinhex/analyst-ai-pack / skills/analyzing-wiper-malware
analyzing-wiper-malware
FlaggedAnalyzes destructive wiper malware by identifying raw-disk and MBR/VBR overwrite primitives, boot-record tampering, mass-deletion and backup-destruction behavior, and distinguishing wipers from ransomware. Activates for requests to analyze a wiper, identify destructive disk-overwrite behavior, or tell a wiper apart from ransomware.
| File | Kind | Size |
|---|---|---|
| LICENSE | other | 340 B |
| SKILL.md | skill md | 2.8 KB |
| references/api-reference.md | markdown | 1.4 KB |
| scripts/analyst.py | script | 3.0 KB |
scripts/analyst.py
View on GitHub#!/usr/bin/env python3
"""Scan a sample for destructive wiper primitives and classify wiper vs ransomware.
Detects raw-disk/MBR overwrite primitives, backup/recovery destruction commands, and weighs them
against ransomware (encryption/extortion) indicators to classify intent. Reads bytes statically;
executes nothing.
"""
from __future__ import annotations
import argparse
import json
import re
import sys
from pathlib import Path
ASCII_RE = re.compile(rb"[\x20-\x7e]{4,}")
UTF16_RE = re.compile(rb"(?:[\x20-\x7e]\x00){4,}")
RAW_DISK = ["\\\\.\\physicaldrive", "\\\\.\\c:", "deviceiocontrol", "ioctl_disk",
"createfilemapping", "setfilepointer", "\\device\\harddisk"]
BOOT_TAMPER = ["this program cannot be run", "mbr", "\\\\.\\physicaldrive0", "bootmgr is missing"]
RECOVERY_DENIAL = ["vssadmin delete shadows", "vssadmin.exe delete", "wbadmin delete",
"bcdedit /set", "recoveryenabled no", "wevtutil cl", "delete catalog",
"shadowcopy delete"]
MASS_DELETE = ["deletefile", "removedirectory", "shfileoperation", "writefile", "f0 fill",
"overwrite"]
RANSOM_INDICATORS = ["cryptencrypt", "cryptdecrypt", "bcryptencrypt", "readme.txt", "decrypt",
".onion", "bitcoin", "ransom", "your files have been encrypted",
"aes", "rsa public key"]
def _strings(data: bytes) -> str:
parts = [m.decode("ascii", "ignore") for m in ASCII_RE.findall(data)]
parts += [m.decode("utf-16-le", "ignore") for m in UTF16_RE.findall(data)]
return "\n".join(parts).lower()
def scan(path: str) -> dict:
blob = _strings(Path(path).read_bytes())
raw = sorted({r for r in RAW_DISK if r in blob})
boot = sorted({b for b in BOOT_TAMPER if b in blob})
recovery = sorted({r for r in RECOVERY_DENIAL if r in blob})
deletion = sorted({d for d in MASS_DELETE if d in blob})
ransom = sorted({r for r in RANSOM_INDICATORS if r in blob})
destructive_score = len(raw) * 2 + len(boot) * 2 + len(recovery) + len(deletion)
ransom_score = len(ransom)
if destructive_score >= 3 and ransom_score <= 1:
classification = "likely_wiper"
elif ransom_score >= 3:
classification = "likely_ransomware"
elif destructive_score and ransom_score:
classification = "destructive_with_ransom_facade"
else:
classification = "inconclusive"
return {
"raw_disk_primitives": raw,
"boot_record_tampering": boot,
"recovery_denial": recovery,
"mass_deletion": deletion,
"ransomware_indicators": ransom,
"destructive_score": destructive_score,
"ransomware_score": ransom_score,
"classification": classification,
}
def main(argv: list[str] | None = None) -> int:
parser = argparse.ArgumentParser(description="Analyze wiper malware")
sub = parser.add_subparsers(dest="cmd", required=True)
p = sub.add_parser("scan")
p.add_argument("file")
args = parser.parse_args(argv)
print(json.dumps(scan(args.file), indent=2))
return 0
if __name__ == "__main__":
sys.exit(main())
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 |