analyzing-powershell-script-block-logging
Parse Windows PowerShell Script Block Logs (Event ID 4104) from EVTX
v1.03 установки+3 за 7 дней36,3 тыс. ЗвездыApache-2.0синхронизировано 11 часов назад
Установка
Ещё нет NotHoly CLI? Сначала установите её.
$ curl -fsSL https://notholy.com/install.sh | sh$ notholy skills install mukul975/analyzing-powershell-script-block-loggingПишет в ~/.notholy/skills после проверки подписи и SHA-256.
ПодписьПодписано, ed25519
Пакет238de6c2…fa982a0f
238de6c25425…799efa982a0f4 файла · 8.2 KBПроверкаВысокий10 замечаний
- injection.chat_markupreferences/api-reference.md:17
- injection.chat_markupreferences/api-reference.md:20
- command.pipe_to_shellSKILL.md:6
Источникgithub.com/mukul975/Anthropic-Cybersecurity-Skills/tree/main/skills/analyzing-powershell-script-block-logging@54a7988
Эта запись еще не переведена на русский, поэтому показан текст на другом языке: 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
- 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.
Файлы этой версии
references/11.8 KB
- api-reference.md1.8 KB
scripts/17.9 KB
- agent.py7.9 KB
- LICENSE11.0 KB
- SKILL.md2.6 KB
Права
| Право | Заявлено | Найдено проверкой |
|---|---|---|
| Читает файлы | Нет | Нет |
| Пишет файлы | Да | Да |
| Выполняет команды shell | Да | Да |
| Ходит в сеть | Да | Да |
| Использует коннекторы | Нет | Нет |
| Управляет браузером | Нет | Нет |
Замечания проверки
Проверено 13 нояб. 2026 г.
- ВысокаяPrompt injection · injection.chat_markupreferences/api-reference.md:17
- ВысокаяPrompt injection · injection.chat_markupreferences/api-reference.md:20
- СредняяКоманда · command.pipe_to_shellSKILL.md:6
- СредняяКоманда · command.base64_execSKILL.md:56
- СредняяКоманда · command.base64_execreferences/api-reference.md:54
- СредняяКоманда · command.pipe_to_shellreferences/api-reference.md:55
- СредняяФайл · Исполняемый скрипт в составе навыкаscripts/agent.py
- СредняяКоманда · command.base64_execscripts/agent.py:23
- СредняяКоманда · command.pipe_to_shellscripts/agent.py:24
- ИнфоСсылка · Ссылки на внешние домены
Чистая проверка снижает риск, но не доказывает, что пакет безопасен. Читайте то, что ставите.
| Версия | Опубликована | Коммит | SHA-256 | Подпись | Изменение прав |
|---|---|---|---|---|---|
| v1.0 | 13 нояб. 2026 г. | 54a7988 | 238de6c2 | Подписана | – |
Ещё от mukul975
Всё от этого издателя- 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
Еще в категории «Active Directory и Windows»
Вся категорияСпрашивайте обо всём, что позволяет ваш скоуп.
Создайте аккаунт, пополните баланс и задайте первый вопрос в чате или в терминале.
- 1/3
Создайте аккаунт
Личный или для компании. Позже можно перейти на аккаунт компании без потери баланса и ключей.
ЛичныйКомпания - 2/3
Пополните баланс
Картой. Оплата за токены, без подписки.
$5.00минимальное пополнение - 3/3
Спрашивайте
В чате, или установите CLI и выполните notholy login в терминале.
$ notholy login