Saltar al contenido
Nuevo

DeepSeek V4.1 Flash gratis por 7 días: 10M tokens al día tras una recarga de $10 o más. Hasta el 30/11.

Cómo funciona
mukul975/analyzing-powershell-script-block-loggingActive Directory y Windows

analyzing-powershell-script-block-logging

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

v1.03 instalaciones+3 en 7 días36,3 mil EstrellasApache-2.0sincronizado hace 11 horas

Instalar

¿Aún no tienes la CLI de NotHoly? Instálala primero.

$ curl -fsSL https://notholy.com/install.sh | sh
$ notholy skills install mukul975/analyzing-powershell-script-block-logging

Escribe en ⁦~/.notholy/skills⁩ después de comprobar la firma y el SHA-256.

FirmaFirmado, ed25519
GK0rnIOVa3…GtWqz8DA==La CLI comprueba el SHA-256 y la firma antes de escribir cualquier archivo.
Paquete238de6c2…fa982a0f
238de6c25425…799efa982a0f4 archivos · ⁦8.2 KB⁩
EscaneoAlto10 hallazgos
  • injection.chat_markupreferences/api-reference.md:17
  • injection.chat_markupreferences/api-reference.md:20
  • command.pipe_to_shellSKILL.md:6
Ver el escaneo completo
Fuentegithub.com/mukul975/Anthropic-Cybersecurity-Skills/tree/main/skills/analyzing-powershell-script-block-logging@54a7988

Esta entrada todavía no está escrita en tu idioma, así que aparece en English.

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.

Archivos de esta versión

Permisos

PermisoDeclaradoHallado en el escaneo
Lee archivosNoNo
Escribe archivosSíSí
Ejecuta comandos de shellSíSí
Usa la redSíSí
Usa conectoresNoNo
Controla un navegadorNoNo

Hallazgos del escaneo

Revisado el 13 nov 2026

  1. AltaPrompt injection · injection.chat_markupreferences/api-reference.md:17
  2. AltaPrompt injection · injection.chat_markupreferences/api-reference.md:20
  3. MediaComando · command.pipe_to_shellSKILL.md:6
  4. MediaComando · command.base64_execSKILL.md:56
  5. MediaComando · command.base64_execreferences/api-reference.md:54
  6. MediaComando · command.pipe_to_shellreferences/api-reference.md:55
  7. MediaArchivo · Script ejecutable incluido con la skillscripts/agent.py
  8. MediaComando · command.base64_execscripts/agent.py:23
  9. MediaComando · command.pipe_to_shellscripts/agent.py:24
  10. InfoEnlace · Enlaces a dominios externos

Un escaneo limpio baja el riesgo, pero no prueba que el paquete sea seguro. Lee lo que instalas.

VersiónPublicadaCommitSHA-256FirmaCambio de permisos
v1.013 nov 202654a7988238de6c2Firmada–

Pregunta todo lo que tu alcance permite.

Crea la cuenta, añade créditos y haz la primera pregunta en el chat o en la terminal.

  1. 1/3

    Crea la cuenta

    Individual o empresa. Puedes pasar a empresa después sin perder saldo ni claves.

    IndividualEmpresa
  2. 2/3

    Añade créditos

    Con tarjeta. Pagas por token, sin suscripción.

    $5.00recarga mínima
  3. 3/3

    Pregunta

    En el chat, o instala el CLI y ejecuta notholy login en tu terminal.

    $ notholy login