Skip to content
Skillpedia
Analysis & spreadsheets35k · #7948

hunting-for-anomalous-powershell-execution

What it does

This tool searches for malicious PowerShell activity in your Windows event logs. It analyzes executed scripts to find attempts to disguise commands, bypass security (AMSI), download suspicious code, or steal credentials.

When to use it

  • ✓When investigating a security incident involving PowerShell.
  • ✓When creating rules to detect suspicious PowerShell activity.
  • ✓When checking if your monitoring system detects common PowerShell attacks.

Skill link

https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/hunting-for-anomalous-powershell-execution/SKILL.md

Copy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.

How to use

The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.

Ready-to-paste message

Use this skill to help me: https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/hunting-for-anomalous-powershell-execution/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
Want your AI to find skills like this on its own?Install the free Skillpedia MCP: one line, and it searches 15,000+ skills before each task.Install in 1 minute →

Example of what to ask your AI

“Search for suspicious PowerShell activity in my event logs.”

5 new skills a week. 1 minute to read.

How it works

The tool reads Windows event log files (.evtx) that contain information about what PowerShell executed. It looks for known attack patterns, such as encoded commands or attempts to bypass security.

Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

Hunting for Anomalous PowerShell Execution

Overview

PowerShell Script Block Logging (Event ID 4104) records the full deobfuscated script text executed on a Windows endpoint, making it the primary data source for hunting malicious PowerShell. Combined with Module Logging (4103) and process creation events, analysts can detect encoded commands, AMSI bypass patterns, download cradles, credential theft tools, and fileless attack techniques even when the attacker uses obfuscation layers.

When to Use

  • When investigating security incidents that require hunting for anomalous powershell execution
  • When building detection rules or threat hunting queries for this domain
  • When SOC analysts need structured procedures for this analysis type
  • When validating security monitoring coverage for related attack techniques

Prerequisites

  • Windows Event Log exports (.evtx) from Microsoft-Windows-PowerShell/Operational
  • Python 3.8+ with python-evtx and lxml libraries
  • Script Block Logging enabled via Group Policy
  • Understanding of common PowerShell attack techniques

Steps

  1. Parse EVTX files extracting Event 4104 script block text and metadata
  2. Reassemble multi-part script blocks using ScriptBlock ID correlation
  3. Scan script text for AMSI bypass indicators and obfuscation patterns
  4. Detect encoded command execution and base64 payloads
  5. Identify download cradles, credential dumping, and lateral movement commands
  6. Score and prioritize findings by threat severity

Expected Output

{
  "total_events": 1247,
  "suspicious_events": 23,
  "amsi_bypass_attempts": 2,
  "encoded_commands": 8,
  "download_cradles": 5,
  "credential_access": 3
}
FAQ

What is 'Script Block Logging'?

These are detailed logs that show exactly which commands and scripts PowerShell executed, even if the attacker tried to hide them.

What is AMSI?

AMSI (Antimalware Scan Interface) is a Windows security layer that helps detect and block malicious software. The tool looks for attempts to disable or trick AMSI.

What are 'download cradles'?

These are code snippets used to download and execute other malicious programs directly from the internet, without saving a file to disk.

Details

Original description by the author

Hunt for malicious PowerShell activity by analyzing Script Block Logging (Event 4104), Module Logging (Event 4103), and process creation events. The analyst parses Windows Event Log EVTX files to detect obfuscated commands, AMSI bypass attempts, encoded payloads, credential dumping keywords, and suspicious download cradles. Activates for requests involving PowerShell threat hunting, script block a

repo: mukul975/Anthropic-Cybersecurity-Skills

Popularity

GitHub stars
35k
Ranking position
#7948
License
Apache-2.0
Updated
8/31/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills