deploying-ransomware-canary-files
它能做什么
这个工具会在电脑的关键位置放置一些诱饵文件。如果有任何程序试图读取、修改或删除这些文件,它会立即向你发出警报,提示可能遭遇了勒索软件攻击。
适用场景
- ✓在勒索软件损坏你的重要文件之前及时发现它。
- ✓监控共享文件夹或备份。
- ✓在无法安装其他安全程序的系统上,作为额外的预警。
技能链接
https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/deploying-ransomware-canary-files/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“在我的文件服务器上设置诱饵文件警报系统。”
每周 5 个新技能,1 分钟读完。
工作原理
这个工具会把“诱饵”文件放在勒索软件通常会攻击的位置,并使用一个名为 watchdog 的程序来监视这些文件。一旦文件出现任何异常,你就会通过电子邮件或消息收到提醒。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
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
| Term | Definition |
|---|---|
| Canary File | A decoy file placed in a monitored directory that triggers an alert when accessed, modified, or deleted |
| Watchdog | Python library that monitors filesystem events using OS-native APIs (inotify on Linux, FSEvents on macOS, ReadDirectoryChangesW on Windows) |
| Honey File | Synonym for canary file; a fake document designed to attract and detect malicious activity |
| Entropy Check | Measuring 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
常见问题
什么是“金丝雀”或“诱饵”文件?
这些是有意创建的假文件,用来吸引勒索软件等恶意软件的注意。如果有程序访问了它们,就很可能说明出了问题。
这个工具能阻止勒索软件攻击吗?
不能。这个工具用于早期检测,而不是预防。它就像火灾报警器,会提醒你,但不能直接灭火。
使用这个工具需要会编程吗?
工具本身是一个程序,但设置它很简单。你只需要按照设置说明操作,不需要自己写代码。
详情
作者的原始描述
Deploys 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
热度
- GitHub 星标
- 35k
- 排名
- #7786
- 许可证
- Apache-2.0
- 更新时间
- 2026/8/31
评论
- …
同一仓库的更多技能
abusing-dpapi-for-credential-access
35k为你的 AI 智能体提供针对特定任务的现成指令,让它完成得更好、更快。
abusing-shadow-credentials-for-privesc
35k教你的 AI 智能体写出清晰、结构良好的文本。
achieving-cmmc-level-2-compliance
35k帮助你的智能体搭建符合 CMMC Level 2 合规要求的环境。它会落实安全要求,并管理必要的文档。
acquiring-disk-image-with-dd-and-dcfldd
35k帮助你的智能体创建硬盘的精确副本。这能确保调查过程中信息不丢失、不被篡改。