implementing-honeypot-for-ransomware-detection

部署诱饵文件、蜜罐共享和诱骗系统,在最早阶段检测勒索软件活动。配置嵌入 战略文件位置的金丝雀令牌,在勒索软件尝试加密时触发告警;使用模拟高价值 目标的蜜罐网络共享;部署 Thinkst Canary 设备进行全面的基于欺骗的检测。

9 stars

Best use case

implementing-honeypot-for-ransomware-detection is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

部署诱饵文件、蜜罐共享和诱骗系统,在最早阶段检测勒索软件活动。配置嵌入 战略文件位置的金丝雀令牌,在勒索软件尝试加密时触发告警;使用模拟高价值 目标的蜜罐网络共享;部署 Thinkst Canary 设备进行全面的基于欺骗的检测。

Teams using implementing-honeypot-for-ransomware-detection should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/implementing-honeypot-for-ransomware-detection/SKILL.md --create-dirs "https://raw.githubusercontent.com/killvxk/cybersecurity-skills-zh/main/skills/implementing-honeypot-for-ransomware-detection/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/implementing-honeypot-for-ransomware-detection/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How implementing-honeypot-for-ransomware-detection Compares

Feature / Agentimplementing-honeypot-for-ransomware-detectionStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

部署诱饵文件、蜜罐共享和诱骗系统,在最早阶段检测勒索软件活动。配置嵌入 战略文件位置的金丝雀令牌,在勒索软件尝试加密时触发告警;使用模拟高价值 目标的蜜罐网络共享;部署 Thinkst Canary 设备进行全面的基于欺骗的检测。

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# 为勒索软件检测实施蜜罐

## 使用场景

- 使用诱饵文件为勒索软件加密尝试部署早期预警检测
- 创建检测横向移动和加密前数据暂存的蜜罐文件共享
- 用具有近乎零误报率的欺骗层告警补充 EDR 和 SIEM 检测
- 通过在文件修改行为上触发告警,检测规避基于签名检测的勒索软件变种
- 使用受控加密工具测试,验证勒索软件检测能力是否有效

**不要**将其用作唯一的勒索软件检测机制。蜜罐是高置信度的补充层,而非 EDR、网络监控和备份保护的替代品。

## 前置条件

- 可部署诱饵文件的文件服务器或 NAS 基础设施
- Windows 文件服务器资源管理器(FSRM)或同等文件活动监控工具
- Thinkst Canary 或类似欺骗平台(可选,用于高级部署)
- 用于集中蜜罐告警的 SIEM 平台
- 在文件共享中部署诱饵文件的管理员权限
- 用于蜜罐系统的网络段(如果部署完整蜜罐服务器)

## 工作流程

### 步骤一:在文件共享中部署诱饵文件

在勒索软件加密过程中会遇到的战略位置放置诱饵文件:

```powershell
# 在所有文件共享中部署诱饵文件
# 文件命名使其在字母顺序和目录顺序中靠前出现
# 勒索软件通常按字母顺序或目录遍历顺序加密

$shares = @("\\fileserver01\finance", "\\fileserver01\hr", "\\fileserver01\engineering")
$canaryNames = @(
    "!_IMPORTANT_DO_NOT_DELETE.docx",
    "000_Budget_2026_FINAL.xlsx",
    "_Confidential_Employee_Records.pdf",
    "AAAA_Quarterly_Report.docx"
)

foreach ($share in $shares) {
    foreach ($name in $canaryNames) {
        $targetPath = Join-Path $share $name
        # 创建看起来合法的诱饵文件内容
        # 文件包含访问时触发的唯一令牌
        $content = "This document contains confidential financial data.`n"
        $content += "Q4 2025 Revenue: $42.3M | Q1 2026 Forecast: $45.1M`n"
        $content += "Prepared by: Finance Department`n"
        Set-Content -Path $targetPath -Value $content
        # 将文件设置为隐藏系统文件,避免用户交互
        $file = Get-Item $targetPath
        $file.Attributes = [System.IO.FileAttributes]::Hidden
    }
}

