/cybersecurity-skills-zh:deploying-ransomware-canary-filesfrom cybersecurity-skills-zh
Deploys and monitors ransomware canary files using Python watchdog, triggering alerts on file access/modification/deletion via email, Slack, or syslog.
Ships in cybersecurity-skills-zh. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
不适用场景:不可替代终端保护、备份策略或网络分段。诱饵文件仅为检测层,并非预防机制。
pip install watchdog)创建具有真实文件名和内容的诱饵文件,以吸引勒索软件扫描器。文件名应使用 Passwords.xlsx、Financial_Report_2026.docx、backup_credentials.csv 等格式,内容为看似合理的虚假数据。将文件放置在勒索软件通常优先攻击的目录中:用户桌面、Documents 文件夹、网络共享根目录和备份路径。
使用 Python watchdog 库结合自定义 FileSystemEventHandler,监控诱饵文件路径。Handler 针对诱饵文件触发 on_modified、on_deleted、on_moved 和 on_created 事件。任何合法用户或进程都不应接触这些文件,因此任何交互都是勒索软件或未授权访问的高可信度指示器。
将文件系统监控器连接到多个告警渠道:通过 SMTP 发送邮件、发送 Slack Webhook POST、转发 Syslog 到 SIEM,以及写入本地日志文件。告警有效载荷中应包含触发事件类型、文件路径、时间戳和进程信息(如可获取)。
通过程序化方式修改、重命名和删除诱饵文件,模拟勒索软件行为,验证检测管道是否正常触发。测量告警响应时间,并验证所有配置渠道的告警投递情况。
| 术语 | 定义 |
|---|---|
| 诱饵文件(Canary File) | 放置在受监控目录中的诱骗文件,当被访问、修改或删除时触发告警 |
| Watchdog | Python 文件系统监控库,使用操作系统原生 API(Linux 的 inotify、macOS 的 FSEvents、Windows 的 ReadDirectoryChangesW) |
| 蜜罐文件(Honey File) | 诱饵文件的别名;用于吸引和检测恶意活动的虚假文档 |
| 熵值检测(Entropy Check) | 通过测量文件内容的随机性来检测加密行为(勒索软件加密后产生高熵值输出) |
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
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub killvxk/cybersecurity-skills-zh --plugin cybersecurity-skills-zh735 skills in this plugin
/acquiring-disk-image-with-dd-and-dcfldd使用 dd 和 dcfldd 创建取证级逐位磁盘镜像,通过哈希验证保持证据完整性。/analyzing-active-directory-acl-abuse使用 ldap3 检测 Active Directory 中危险的 ACL 配置错误,识别 GenericAll、WriteDACL 和 WriteOwner 等滥用路径/analyzing-android-malware-with-apktool使用 apktool 进行反编译、jadx 恢复 Java 源码、androguard 进行权限分析,对 Android APK 恶意软件样本执行静态分析,包括清单检查和可疑 API 调用检测。Other plugins' skills for the same job