detecting-suspicious-powershell-execution
检测可疑的 PowerShell 执行模式,包括编码命令、下载器(download cradles)、AMSI 绕过尝试以及受限语言模式规避。
Best use case
detecting-suspicious-powershell-execution is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
检测可疑的 PowerShell 执行模式,包括编码命令、下载器(download cradles)、AMSI 绕过尝试以及受限语言模式规避。
Teams using detecting-suspicious-powershell-execution 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-suspicious-powershell-execution/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How detecting-suspicious-powershell-execution Compares
| Feature / Agent | detecting-suspicious-powershell-execution | 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?
检测可疑的 PowerShell 执行模式,包括编码命令、下载器(download cradles)、AMSI 绕过尝试以及受限语言模式规避。
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
# 检测可疑 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.001 | PowerShell | | T1059.003 | Windows 命令行(Windows Command Shell) | | T1562.001 | 禁用或修改工具(Disable or Modify Tools) | ## 工具与系统 | 工具 | 用途 | |------|------| | CrowdStrike Falcon | EDR 遥测和威胁检测 | | 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: [遏制、调查、监控] ```
Related Skills
hunting-for-lolbins-execution-in-endpoint-logs
通过分析终端进程创建日志,识别合法 Windows 系统二进制文件(LOLBin)被用于恶意目的的可疑执行模式,狩猎攻击者的 LOLBin 滥用行为。
hunting-for-anomalous-powershell-execution
通过分析脚本块日志(事件 4104)、模块日志(事件 4103)和进程创建事件,狩猎恶意 PowerShell 活动。 分析员解析 Windows 事件日志 EVTX 文件,检测混淆命令、AMSI 绕过尝试、编码 payload、 凭据转储关键词和可疑下载器(download cradles)。适用于涉及 PowerShell 威胁狩猎、脚本块分析、 编码命令检测或 AMSI 绕过识别的场景。
detecting-wmi-persistence
通过分析 Sysmon 事件 ID 19、20 和 21 中的恶意 EventFilter、EventConsumer 和 FilterToConsumerBinding 创建,检测 WMI 事件订阅持久化。
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-oauth-application-consent
使用 Microsoft Graph API、审计日志和权限分析,检测 Azure AD / Microsoft Entra ID 中的高风险 OAuth 应用授权同意,识别非法同意授权攻击。
detecting-supply-chain-attacks-in-ci-cd
扫描 GitHub Actions 工作流和 CI/CD 流水线配置,检测供应链攻击(Supply Chain Attack)向量, 包括未固定的 Action 版本、通过表达式的脚本注入、依赖混淆(Dependency Confusion)和密钥泄露。 使用 PyGithub 和 YAML 解析进行自动化审计。适用于加固 CI/CD 流水线或调查被攻击的构建系统。
detecting-stuxnet-style-attacks
本技能涵盖检测遵循Stuxnet攻击模式的复杂网络物理攻击——在修改PLC逻辑的同时欺骗传感器读数以向操作员隐藏操控行为。内容涉及PLC逻辑完整性监控、基于物理的过程异常检测、工程师工作站入侵指标、USB传播攻击向量,以及从IT到OT横向移动直至过程操控的多阶段攻击链检测。
detecting-sql-injection-via-waf-logs
分析 WAF(Web 应用防火墙,ModSecurity/AWS WAF/Cloudflare)日志,检测 SQL 注入(SQL Injection)攻击活动。 解析 ModSecurity 审计日志和 JSON WAF 事件日志,识别 SQLi 模式(UNION SELECT、OR 1=1、SLEEP()、BENCHMARK()), 追踪攻击源,关联多阶段注入尝试,并生成带 OWASP 分类的事件报告。
detecting-spearphishing-with-email-gateway
鱼叉式网络钓鱼(Spearphishing)使用个性化、经过研究的内容针对特定个人,可绕过通用垃圾邮件过滤器。邮件安全网关(SEG)如 Microsoft Defender for Office 365、Proofpoint、Mimecast 和 Barracuda 提供高级检测能力,包括行为分析、URL 引爆、附件沙箱和冒充检测。本技能涵盖配置这些网关以检测和拦截定向钓鱼攻击。
detecting-shadow-it-cloud-usage
通过使用 Python pandas 分析代理日志、DNS 查询日志和网络流数据,进行流量模式分析和域名分类,检测未授权的 SaaS 和云服务使用(影子 IT)。