SSZcreate/Pentab_server / .agents/skills/cybersecurity/skills/deploying-ransomware-canary-files
deploying-ransomware-canary-files
VerifiedDeploys and monitors ransomware canary files using Python's watchdog library, placing decoy files mimicking high-value targets (financial records, credentials, database exports) where ransomware enumerates first, and alerting via email, Slack, or syslog on any read/modify/rename/delete. Use for early-warning ransomware detection on file servers, NAS, or endpoints, or to supplement EDR where agents can't be deployed.
| File | Kind | Size |
|---|---|---|
| LICENSE | other | 11.0 KB |
| SKILL.md | skill md | 4.7 KB |
| references/api-reference.md | markdown | 2.9 KB |
| scripts/agent.py | script | 20.8 KB |
references/api-reference.md
View on GitHub# API Reference: Deploying Ransomware Canary Files
## Canary File Deployment
| Function | Parameters | Returns |
|----------|-----------|---------|
| `deploy_canary_files(target_dirs, custom_files)` | List of directories, optional custom file dict | Manifest with deployed file paths and hashes |
| `compute_sha256(filepath)` | File path string | SHA-256 hex digest |
| `compute_entropy(filepath)` | File path string | Shannon entropy float (0-8) |
## Monitoring Functions
| Function | Parameters | Returns |
|----------|-----------|---------|
| `start_monitoring(manifest_path, config)` | Path to manifest JSON, alert config dict | Blocks until interrupted |
| `verify_canary_integrity(manifest_path)` | Path to manifest JSON | Dict with intact/modified/missing counts |
| `simulate_ransomware_test(manifest_path)` | Path to manifest JSON | List of test results |
## CanaryFileHandler Events
| Event | Handler Method | Trigger |
|-------|---------------|---------|
| File modified | `on_modified(event)` | Content change detected |
| File deleted | `on_deleted(event)` | Canary file removed |
| File renamed | `on_moved(event)` | Canary file renamed or moved |
| New file created | `on_created(event)` | Ransom note detection in monitored dirs |
## Alert Channels
| Channel | Function | Required Config |
|---------|----------|-----------------|
| Slack | `send_slack_alert(data, webhook_url)` | `slack_webhook` URL |
| Email | `send_email_alert(data, host, port, sender, recipients)` | SMTP server details |
| Syslog | `send_syslog_alert(data, server, port)` | Syslog server address |
| File | Automatic | Writes to `canary_alerts.jsonl` |
## Ransomware Extension Detection
| Extensions Monitored |
|---------------------|
| `.encrypted`, `.locked`, `.lockbit`, `.crypt`, `.enc` |
| `.ransom`, `.pay`, `.aes`, `.rsa`, `.cry` |
| `.ryk`, `.revil`, `.conti`, `.hive`, `.black`, `.basta` |
## CLI Usage
```bash
# Deploy canary files
python agent.py --action deploy --dirs /srv/shares /home/admin/Documents
# Monitor canary files with Slack alerts
python agent.py --action monitor --slack-webhook https://hooks.slack.com/...
# Verify canary file integrity
python agent.py --action verify
# Test detection pipeline
python agent.py --action test
```
## Python Libraries
| Library | Version | Purpose |
|---------|---------|---------|
| `watchdog` | >=3.0 | Filesystem event monitoring |
| `requests` | >=2.28 | Slack webhook integration |
| `psutil` | >=5.9 | Process information gathering |
| `hashlib` | stdlib | SHA-256 file hashing |
| `smtplib` | stdlib | SMTP email alerts |
## References
- Elastic Security Labs: Ransomware Canary Files: https://www.elastic.co/security-labs/ransomware-in-the-honeypot-how-we-capture-keys
- Huntress Ransomware Canaries: https://support.huntress.io/hc/en-us/articles/4404005167763
- Python Watchdog Documentation: https://python-watchdog.readthedocs.io/
- CISA #StopRansomware Guide: https://www.cisa.gov/stopransomware/ransomware-guide
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| writing-skillsobra/superpowersUse when creating new skills, editing existing skills, or verifying skills work before deployment | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| xlsxanthropics/skillsUse this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .xltx, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like "the xlsx in my downloads") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved. | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| shipping-and-launchaddyosmani/agent-skillsPrepares production launches. Use when preparing to deploy to production, or when asking what needs to be in place before shipping. Use when you need a pre-launch checklist, when setting up monitoring, when planning a staged rollout, or when you need a rollback strategy. | Stars: 119k | Updated | Claude CodeCodex | Verified | Install |
| childhoodthedotmack/claude-memBabysit a shipped release after merge, publication, or deployment. Verify published packages, production behavior, installed plugins, and late CI or user reports until the observation window is clean; use babysit for PR readiness before release. | Stars: 118k | Updated | Claude CodeCodex | Verified | Install |