# 同样在子目录中部署(勒索软件递归遍历)
$subDirs = Get-ChildItem -Path "\\fileserver01\finance" -Directory -Recurse | Select-Object -First 20
foreach ($dir in $subDirs) {
    $canaryPath = Join-Path $dir.FullName "!_Budget_Summary.xlsx"
    Set-Content -Path $canaryPath -Value "Canary file for ransomware detection"
    (Get-Item $canaryPath).Attributes = [System.IO.FileAttributes]::Hidden
}
```

### 步骤二:为诱饵文件配置文件完整性监控

**Windows FSRM 方式:**

```powershell
# 配置 FSRM 监控勒索软件文件扩展名和诱饵文件修改

Install-WindowsFeature -Name FS-Resource-Manager -IncludeManagementTools

# 为已知勒索软件扩展名创建文件筛选器
$ransomExtensions = @(
    "*.encrypted", "*.locked", "*.crypto", "*.crypt",
    "*.locky", "*.cerber", "*.zepto", "*.thor",
    "*.aesir", "*.zzzzz", "*.wallet", "*.onion",
    "*.wncry", "*.wcry", "*.lockbit", "*.BlackCat",
    "*.ALPHV", "*.rhysida", "*.play"
)

# 为勒索软件扩展名创建文件组
New-FsrmFileGroup -Name "Ransomware_Extensions" -IncludePattern $ransomExtensions

# 创建文件筛选器模板
New-FsrmFileScreenTemplate -Name "Ransomware_Screen" `
    -IncludeGroup "Ransomware_Extensions" `
    -Active:$false  # 被动模式:告警但不阻止

# 应用至所有受监控的共享
$monitoredPaths = @("D:\Shares\Finance", "D:\Shares\HR", "D:\Shares\Engineering")
foreach ($path in $monitoredPaths) {
    New-FsrmFileScreen -Path $path -Template "Ransomware_Screen"
}
```

**使用 PowerShell FileSystemWatcher 进行诱饵文件修改监控:**

```powershell
# 实时诱饵文件监控服务
$canaryPaths = @(
    "D:\Shares\Finance\!_IMPORTANT_DO_NOT_DELETE.docx",
    "D:\Shares\HR\000_Budget_2026_FINAL.xlsx",
    "D:\Shares\Engineering\_Confidential_Employee_Records.pdf"
)

$watcher = New-Object System.IO.FileSystemWatcher
$watcher.Path = "D:\Shares"
$watcher.Filter = "*"
$watcher.IncludeSubdirectories = $true
$watcher.EnableRaisingEvents = $true

