The interface is localized. Skill descriptions and documents are machine-translated by AI into your language; code, commands, paths and technical terms stay in the original, and the author's document governs.
Explore skills
Productivity · SKILL.md

detecting-suspicious-powershell-execution

detecting-suspicious-powershell-execution

检测可疑的 PowerShell 执行模式,包括编码命令、下载器(download cradles)、AMSI 绕过尝试以及受限语言模式规避。

Independent GitHub snapshot · Automated classification · Original documentation governs

Skill documentation

GitHub

name: detecting-suspicious-powershell-execution description: 检测可疑的 PowerShell 执行模式,包括编码命令、下载器(download cradles)、AMSI 绕过尝试以及受限语言模式规避。 domain: cybersecurity subdomain: threat-hunting tags: [threat-hunting, mitre-attack, powershell, execution, t1059, amsi, proactive-detection] version: "1.0" author: mahipal license: Apache-2.0

检测可疑 PowerShell 执行

适用场景

  • 主动狩猎环境中可疑 PowerShell 执行指标时
  • 威胁情报表明使用这些技术的攻击活动正在活跃时
  • 事件响应期间确定与这些技术相关的攻击范围时
  • EDR 或 SIEM 告警触发相关指标时
  • 定期安全评估和紫队(Purple Team)演练期间

前置条件

  • 具备进程和网络遥测功能的 EDR 平台(CrowdStrike、MDE、SentinelOne)
  • 已接入相关日志数据的 SIEM(Splunk、Elastic、Sentinel)
  • 部署了完整配置的 Sysmon
  • 已启用 Windows 安全事件日志转发
  • 用于 IOC 关联的威胁情报 feeds

工作流程

  1. 制定假设:基于威胁情报或 ATT&CK 差距分析,定义可测试的假设。
  2. 识别数据源:确定验证或反驳假设所需的日志和遥测数据。
  3. 执行查询:针对 SIEM 和 EDR 平台运行检测查询,收集相关事件。
  4. 分析结果:检查查询结果中的异常,并跨多个数据源进行关联。
  5. 验证发现:通过上下文分析区分真阳性和假阳性。
  6. 关联活动:将发现结果链接到更广泛的攻击链和威胁行为者 TTP。
  7. 记录与报告:记录发现结果、更新检测规则并推荐响应措施。

核心概念

概念描述
T1059.001PowerShell
T1059.003Windows 命令行(Windows Command Shell)
T1562.001禁用或修改工具(Disable or Modify Tools)

工具与系统

工具用途
CrowdStrike FalconEDR 遥测和威胁检测
Microsoft Defender for Endpoint使用 KQL 进行高级狩猎
Splunk Enterprise使用 SPL 查询进行 SIEM 日志分析
Elastic Security检测规则和调查时间线
Sysmon详细的 Windows 事件监控
Velociraptor终端工件收集和狩猎
Sigma Rules跨平台检测规则格式

常见场景

  1. 场景 1:宏文档启动 Base64 编码的 PowerShell 命令
  2. 场景 2:IEX 下载器从 C2 服务器拉取 payload
  3. 场景 3:在 payload 执行前通过反射修补绕过 AMSI
  4. 场景 4:PowerShell Empire agent 与 C2 通信

输出格式

Hunt ID: TH-DETECT-[DATE]-[SEQ]
Technique: T1059.001
Host: [主机名]
User: [账户上下文]
Evidence: [日志条目、进程树、网络数据]
Risk Level: [Critical/High/Medium/Low]
Confidence: [High/Medium/Low]
Recommended Action: [遏制、调查、监控]
Saved skills