SkillAgentSearch skills...

analyzing-powershell-script-block-logging

Parse Windows PowerShell Script Block Logs (Event ID 4104) from EVTX

Install / Use

npx skills add mukul975/Anthropic-Cybersecurity-Skills --skill analyzing-powershell-script-block-logging

Installs into whichever agent you are using.

About this skill
📄

SKILL.md

Installable skill definition

Quality Score

88/100

Category

Security

Supported Platforms

Universal

Our assessment of analyzing-powershell-script-block-logging

analyzing-powershell-script-block-logging scores 88/100 on our quality scale, 290th of 544 Security skills we index.

Its SKILL.md is 2.6 KB long, split into 7 sections with 2 code examples: a solid amount of guidance for an agent.

With 33,340 GitHub stars, it is one of the more widely adopted skills in the catalogue.

Substance
26/30
Structure
16/20
Description
12/15
Adoption
19/20
Freshness
15/15

Maintenance, license and trust

  • The repository was last updated 25 days ago, so analyzing-powershell-script-block-logging is actively maintained.
  • It is released under the Apache-2.0 license, a permissive license that allows use, modification and commercial use with attribution.
  • Its trust signals score 100/100, with no cautions. These come from repository metadata, not a code audit — read the skill file before letting an agent act on it.

Safety scan

No issues found

Our scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. An AI review of the same text found nothing harmful.

AI review by kimi-k2.7-code on 2026-09-26. Automated pattern scan on 2026-09-25. It catches known dangerous patterns, not every risk — read a skill before letting an agent act on it.

analyzing-powershell-script-block-logging compared with similar skills

All 4 of these similar skills score higher than analyzing-powershell-script-block-logging; compare them before choosing.

SkillScoreStarsUpdatedFormat
analyzing-powershell-script-block-logging (this skill)by mukul9758833.3k25d agoSKILL.md
Agent-Reachby Panniantong10085.4k10d agoCLAUDE.md
headroomby headroomlabs-ai10073.8ktodayCLAUDE.md
Scraplingby D4Vinci10083.7ktodayMCP Server
algorithmic-artby anthropics100177.9k3d agoSKILL.md

Frequently asked questions

How do I install analyzing-powershell-script-block-logging?
Run npx skills add mukul975/Anthropic-Cybersecurity-Skills --skill analyzing-powershell-script-block-logging. The install tabs above show the steps for each supported agent.
Which AI agents does analyzing-powershell-script-block-logging work with?
It is written for Universal, as a SKILL.md file. Other agents that read the same format can often use it too.
Is analyzing-powershell-script-block-logging safe to use?
Our scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. An AI review of the same text found nothing harmful. It is Apache-2.0-licensed and scores 100/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
Is analyzing-powershell-script-block-logging still maintained?
The repository was last updated 25 days ago, so analyzing-powershell-script-block-logging is actively maintained.

name: analyzing-powershell-script-block-logging description: Parse Windows PowerShell Script Block Logs (Event ID 4104) from EVTX files to detect obfuscated commands, encoded payloads, and living-off-the-land techniques. Uses python-evtx to extract and reconstruct multi-block scripts, applies entropy analysis and pattern matching for Base64-encoded commands, Invoke-Expression abuse, download cradles, and AMSI bypass attempts. domain: cybersecurity subdomain: security-operations tags:

  • powershell
  • script-block-logging
  • event-id-4104
  • obfuscation-detection
  • windows-forensics
  • endpoint-security version: '1.0' author: mahipal license: Apache-2.0 nist_csf:
  • DE.CM-01
  • RS.MA-01
  • GV.OV-01
  • DE.AE-02 mitre_attack:
  • T1059.001
  • T1027.010
  • T1140
  • T1105

Analyzing PowerShell Script Block Logging

When to Use

  • When investigating security incidents that require analyzing powershell script block logging
  • 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

  • Familiarity with security operations concepts and tools
  • Access to a test or lab environment for safe execution
  • Python 3.8+ with required dependencies installed
  • Appropriate authorization for any testing activities

Instructions

  1. Install dependencies: pip install python-evtx lxml
  2. Collect PowerShell Operational logs: Microsoft-Windows-PowerShell%4Operational.evtx
  3. Parse Event ID 4104 entries using python-evtx to extract ScriptBlockText, ScriptBlockId, and MessageNumber/MessageTotal for multi-part script reconstruction.
  4. Apply detection heuristics:
    • Base64-encoded commands (-EncodedCommand, FromBase64String)
    • Download cradles (DownloadString, DownloadFile, Invoke-WebRequest, Net.WebClient)
    • AMSI bypass patterns (AmsiUtils, amsiInitFailed)
    • Obfuscation indicators (high entropy, tick-mark insertion, string concatenation)
  5. Generate a report with reconstructed scripts, risk scores, and MITRE ATT&CK mappings.
python scripts/agent.py --evtx-file /path/to/PowerShell-Operational.evtx --output ps_analysis.json

Examples

Detect Encoded Command Execution

import base64
if "-encodedcommand" in script_text.lower():
    encoded = script_text.split()[-1]
    decoded = base64.b64decode(encoded).decode("utf-16-le")

Reconstruct Multi-Block Script

Scripts split across multiple 4104 events share a ScriptBlockId. Concatenate blocks ordered by MessageNumber to recover the full script.

Related Skills

View on GitHub
GitHub Stars33.3k
CategorySecurity
Updated25d ago
Forks4.0k

Languages

Python

Trust signals

100/100

From repository metadata: license, adoption, age and documentation. Not a code audit — see the Safety scan above for what the skill file itself contains.

No cautions