$action = {
    $path = $Event.SourceEventArgs.FullPath
    $changeType = $Event.SourceEventArgs.ChangeType
    $timestamp = $Event.TimeGenerated

    # 检查修改的文件是否是诱饵文件
    $isCanary = $false
    foreach ($canary in $canaryPaths) {
        if ($path -eq $canary) { $isCanary = $true; break }
    }

    if ($isCanary -or $changeType -eq "Renamed") {
        $alertMsg = "RANSOMWARE ALERT: Canary file modified! Path: $path | Change: $changeType | Time: $timestamp"
        # 记录到 Windows 事件日志
        Write-EventLog -LogName Application -Source "RansomwareCanary" `
            -EventID 9999 -EntryType Error -Message $alertMsg
        # 通过 syslog 发送 SIEM 告警
        # 触发自动化遏制
    }
}

Register-ObjectEvent $watcher "Changed" -Action $action
Register-ObjectEvent $watcher "Deleted" -Action $action
Register-ObjectEvent $watcher "Renamed" -Action $action
```

### 步骤三:部署蜜罐网络共享

创建看起来包含高价值数据的诱骗文件共享:

```powershell
# 在专用服务器上创建蜜罐共享
# 该服务器监控所有文件访问,对任何活动发出告警

New-Item -Path "D:\HoneypotShares\Executive_Compensation" -ItemType Directory
New-Item -Path "D:\HoneypotShares\M&A_Documents" -ItemType Directory
New-Item -Path "D:\HoneypotShares\Board_Meeting_Notes" -ItemType Directory
New-Item -Path "D:\HoneypotShares\Customer_Database_Exports" -ItemType Directory

# 以广泛读取权限共享(对攻击者有吸引力)
New-SmbShare -Name "Executive_Compensation" `
    -Path "D:\HoneypotShares\Executive_Compensation" `
    -FullAccess "DOMAIN\Domain Users" `
    -Description "Executive Compensation Files - Restricted"

# 填充看起来合法但实为虚假的文档
$docContent = @"
CONFIDENTIAL - Executive Compensation Summary
FY 2026 Base Salary and Bonus Structures
CEO: [REDACTED] | CFO: [REDACTED] | CTO: [REDACTED]
Total Compensation Package: See Appendix A
"@
Set-Content -Path "D:\HoneypotShares\Executive_Compensation\FY2026_Comp_Summary.txt" -Value $docContent

# 在蜜罐共享上启用详细审计日志
$acl = Get-Acl "D:\HoneypotShares"
$auditRule = New-Object System.Security.AccessControl.FileSystemAuditRule(
    "Everyone", "ReadAndExecute,Write,Delete", "ContainerInherit,ObjectInherit",
    "None", "Success,Failure"
)
$acl.AddAuditRule($auditRule)
Set-Acl "D:\HoneypotShares" $acl

# 通过 GPO 启用对象访问审计
auditpol /set /subcategory:"File System" /success:enable /failure:enable
```

### 步骤四:部署 Thinkst Canary 令牌

对于使用 Thinkst Canary 或免费 canarytokens.org 服务的组织:

```bash
# 通过 API 生成金丝雀令牌(Thinkst Canary)
# 这些令牌在文档被打开或 URL 被访问时触发告警

# Word 文档令牌
curl -X POST "https://CONSOLE.canary.tools/api/v1/canarytoken/create" \
  -d "auth_token=YOUR_API_TOKEN" \
  -d "memo=Finance_Share_Canary" \
  -d "kind=doc-msword" \
  -o /tmp/canary_budget_report.docx

# PDF 文档令牌
curl -X POST "https://CONSOLE.canary.tools/api/v1/canarytoken/create" \
  -d "auth_token=YOUR_API_TOKEN" \
  -d "memo=HR_Share_Canary" \
  -d "kind=pdf-acrobat-reader" \
  -o /tmp/canary_employee_handbook.pdf

# Windows 文件夹令牌(浏览文件夹时告警)
curl -X POST "https://CONSOLE.canary.tools/api/v1/canarytoken/create" \
  -d "auth_token=YOUR_API_TOKEN" \
  -d "memo=Executive_Folder_Browse" \
  -d "kind=windows-dir"

# 部署 Canary 设备(模拟文件服务器)
# 通过 Web 控制台配置,使其看起来像:
# - 带有 SMB 共享的 Windows 文件服务器
# - 包含看起来真实的目录
# - 任何访问都会触发带有源 IP 和活动详情的即时告警
```

### 步骤五:与 SIEM 和自动化响应集成

```python
# siem_integration.py - 将蜜罐告警转发到 SIEM 并触发遏制

import json
import requests
import logging
from datetime import datetime

SIEM_WEBHOOK = "https://siem.company.com/api/alerts"
NAC_API = "https://nac.company.com/api/v1/quarantine"
EDR_API = "https://edr.company.com/api/v1/isolate"

def send_ransomware_alert(source_ip: str, canary_path: str, action: str):
    """向 SIEM 发送高优先级告警并触发自动化遏制。"""
    alert = {
        "timestamp": datetime.utcnow().isoformat(),
        "severity": "CRITICAL",
        "category": "Ransomware - Canary File Triggered",
        "source_ip": source_ip,
        "canary_file": canary_path,
        "action_detected": action,
        "automated_response": "Host isolation initiated",
        "mitre_technique": "T1486 - Data Encrypted for Impact",
    }

    # 发送至 SIEM
    try:
        requests.post(SIEM_WEBHOOK, json=alert, timeout=5)
    except requests.RequestException as e:
        logging.error(f"SIEM alert failed: {e}")

    # 自动化遏制 - 通过 NAC 隔离主机
    try:
        requests.post(f"{NAC_API}/{source_ip}",
                      json={"action": "quarantine", "reason": "Ransomware canary triggered"},
                      timeout=5)
    except requests.RequestException as e:
        logging.error(f"NAC quarantine failed: {e}")

    # 自动化遏制 - 通过 EDR 隔离主机
    try:
        requests.post(EDR_API,
                      json={"ip": source_ip, "action": "isolate"},
                      timeout=5)
    except requests.RequestException as e:
        logging.error(f"EDR isolation failed: {e}")

    logging.critical(f"RANSOMWARE CANARY ALERT: {source_ip} modified {canary_path} ({action})")
```

## 核心概念

| 术语 | 定义 |
|------|------------|
| **诱饵文件** | 放置在战略位置的诱骗文件,当勒索软件修改、重命名或删除时触发告警 |
| **蜜罐共享** | 设计用于吸引攻击者的诱骗网络共享,任何访问都是可疑的并触发告警 |
| **金丝雀令牌** | 嵌入文档或 URL 中的可追踪令牌,被访问时回传报告,揭示访问者的 IP 和时间 |
| **FSRM** | 文件服务器资源管理器——监控文件操作并可筛选勒索软件扩展名的 Windows Server 角色 |
| **欺骗层** | 使用诱骗资产以近乎零误报率检测威胁的安全架构层 |
| **文件系统监视器** | 监控实时文件系统变化(创建、修改、删除、重命名)的系统服务 |

## 工具与系统

- **Thinkst Canary**:提供 Canary 设备(模拟服务器)和金丝雀令牌(可追踪文档)的商业欺骗平台
- **Canarytokens.org**:Thinkst 提供的免费服务,用于生成基本金丝雀令牌(Word 文档、PDF、URL、DNS)
- **OpenCanary**:模拟常见服务(SMB、RDP、SSH)并记录访问尝试的开源蜜罐守护进程
- **FSRM(文件服务器资源管理器)**:用于文件筛选、配额管理和勒索软件扩展名检测的 Windows Server 内置工具
- **Elastic Endpoint**:内部使用诱饵文件进行勒索软件保护,在修改诱饵文件时触发行为告警

## 常见场景

### 场景:通过诱饵文件早期检测 BlackByte 勒索软件

**背景**:一家零售公司在 200 个文件共享和 3 个蜜罐共享中部署了诱饵文件。周六凌晨 3:00,诱饵监控系统在 90 秒内连续生成 47 个告警,因为 12 个共享中的诱饵文件被快速修改。

**处置方法**:
1. 诱饵文件告警触发自动化遏制:源工作站(10.2.8.55)在 30 秒内通过 NAC 被隔离
2. SIEM 关联显示该工作站在 2 小时前有 PsExec 执行的 EDR 告警(被夜班 SOC 遗漏)
3. 来自另外 3 台工作站的额外诱饵告警表明勒索软件通过计划任务传播
4. IR 团队隔离受影响的 VLAN,防止其余 188 个文件共享被加密
5. 12 个受影响的共享在 4 小时内从不可变备份中恢复
6. 预计避免的损失:基于 95% 的共享得到保护,节省约 230 万美元的停机和恢复成本

**常见陷阱**:
- 仅在根目录放置诱饵文件,而勒索软件可能先针对子目录
- 使用明显的诱饵文件名,被复杂勒索软件识别并跳过
- 未端到端测试诱饵告警,在真实事件中发现告警未到达 SOC
- 在合法文件迁移或防病毒扫描期间产生过多诱饵告警,导致告警疲劳

## 输出格式

```
## 勒索软件蜜罐部署报告

**组织**:[名称]
**部署日期**:[日期]

### 诱饵文件部署
| 共享 | 部署文件数 | 命名规范 | 告警方式 |
|-------|---------------|-------------------|--------------|
| [共享路径] | [数量] | [模式] | [FSRM/Watcher/Token] |

### 蜜罐共享
| 共享名称 | 位置 | 表面内容 | 监控方式 |
|-----------|----------|-----------------|------------|
| [名称] | [服务器] | [描述] | [审计/Canary] |

### 告警集成
- SIEM:[已连接/未连接]
- 自动化遏制:[EDR 隔离/NAC 隔离/无]
- 告警 SLA:[预期响应时间]

### 测试结果
| 测试日期 | 测试类型 | 诱饵是否触发 | 是否收到告警 | 遏制是否执行 | 告警时间 |
|-----------|----------|-----------------|----------------|---------------------|---------------|
```

Related Skills

reverse-engineering-ransomware-encryption-routine

9
from killvxk/cybersecurity-skills-zh

对勒索软件加密例程进行逆向工程,以识别密码学算法、密钥生成缺陷,以及通过静态和动态分析挖掘潜在的解密机会。

recovering-from-ransomware-attack

9
from killvxk/cybersecurity-skills-zh

按照 NIST 和 CISA 框架执行结构化勒索软件事件恢复,包括环境隔离、取证证据保全、 干净基础设施重建、从已验证备份优先还原系统、凭据重置,以及针对再感染的验证。 涵盖 Active Directory 恢复、数据库还原和按依赖顺序重建应用栈。

performing-yara-rule-development-for-detection

9
from killvxk/cybersecurity-skills-zh

通过识别可执行文件中的唯一字节模式、字符串和行为指标,开发精准的 YARA 恶意软件检测规则,同时将误报率降至最低。

performing-steganography-detection

9
from killvxk/cybersecurity-skills-zh

使用隐写分析(Steganalysis)工具检测和提取嵌入在图像、音频及其他媒体文件中的隐藏数据,揭露隐蔽通信渠道。

performing-ransomware-tabletop-exercise

9
from killvxk/cybersecurity-skills-zh

规划并主持模拟勒索软件(Ransomware)事件的桌面推演,以测试组织的应急准备、决策能力和通信流程。基于当前勒索软件威胁行为者(LockBit、ALPHV/BlackCat、Cl0p)设计真实场景,涵盖双重勒索(Double Extortion)、备份销毁和法规通知要求等注入内容。依据 NIST CSF 和 CISA 指南评估参与者响应。适用于勒索软件桌面推演、事件响应演练或勒索软件应急准备演习等请求。

performing-ransomware-response

9
from killvxk/cybersecurity-skills-zh

执行结构化的勒索软件事件响应,从初始检测到遏制、取证分析、解密评估、恢复和事后加固。 处理勒索谈判考量、备份完整性验证和法规通知要求。适用于勒索软件响应、 勒索软件恢复、加密勒索软件、数据加密攻击、赎金支付决策或勒索软件遏制等请求场景。

performing-ransomware-incident-response

9
from killvxk/cybersecurity-skills-zh

执行结构化的勒索软件事件响应,包括遏制、解密评估、从备份恢复以及根除勒索软件持久化机制。

performing-lateral-movement-detection

9
from killvxk/cybersecurity-skills-zh

检测横向移动(Lateral Movement)技术,包括哈希传递(Pass-the-Hash)、PsExec、WMI 执行、 RDP 转移和基于 SMB 的传播,使用 SIEM 关联 Windows 事件日志、网络流数据和终端遥测, 映射到 MITRE ATT&CK 横向移动战术(TA0008)技术。

performing-dns-tunneling-detection

9
from killvxk/cybersecurity-skills-zh

通过计算 DNS 查询名称的香农熵(Shannon Entropy)、分析查询长度分布、检测 TXT 记录载荷以及 识别高子域名基数,检测 DNS 隧道(DNS Tunneling)攻击。使用 scapy 进行数据包捕获分析, 结合统计方法区分合法 DNS 流量和隐蔽信道。适用于数据泄露猎威场景。

performing-container-escape-detection

9
from killvxk/cybersecurity-skills-zh

通过分析命名空间配置、特权容器检查、危险能力分配和宿主机路径挂载,使用 kubernetes Python 客户端检测容器逃逸尝试。识别通过 cgroup 滥用的 CVE-2022-0492 类型逃逸。 适用于审计容器安全态势或调查逃逸尝试。

performing-adversary-in-the-middle-phishing-detection

9
from killvxk/cybersecurity-skills-zh

检测和响应中间人(AiTM)钓鱼攻击,这类攻击使用 EvilProxy、Evilginx 和 Tycoon 2FA 等反向代理工具包绕过 MFA 并窃取会话令牌。

investigating-ransomware-attack-artifacts

9
from killvxk/cybersecurity-skills-zh

识别、收集和分析勒索软件攻击制品,以确定变种、初始访问向量、加密范围和恢复选项。