Hunting for anomalous powershell execution

From killvxk/cybersecurity-skills-zh · View interactive version

Hunting for anomalous powershell execution is an AI agent skill from the GitHub repository killvxk/cybersecurity-skills-zh. 通过分析脚本块日志(事件 4104)、模块日志(事件 4103)和进程创建事件,狩猎恶意 PowerShell 活动。 分析员解析 Windows 事件日志 EVTX 文件,检测混淆命令、AMSI 绕过尝试、编码 payload、 凭据转储关键词和可疑下载器(download cradles)。适用于涉及 PowerShell 威胁狩猎、脚本块分析、 编码命令检测或 AMSI 绕过识别的场景。

How to use this skill

Skill file

狩猎异常 PowerShell 执行

概述

PowerShell 脚本块日志记录(事件 ID 4104)会记录在 Windows 终端上执行的完整去混淆脚本文本,使其成为狩猎恶意 PowerShell 的主要数据源。结合模块日志(4103)和进程创建事件,分析员即使在攻击者使用混淆层的情况下,也能检测编码命令、AMSI 绕过模式、下载器(download cradles)、凭据窃取工具和无文件攻击技术。

前置条件

步骤

  1. 解析 EVTX 文件,提取事件 4104 的脚本块文本和元数据
  2. 使用 ScriptBlock ID 关联重组多部分脚本块
  3. 扫描脚本文本中的 AMSI 绕过指标和混淆模式
  4. 检测编码命令执行和 Base64 payload
  5. 识别下载器(download cradles)、凭据转储和横向移动命令
  6. 按威胁严重程度对发现结果评分并排序

预期输出

{
  "total_events": 1247,
  "suspicious_events": 23,
  "amsi_bypass_attempts": 2,
  "encoded_commands": 8,
  "download_cradles": 5,
  "credential_access": 3
}
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.