Agent skill

Analyzing Powershell Script Block Logging

by mukul975 in mukul975/Anthropic-Cybersecurity-Skills

Parse Windows PowerShell Script Block Logs (Event ID 4104) from EVTX files to detect obfuscated commands, encoded payloads, and living-off-the-land techniques.

Apache-2.0Auto-check passedDevelopment

Install Analyzing Powershell Script Block Logging

skills CLI
$ npx skills add mukul975/Anthropic-Cybersecurity-Skills --skill analyzing-powershell-script-block-logging -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install mukul975/Anthropic-Cybersecurity-Skills analyzing-powershell-script-block-logging --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/mukul975/Anthropic-Cybersecurity-Skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/analyzing-powershell-script-block-logging .claude/skills/analyzing-powershell-script-block-logging && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
analyzing-powershell-script-block-logging
GitHub stars
34k
Token cost
~666 tokens
SKILL.md length
178 words
Files
4 (incl. scripts, references)
Skills in repo
639
Repo updated
First seen
Licence
Apache-2.0

At a glance

Parse Windows PowerShell Script Block Logs (Event ID 4104) from EVTX files to detect obfuscated commands, encoded payloads, and living-off-the-land techniques.

  • Works in 5 steps: Install dependencies: pip install… → Collect PowerShell Operational logs:… → Parse Event ID 4104 entries using… → …
  • Tasks that involve Shell scripting
  • SKILL.md covers When to Use, Prerequisites, Instructions and Examples
  • Runs Python scripts from its folder; calls python and pip

What it does

Analyzing Powershell Script Block Logging is an agent skill from mukul975/Anthropic-Cybersecurity-Skills. 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.

Its SKILL.md is about 670 tokens, which your agent loads only when the skill is triggered. The skill folder holds 5 other files, including scripts and reference files (for example `references/api-reference.md` and `scripts/agent.py`).

It sits in Development, covering Shell scripting. It works with PowerShell and Python. The repository describes itself as: 817 structured cybersecurity skills for AI agents · Mapped to 6 frameworks: MITRE ATT&CK, NIST CSF 2.0, MITRE ATLAS, D3FEND, NIST AI RMF & MITRE F3 (Fight Fraud) · agentskills.io…. The licence is Apache-2.0.

When your agent uses it

  • Tasks that involve Shell scripting

Example prompts

  • “/analyzing-powershell-script-block-logging”

Requirements

  • Python 3

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  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…
  4. Apply detection heuristics
  5. Generate a report with reconstructed scripts, risk scores, and MITRE ATT&CK mappings.

What it can do on your machine

Read from SKILL.md and the folder at commit 54a7988. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 1 file in scripts/ (Python), which the agent can run.

    Shell commands in SKILL.md call:

    • python
    • pip

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use pip, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Analyzing Powershell Script Block Logging loads about 666 tokens when it runs, and up to ~1.1k if it reads all its reference files. Until then it costs about 103 tokens; SKILL.md has 178 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~103
When it runs · the whole SKILL.md, loaded when a task matches
~666
With references · SKILL.md plus every file in references/, read only if the agent opens them
~1.1k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from mukul975/Anthropic-Cybersecurity-Skills at commit 54a7988, republished under its Apache-2.0 licence (© mukul975). 178 words, ~666 tokens.

