detecting-wmi-persistence
通过分析 Sysmon 事件 ID 19、20 和 21 中的恶意 EventFilter、EventConsumer 和 FilterToConsumerBinding 创建,检测 WMI 事件订阅持久化。
Best use case
detecting-wmi-persistence is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
通过分析 Sysmon 事件 ID 19、20 和 21 中的恶意 EventFilter、EventConsumer 和 FilterToConsumerBinding 创建,检测 WMI 事件订阅持久化。
Teams using detecting-wmi-persistence 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
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/detecting-wmi-persistence/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How detecting-wmi-persistence Compares
| Feature / Agent | detecting-wmi-persistence | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
通过分析 Sysmon 事件 ID 19、20 和 21 中的恶意 EventFilter、EventConsumer 和 FilterToConsumerBinding 创建,检测 WMI 事件订阅持久化。
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
# 检测 WMI 持久化 ## 适用场景 - 狩猎 WMI 事件订阅持久化(MITRE ATT&CK T1546.003)时 - 在终端遥测中检测到可疑 WMI 活动后 - 事件响应期间识别攻击者的持久化机制时 - Sysmon 告警触发事件 ID 19、20 或 21 时 - 紫队演练测试基于 WMI 的持久化时 ## 前置条件 - 部署了启用 WMI 事件日志的 Sysmon v6.1+(事件 ID 19、20、21) - 已配置 Windows 安全事件日志转发 - 已接入 Sysmon 数据的 SIEM(Splunk、Elastic、Sentinel) - 终端上的 PowerShell 访问权限(用于 WMI 枚举) - Sysinternals Autoruns(用于手动 WMI 订阅审查) ## 工作流程 1. **收集遥测数据**:解析 Sysmon 事件 ID 19(WmiEventFilter)、20(WmiEventConsumer)、21(WmiEventConsumerToFilter)。 2. **识别可疑消费者**:标记执行代码的 CommandLineEventConsumer 和 ActiveScriptEventConsumer 类型。 3. **分析事件过滤器**:检查 EventFilter 中的 WQL 查询,查找进程启动触发器或基于计时器的执行。 4. **关联绑定**:匹配将可疑过滤器连接到消费者的 FilterToConsumerBinding。 5. **检查持久化位置**:查询 WMI 命名空间 root\subscription 和 root\default 中的活跃订阅。 6. **验证发现**:与已知合法的 WMI 订阅(SCCM、AV 产品)交叉参考。 7. **记录并修复**:删除恶意订阅并更新检测规则。 ## 核心概念 | 概念 | 描述 | |------|------| | Sysmon 事件 19 | 检测到 WmiEventFilter 创建 | | Sysmon 事件 20 | 检测到 WmiEventConsumer 创建 | | Sysmon 事件 21 | 检测到 WmiEventConsumerToFilter 绑定 | | T1546.003 | 事件触发执行:WMI 事件订阅 | | CommandLineEventConsumer | 过滤器触发时执行系统命令 | | ActiveScriptEventConsumer | 过滤器触发时运行 VBScript/JScript | ## 工具与系统 | 工具 | 用途 | |------|------| | Sysmon | WMI 活动的 Windows 事件监控 | | WMI Explorer | 浏览 WMI 命名空间的 GUI 工具 | | Autoruns | 列出持久化机制的 Sysinternals 工具 | | PowerShell Get-WMIObject | 枚举 WMI 事件订阅 | | Splunk | Sysmon WMI 事件的 SIEM 分析 | | Velociraptor | 终端 WMI 工件收集 | ## 输出格式 ``` Hunt ID: TH-WMI-[DATE]-[SEQ] Technique: T1546.003 Host: [主机名] Event Type: [EventFilter|EventConsumer|Binding] Consumer Type: [CommandLine|ActiveScript] WQL Query: [过滤器查询文本] Command: [执行的命令或脚本] Risk Level: [Critical/High/Medium/Low] Recommended Action: [删除订阅,调查横向移动] ```
Related Skills
performing-malware-persistence-investigation
系统性地调查 Windows 和 Linux 系统上的所有持久化机制,以识别恶意软件如何在重启后存活并维持访问。
hunting-for-startup-folder-persistence
通过监控 Windows 启动目录中的可疑文件创建、分析 autoruns 条目以及使用 Python watchdog 进行实时文件系统监控,检测 T1547.001 启动文件夹持久化。
hunting-for-scheduled-task-persistence
通过分析任务创建事件、可疑任务操作和异常调度模式,狩猎攻击者通过 Windows 计划任务实现的持久化。
hunting-for-registry-run-key-persistence
通过分析 Sysmon 事件 ID 13 日志和注册表查询,检测 MITRE ATT&CK T1547.001 注册表 Run 键持久化,识别恶意自动启动条目。
hunting-for-registry-persistence-mechanisms
狩猎 Windows 环境中基于注册表的持久化机制,包括 Run 键、Winlogon 修改、IFEO 注入和 COM 劫持。
hunting-for-persistence-via-wmi-subscriptions
通过监控 WMI 消费者、过滤器和绑定创建事件,狩猎攻击者利用 Windows Management Instrumentation 事件订阅实现的持久化,这些订阅在系统事件触发时执行恶意代码。
hunting-for-persistence-mechanisms-in-windows
系统性地狩猎 Windows 终端中的攻击者持久化机制,涵盖注册表、服务、启动文件夹和 WMI 事件订阅。
hunting-for-dns-based-persistence
使用被动 DNS 数据库、SecurityTrails API 和 DNS 审计日志分析,狩猎 DNS 劫持、悬空 CNAME 记录、通配符 DNS 滥用和未授权区域修改等 DNS 持久化机制。
detecting-t1548-abuse-elevation-control-mechanism
通过监控注册表修改、进程提升标志和异常的父子进程关系,检测提升控制机制滥用,包括 UAC 绕过、sudo 利用和 setuid/setgid 操纵。
detecting-t1055-process-injection-with-sysmon
通过分析 Sysmon 事件中的跨进程内存操作、远程线程创建和异常 DLL 加载模式,检测进程注入技术(T1055),包括经典 DLL 注入、进程镂空和 APC 注入。
detecting-t1003-credential-dumping-with-edr
利用 EDR 遥测数据、Sysmon 进程访问监控和 Windows 安全事件关联,检测针对 LSASS 内存、SAM 数据库、NTDS.dit 和缓存凭据的 OS 凭据转储技术。
detecting-suspicious-powershell-execution
检测可疑的 PowerShell 执行模式,包括编码命令、下载器(download cradles)、AMSI 绕过尝试以及受限语言模式规避。