hunting-for-lateral-movement-via-wmi

通过分析 Windows 事件 ID 4688 进程创建和 Sysmon 事件 ID 1 中的 WmiPrvSE.exe 子进程模式、远程进程执行以及 WMI 事件订阅持久化,检测基于 WMI 的横向移动。

9 stars

Best use case

hunting-for-lateral-movement-via-wmi is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

通过分析 Windows 事件 ID 4688 进程创建和 Sysmon 事件 ID 1 中的 WmiPrvSE.exe 子进程模式、远程进程执行以及 WMI 事件订阅持久化,检测基于 WMI 的横向移动。

Teams using hunting-for-lateral-movement-via-wmi 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/hunting-for-lateral-movement-via-wmi/SKILL.md --create-dirs "https://raw.githubusercontent.com/killvxk/cybersecurity-skills-zh/main/skills/hunting-for-lateral-movement-via-wmi/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/hunting-for-lateral-movement-via-wmi/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How hunting-for-lateral-movement-via-wmi Compares

Feature / Agenthunting-for-lateral-movement-via-wmiStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

通过分析 Windows 事件 ID 4688 进程创建和 Sysmon 事件 ID 1 中的 WmiPrvSE.exe 子进程模式、远程进程执行以及 WMI 事件订阅持久化,检测基于 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 进行的横向移动

## 概述

Windows Management Instrumentation(WMI)常被滥用于横向移动,方式包括 `wmic process call create` 或 Win32_Process.Create() 在远程主机执行命令。检测重点在于:识别 WmiPrvSE.exe 在 Windows 安全事件 ID 4688 和 Sysmon 事件 ID 1 日志中派生子进程(cmd.exe、powershell.exe),以及 WMI-Activity/Operational 事件(5857、5860、5861)中的事件订阅持久化行为。

## 前置条件

- 启用了进程创建审计的 Windows 安全事件日志(事件 4688,含命令行)
- 安装了 Sysmon 并配置了事件 ID 1(进程创建)
- Python 3.9+ 及 `python-evtx`、`lxml` 库
- 了解 WMI 架构和 WmiPrvSE.exe 行为

## 步骤

### 步骤 1:解析进程创建事件
从 EVTX 文件中提取事件 ID 4688 和 Sysmon 事件 1 条目。

### 步骤 2:检测 WmiPrvSE 子进程
标记 ParentImage/ParentProcessName 为 WmiPrvSE.exe 的进程,表示存在远程 WMI 执行。

### 步骤 3:分析命令行模式
识别匹配 WMI 横向移动模式的可疑命令行(cmd.exe /q /c、输出重定向到 admin$ 共享)。

### 步骤 4:检查 WMI 事件订阅
解析 WMI-Activity/Operational 日志,查找表明持久化的事件消费者创建事件。

## 预期输出

JSON 报告,包含 WMI 派生的进程、可疑命令行、WMI 事件订阅告警以及横向移动活动的时间线。

Related Skills

performing-threat-hunting-with-yara-rules

9
from killvxk/cybersecurity-skills-zh

使用 YARA 模式匹配规则在文件系统和内存转储中狩猎恶意软件、可疑文件和入侵指标。 涵盖规则编写、yara-python 扫描以及与威胁情报源的集成。

performing-threat-hunting-with-elastic-siem

9
from killvxk/cybersecurity-skills-zh

使用 KQL/EQL 查询、检测规则和 Timeline 调查在 Elastic Security SIEM 中执行主动威胁狩猎, 识别绕过自动检测的威胁。适用于 SOC 团队针对特定 ATT&CK 技术进行狩猎、调查异常行为, 或使用 Elasticsearch 和 Kibana Security 验证检测覆盖缺口。

performing-lateral-movement-with-wmiexec

9
from killvxk/cybersecurity-skills-zh

在红队演练中,使用基于 WMI 的远程执行技术(包括 Impacket wmiexec.py、CrackMapExec 和原生 WMI 命令)在 Windows 网络中执行横向移动,实现隐蔽的后渗透操作。

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)技术。

hunting-living-off-the-land-binaries

9
from killvxk/cybersecurity-skills-zh

检测 Windows 事件日志和 Sysmon 遥测数据中对离地攻击(Living Off The Land Binaries,LOLBAS)的滥用, 包括 certutil、wmic、mshta、regsvr32 和 rundll32 等工具。 通过将进程创建事件与 LOLBAS 项目数据库交叉比对来构建检测规则。 适用于针对无文件攻击技术的威胁狩猎或构建 SIEM 检测规则的场景。

hunting-for-webshells-in-web-servers

9
from killvxk/cybersecurity-skills-zh

通过扫描高熵值文件、可疑的 PHP/JSP/ASP 模式(eval、base64_decode、system、passthru)、 Web 根目录中近期修改的文件以及异常文件大小,检测植入 Web 服务器的 Webshell(网页后门)。 使用香农熵(Shannon entropy)计算标记混淆载荷,并通过正则表达式模式匹配已知 Webshell 特征。

hunting-for-webshell-activity

9
from killvxk/cybersecurity-skills-zh

通过分析 Web 目录中的文件创建行为、Web 服务器异常进程派生以及异常 HTTP 模式,狩猎面向互联网服务器上的 Webshell 部署。

hunting-for-unusual-service-installations

9
from killvxk/cybersecurity-skills-zh

通过解析系统事件日志中的事件 ID 7045、分析服务二进制路径并识别持久化机制指标,检测可疑 Windows 服务安装(MITRE ATT&CK T1543.003)。

hunting-for-unusual-network-connections

9
from killvxk/cybersecurity-skills-zh

通过分析出站流量模式、稀有目标地址、非标准端口和终端异常连接频率,狩猎异常网络连接。

hunting-for-supply-chain-compromise

9
from killvxk/cybersecurity-skills-zh

狩猎供应链入侵指标,包括木马化软件更新、受损依赖项、未授权代码修改和被篡改的构建产物。

hunting-for-startup-folder-persistence

9
from killvxk/cybersecurity-skills-zh

通过监控 Windows 启动目录中的可疑文件创建、分析 autoruns 条目以及使用 Python watchdog 进行实时文件系统监控,检测 T1547.001 启动文件夹持久化。

hunting-for-spearphishing-indicators

9
from killvxk/cybersecurity-skills-zh

跨电子邮件日志、终端遥测和网络数据狩猎鱼叉式网络钓鱼活动指标,检测定向邮件攻击。