Download SKILL.mdSave it as .claude/skills/analyzing-powershell-script-block-logging/SKILL.md (or your agent's skills folder). This skill also uses 3 other files; get the full folder from GitHub.
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.
bash
python scripts/agent.py --evtx-file /path/to/PowerShell-Operational.evtx --output ps_analysis.json

Examples

Detect Encoded Command Execution
python
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.

© mukul975, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 3 other files (scripts, references) in skills/analyzing-powershell-script-block-logging of mukul975/Anthropic-Cybersecurity-Skills.

  • SKILL.md
  • LICENSE
  • references/api-reference.md
  • scripts/agent.py

Open the folder on GitHubat commit 54a7988

Compare with similar skills

Analyzing Powershell Script Block Logging next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Analyzing Powershell Script Block Logging compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Analyzing Powershell Script Block Logging this skillmukul975/Anthropic-Cybersecurity-Skills34k—~666Automated safety check: PassApache-2.0
CLI DeveloperJeffallan/claude-skills12k1 repos~1.2kAutomated safety check: PassMIT
Robust Error Handling In Scriptsaiming-lab/MetaClaw3.5k—~225Automated safety check: PassMIT
Cosa Devcoreos/coreos-assembler395—~2kAutomated safety check: PassApache-2.0
Claude Code Statusline Writerlexler/skill-factory239—~872Automated safety check: PassApache-2.0
Nerd Font Icon Lookupmalob/nix-config463—~697Automated safety check: PassMIT

Similar skills

  • CLI Developer

    Jeffallan/claude-skills

    Walks through designing, building and polishing a command-line tool: user workflow and command hierarchy, implementation in commander, click, typer or cobra, completions and cross-platform testing.

    12k GitHub starsUsed in 1 repo~1.2k tokens
    DevelopmentAuto-check passed
  • A skill your agent uses when writing shell scripts, Python automation, or any unattended batch job.

    3.5k GitHub stars~225 tokensUpdated 4 mo ago
    DevelopmentAuto-check passed
  • Cosa Dev

    coreos/coreos-assembler

    Develop and test changes to coreos-assembler itself -- build mantle Go binaries (kola, ore, plume), iterate on Python/shell scripts, or do full container rebuilds

    395 GitHub stars~2k tokensUpdated today
    DevelopmentAuto-check passed
  • Claude Code Statusline Writer

    lexler/skill-factory

    Guides writing and debugging Claude Code status line scripts that read session JSON from stdin and print one line of text.

    239 GitHub stars~872 tokensUpdated 1 mo ago
    DevelopmentAuto-check passed
  • Nerd Font Icon Lookup

    malob/nix-config

    Works around Claude Code filtering private-use Unicode so agents can read and write Nerd Font icons in Starship, tmux and prompt configs.

    463 GitHub stars~697 tokensUpdated 3 days ago
    DevelopmentAuto-check passed
  • Shell Tooling

    owent/libatbus

    A skill your agent uses when: running terminal commands, writing or debugging shell/PowerShell scripts, choosing or installing CLI tools, or diagnosing command failures, quoting/escaping errors, or…

    234 GitHub stars~1.4k tokensUpdated 26 days ago
    DevelopmentAuto-check passed

More from mukul975/Anthropic-Cybersecurity-Skills

All 639 skills in this repo
  • Campaign Attribution Evidence Analysis

    mukul975/Anthropic-Cybersecurity-Skills

    Weighs infrastructure, TTP, malware code and timing evidence with the Diamond Model and competing hypotheses to reach a confidence-rated attribution.

    34k GitHub stars~2.3k tokensUpdated 1 mo ago
    Auto-check passed
  • Go Malware Analysis in Ghidra

    mukul975/Anthropic-Cybersecurity-Skills

    Walks through reverse engineering Go-compiled malware in Ghidra: parsing buildinfo and pclntab, recovering stripped function names and extracting dependencies.

    34k GitHub stars~2.8k tokensUpdated 1 mo ago
    Auto-check passed
  • LNK and Jump List Forensics

    mukul975/Anthropic-Cybersecurity-Skills

    Guides forensic analysis of Windows LNK shortcut files and Jump Lists with LECmd, JLECmd and manual parsing to show file access and program execution.

    34k GitHub stars~2.8k tokensUpdated 1 mo ago
    Auto-check passed
  • Malware Persistence Analysis with Autoruns

    mukul975/Anthropic-Cybersecurity-Skills

    Hunts Windows malware persistence with Sysinternals Autoruns, covering run keys, services, scheduled tasks and drivers, with baseline comparison.

    34k GitHub stars~1.2k tokensUpdated 1 mo ago
    Auto-check passed
  • NTFS MFT Deleted File Recovery

    mukul975/Anthropic-Cybersecurity-Skills

    Guides a Windows forensic examination of the NTFS Master File Table to recover deleted-file evidence, build timelines and spot timestomping.

    34k GitHub stars~2.7k tokensUpdated 1 mo ago
    Auto-check passed
  • Network Covert Channel Analysis

    mukul975/Anthropic-Cybersecurity-Skills

    Detects DNS tunneling, ICMP exfiltration and HTTP-based covert channels in packet captures and DNS logs when hunting for hidden command-and-control traffic.

    34k GitHub stars~2k tokensUpdated 1 mo ago
    Auto-check passed

Questions about Analyzing Powershell Script Block Logging

What does Analyzing Powershell Script Block Logging do?

Parse Windows PowerShell Script Block Logs (Event ID 4104) from EVTX files to detect obfuscated commands, encoded payloads, and living-off-the-land techniques. Analyzing Powershell Script Block Logging is an agent skill from mukul975/Anthropic-Cybersecurity-Skills. Parse Windows PowerShell Script Block Logs (Event ID 4104) from EVTX files to detect obfuscated commands, encoded payloads, and living-off-the-land techniques.

When should I use Analyzing Powershell Script Block Logging?

Analyzing Powershell Script Block Logging fits situations like: tasks that involve Shell scripting.

How do I install Analyzing Powershell Script Block Logging in Claude Code?

Run `npx skills add mukul975/Anthropic-Cybersecurity-Skills --skill analyzing-powershell-script-block-logging -a claude-code`. Or copy the skill folder (skills/analyzing-powershell-script-block-logging in mukul975/Anthropic-Cybersecurity-Skills) into .claude/skills/analyzing-powershell-script-block-logging in your project. Claude Code loads it when a task matches its description.

How do I install Analyzing Powershell Script Block Logging in Codex?

Run `npx skills add mukul975/Anthropic-Cybersecurity-Skills --skill analyzing-powershell-script-block-logging -a codex`. Or copy the skill folder (skills/analyzing-powershell-script-block-logging in mukul975/Anthropic-Cybersecurity-Skills) into .agents/skills/analyzing-powershell-script-block-logging in your project. Codex loads it when a task matches its description.

Can I use Analyzing Powershell Script Block Logging in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add mukul975/Anthropic-Cybersecurity-Skills --skill analyzing-powershell-script-block-logging -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/analyzing-powershell-script-block-logging, .gemini/skills/analyzing-powershell-script-block-logging, .github/skills/analyzing-powershell-script-block-logging and .opencode/skills/analyzing-powershell-script-block-logging in your project.

What does Analyzing Powershell Script Block Logging need to run?

Going by SKILL.md and its folder, Analyzing Powershell Script Block Logging needs Python for the scripts in its folder and the command-line tools its instructions call (python and pip). Our summary lists: Python 3.

Does Analyzing Powershell Script Block Logging access the network?

SKILL.md contains no URLs. Its commands use pip, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Analyzing Powershell Script Block Logging safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Analyzing Powershell Script Block Logging use?

Analyzing Powershell Script Block Logging is published under the Apache-2.0 licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Analyzing Powershell Script Block Logging use?

About 666 tokens (SKILL.md is roughly 2.7k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 467 tokens, read only when the agent opens those files.

What are the alternatives to Analyzing Powershell Script Block Logging?

Skills that share tags, products or a category with Analyzing Powershell Script Block Logging: CLI Developer (Jeffallan/claude-skills, 12k stars), Robust Error Handling In Scripts (aiming-lab/MetaClaw, 3.5k stars), Cosa Dev (coreos/coreos-assembler, 395 stars) and Claude Code Statusline Writer (lexler/skill-factory, 239 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Analyzing Powershell Script Block Logging?

mukul975 (a GitHub user) maintains it in mukul975/Anthropic-Cybersecurity-Skills, which has 33,870 GitHub stars. The repository holds 639 skills in this directory. The repository was last updated on August 31, 2026.

Source: mukul975/Anthropic-Cybersecurity-Skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.