New to Claude Skills? Learn how to install them →

mukul975 on GitHub

Ransomware Canary Files

Free

Early-warning detection for ransomware attacks.

Get this skill

Free · Opens the source repo

What Ransomware Canary Files does

The Ransomware Canary Files skill enables proactive monitoring and detection of ransomware activity using decoy files strategically placed in high-value target directories. By deploying canary files that mimic sensitive data, such as financial records and credentials, this skill leverages Python's watchdog library to monitor file system events. When any unauthorized access or modification occurs, alerts are triggered via email, Slack, or syslog, providing an early warning before ransomware can encrypt critical business data.

This skill is particularly useful for organizations looking to enhance their cybersecurity posture without relying solely on traditional endpoint detection and response (EDR) solutions. It is designed for file servers, NAS devices, and endpoints where deploying agents may not be feasible. By simulating canary file interactions, teams can also test their incident response procedures, ensuring they are prepared for potential ransomware threats.

To implement this skill, users need to generate realistic canary files and deploy a filesystem monitor that tracks any interactions with these files. The configuration process includes setting up alert channels to ensure timely notifications. The skill is suitable for IT security professionals, system administrators, and cybersecurity teams aiming to bolster their defenses against ransomware attacks.

However, it is important to note that while this skill provides a detection layer, it should not replace comprehensive endpoint protection, backup strategies, or network segmentation. Canary files serve as an additional measure to identify potential threats early, allowing for a swift response to mitigate damage.

When to use it

Use this skill when you need proactive ransomware detection on file servers or endpoints, especially where traditional EDR solutions cannot be deployed.

When not to use it

This is not a substitute for comprehensive endpoint protection or backup strategies; it is purely a detection mechanism.

What you can build with it

Proactive Ransomware Monitoring

Deploy canary files on file servers to detect ransomware attempts before they can encrypt sensitive data.

Incident Response Testing

Simulate ransomware activity to test and validate your incident response procedures using canary file alerts.

Enhancing Cybersecurity Measures

Supplement existing security measures with lightweight monitoring of critical directories where agents cannot be deployed.

How to install Ransomware Canary Files

View source

1. Install with the skills CLI

npx skills add mukul975/anthropic-cybersecurity-skills/deploying-ransomware-canary-files --agent claude-code

2. Or install it manually

Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.

Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs

Inside SKILL.md

Written by mukul975

Deploying Ransomware Canary Files

When to Use

  • Deploying proactive ransomware detection on file servers, NAS devices, or endpoint systems
  • Building an early-warning system that detects ransomware before it encrypts business-critical data
  • Supplementing EDR solutions with lightweight canary file monitoring on systems where agents cannot be deployed
  • Testing ransomware incident response procedures by simulating canary file triggers
  • Monitoring shared drives, home directories, and backup volumes for unauthorized file operations

Do not use as a replacement for endpoint protection, backup strategy, or network segmentation. Canary files are a detection layer, not a prevention mechanism.

Prerequisites

  • Python 3.8+ with pip
  • watchdog library (pip install watchdog)
  • Write access to directories where canary files will be placed
  • SMTP server credentials or Slack webhook URL for alerting
  • Administrative access for placing canaries in system directories

Workflow

Step 1: Generate Canary Files

Create decoy files with realistic names and content that attract ransomware scanners. Files should have names like Passwords.xlsx, Financial_Report_2026.docx, backup_credentials.csv and contain plausible-looking but fake data. Place them in directories ransomware typically targets first: user desktops, Documents folders, network share roots, and backup paths.

Step 2: Deploy Filesystem Monitor

Use Python's watchdog library with a custom FileSystemEventHandler that watches canary file paths. The handler triggers on on_modified, on_deleted, on_moved, and on_created events for canary files. Any legitimate user or process should never touch these files, so any interaction is a high-confidence indicator of ransomware or unauthorized access.

Step 3: Configure Alert Pipeline

Wire the filesystem monitor to multiple alert channels: email via SMTP, Slack webhook POST, syslog forwarding to SIEM, and local log file. Include the triggering event type, file path, timestamp, and process information (when available) in alert payloads.

Step 4: Validate and Test

Simulate ransomware behavior by programmatically modifying, renaming, and deleting canary files to verify the detection pipeline fires correctly. Measure time-to-alert and validate alert delivery across all configured channels.

Key Concepts

TermDefinition
Canary FileA decoy file placed in a monitored directory that triggers an alert when accessed, modified, or deleted
WatchdogPython library that monitors filesystem events using OS-native APIs (inotify on Linux, FSEvents on macOS, ReadDirectoryChangesW on Windows)
Honey FileSynonym for canary file; a fake document designed to attract and detect malicious activity
Entropy CheckMeasuring randomness in file content to detect encryption (ransomware produces high-entropy output)

Tools & Systems

  • watchdog: Python filesystem monitoring library using OS-native event APIs
  • smtplib: Python standard library for SMTP email alerting
  • requests: HTTP library for Slack webhook integration
  • hashlib: SHA-256 hashing for canary file integrity verification
  • psutil: Process information gathering when canary file access is detected

Output Format

RANSOMWARE CANARY ALERT
========================
Timestamp: 2026-03-11T14:23:07Z
Event: FILE_MODIFIED
Canary File: /srv/shares/finance/Passwords.xlsx
Directory: /srv/shares/finance
SHA-256 Before: a3f2...8b4c
SHA-256 After: 7e91...2d3f
Alert Channels: [email, slack, syslog]
Action: Investigate immediately - potential ransomware activity

Frequently asked questions about Ransomware Canary Files

Similar skills