$npx -y skills add killvxk/cybersecurity-skills-zh --skill analyzing-powershell-empire-artifacts通过识别 Base64 编码的启动器模式、默认 User-Agent、暂存 URL 结构、stager IOC 以及脚本块日志事件中已知的 Empire 模块签名,检测 Windows 事件日志中的 PowerShell Empire 框架工件。
| 1 | # 分析 PowerShell Empire 工件 |
| 2 | |
| 3 | ## 概述 |
| 4 | |
| 5 | PowerShell Empire 是一个由监听器(listener)、stager 和 agent 组成的后渗透框架。其工件在 Windows 事件日志中留有可检测的痕迹,尤其是 PowerShell 脚本块日志(Script Block Logging,事件 ID 4104)和模块日志(Module Logging,事件 ID 4103)。本技能分析事件日志中 Empire 的默认启动器字符串(`powershell -noP -sta -w 1 -enc`)、包含 `System.Net.WebClient` 和 `FromBase64String` 的 Base64 编码 payload、已知模块调用(Invoke-Mimikatz、Invoke-Kerberoast、Invoke-TokenManipulation)以及暂存 URL 模式。 |
| 6 | |
| 7 | ## 前置条件 |
| 8 | |
| 9 | - Python 3.9+,可访问 Windows 事件日志或导出的 EVTX 文件 |
| 10 | - 通过组策略启用 PowerShell 脚本块日志(事件 ID 4104) |
| 11 | - 启用模块日志(事件 ID 4103)以实现全面覆盖 |
| 12 | |
| 13 | ## 关键检测模式 |
| 14 | |
| 15 | 1. **默认启动器** — `powershell -noP -sta -w 1 -enc` 后跟 Base64 编码块 |
| 16 | 2. **Stager 失陷指标** — `System.Net.WebClient`、`DownloadData`、`DownloadString`、`FromBase64String` |
| 17 | 3. **模块签名** — Invoke-Mimikatz、Invoke-Kerberoast、Invoke-TokenManipulation、Invoke-PSInject、Invoke-DCOM |
| 18 | 4. **User-Agent 字符串** — HTTP 监听器配置中的默认 Empire User-Agent |
| 19 | 5. **暂存 URL** — `/login/process.php`、`/admin/get.php` 及类似的默认 URI 模式 |
| 20 | |
| 21 | ## 输出 |
| 22 | |
| 23 | JSON 报告,包含匹配的 IOC、解码后的 Base64 payload、可疑事件时间线、MITRE ATT&CK 技术映射以及严重性评分。 |