analyzing-powershell-script-block-logging
Parse Windows PowerShell Script Block Logs (Event ID 4104) from EVTX
v1.03 instalações+3 em 7 dias36,3 mil EstrelasApache-2.0sincronizado há 11 horas
Instalar
Ainda não tem a CLI da NotHoly? Instale primeiro.
$ curl -fsSL https://notholy.com/install.sh | sh$ notholy skills install mukul975/analyzing-powershell-script-block-loggingGrava em ~/.notholy/skills depois de conferir a assinatura e o SHA-256.
AssinaturaAssinado, ed25519
Pacote238de6c2…fa982a0f
238de6c25425…799efa982a0f4 arquivos · 8.2 KBVarreduraAlto10 achados
- injection.chat_markupreferences/api-reference.md:17
- injection.chat_markupreferences/api-reference.md:20
- command.pipe_to_shellSKILL.md:6
Fontegithub.com/mukul975/Anthropic-Cybersecurity-Skills/tree/main/skills/analyzing-powershell-script-block-logging@54a7988
Este item ainda não foi escrito no seu idioma, então aparece em English.
Nesta página
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
- Install dependencies:
pip install python-evtx lxml - Collect PowerShell Operational logs:
Microsoft-Windows-PowerShell%4Operational.evtx - Parse Event ID 4104 entries using python-evtx to extract ScriptBlockText, ScriptBlockId, and MessageNumber/MessageTotal for multi-part script reconstruction.
- 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)
- Base64-encoded commands (
- 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.jsonExamples
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.
Arquivos desta versão
references/11.8 KB
- api-reference.md1.8 KB
scripts/17.9 KB
- agent.py7.9 KB
- LICENSE11.0 KB
- SKILL.md2.6 KB
Permissões
| Permissão | Declarada | Encontrada na varredura |
|---|---|---|
| Lê arquivos | Não | Não |
| Grava arquivos | Sim | Sim |
| Roda comandos no shell | Sim | Sim |
| Usa a rede | Sim | Sim |
| Usa conectores | Não | Não |
| Controla um navegador | Não | Não |
Achados da varredura
Revisado em 13 de nov. de 2026
- AltaPrompt injection · injection.chat_markupreferences/api-reference.md:17
- AltaPrompt injection · injection.chat_markupreferences/api-reference.md:20
- MédiaComando · command.pipe_to_shellSKILL.md:6
- MédiaComando · command.base64_execSKILL.md:56
- MédiaComando · command.base64_execreferences/api-reference.md:54
- MédiaComando · command.pipe_to_shellreferences/api-reference.md:55
- MédiaArquivo · Script executável junto com a skillscripts/agent.py
- MédiaComando · command.base64_execscripts/agent.py:23
- MédiaComando · command.pipe_to_shellscripts/agent.py:24
- InfoLink · Links para domínios externos
Uma varredura limpa reduz o risco, mas não prova que o pacote é seguro. Leia o que você instala.
| Versão | Publicada em | Commit | SHA-256 | Assinatura | Mudança de permissão |
|---|---|---|---|---|---|
| v1.0 | 13 de nov. de 2026 | 54a7988 | 238de6c2 | Assinada | – |
Mais de mukul975
Tudo deste publicador- testing-for-xml-injection-vulnerabilitiesmukul975/testing-for-xml-injection-vulnerabilities5
- testing-for-sensitive-data-exposuremukul975/testing-for-sensitive-data-exposure5
- performing-jwt-none-algorithm-attackmukul975/performing-jwt-none-algorithm-attack5
- detecting-aws-credential-exposure-with-trufflehogmukul975/detecting-aws-credential-exposure-with-trufflehog5
Mais em Active Directory e Windows
Ver a categoriaPergunte tudo o que o seu escopo permite.
Crie a conta, adicione créditos e faça a primeira pergunta no chat ou no terminal.
- 1/3
Crie a conta
Individual ou empresa. Dá para virar empresa depois sem perder saldo nem chaves.
Pessoa físicaEmpresa - 2/3
Adicione créditos
No cartão. Você paga por token, sem assinatura.
$5.00recarga mínima - 3/3
Pergunte
No chat, ou instale o CLI e rode notholy login no terminal.
$ notholy login