Hunting for anomalous powershell execution

From mukul975/Anthropic-Cybersecurity-Skills · View interactive version

Hunting for anomalous powershell execution is an AI agent skill from the GitHub repository mukul975/Anthropic-Cybersecurity-Skills. 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 sus

How to use this skill

Skill file

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

Prerequisites

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
}
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.