deobfuscating-malicious-powershell
Deobfuscates malicious PowerShell by decoding -EncodedCommand, reversing string
v1.0.03 установки+3 за 7 дней24 ЗвездыApache-2.0синхронизировано 10 часов назад
Установка
Ещё нет NotHoly CLI? Сначала установите её.
$ curl -fsSL https://notholy.com/install.sh | sh$ notholy skills install meltedinhex/deobfuscating-malicious-powershellПишет в ~/.notholy/skills после проверки подписи и SHA-256.
ПодписьПодписано, ed25519
Пакет4dd88965…d95b1ce4
4dd88965f708…a5b9d95b1ce44 файла · 3.6 KBПроверкаСредний12 замечаний
- command.pipe_to_shellSKILL.md:4
- command.pipe_to_shellSKILL.md:37
- command.pipe_to_shellSKILL.md:39
Источникgithub.com/meltedinhex/analyst-ai-pack/tree/main/skills/deobfuscating-malicious-powershell@da7600a
Эта запись еще не переведена на русский, поэтому показан текст на другом языке: English.
На странице
When to Use
- You captured an obfuscated PowerShell command from a log, maldoc, or phishing payload.
- You need to recover the real intent: download URLs, dropped paths, shellcode, or next stage.
- You are unrolling layered encoding (base64 → gzip → IEX) to reach the final script.
Do not use Invoke-Expression or run the script to "see what it does" on a working host.
Decode statically; only execute in the isolated lab with logging if dynamic confirmation is
required.
Prerequisites
- Python (bundled script handles base64/gzip/deflate and common transforms), or a sandbox.
- The command/script text captured as a string.
Safety & Handling
- Never pipe attacker PowerShell into a live shell. Replace
IEX/Invoke-Expressionwith output (print) when transforming. - Treat decoded URLs/IPs as live; defang before sharing.
Workflow
Step 1: Decode -EncodedCommand
-EncodedCommand (-enc) is base64 of UTF-16LE. Decode it first:
python scripts/analyst.py decode --encodedcommand "<base64>"Step 2: Identify the obfuscation style
Common patterns:
String reversal : [array]::Reverse / -join with [-1..]
Format operator : ("{1}{0}" -f 'b','a') -> 'ab'
Char codes : [char]104 + [char]105
Concatenation/splits : 'po'+'wer'+'shell', -split / -replace tricks
Backtick/casing noise : I`E`X, iEx, &('i'+'ex')Step 3: Unroll encoding layers
Resolve nested FromBase64String, gzip/deflate (IO.Compression), and re-IEX layers until
you reach plain script. The script peels base64/gzip layers automatically.
python scripts/analyst.py deobfuscate payload.ps1Step 4: Neutralize execution sinks
Replace IEX, Invoke-Expression, &, and .Invoke() with a print so the recovered script
is rendered, not run.
Step 5: Extract IOCs
Pull DownloadString/DownloadFile URLs, C2 hosts, dropped paths, and any embedded
base64 shellcode for separate analysis.
Validation
- The fully decoded script is human-readable PowerShell with no remaining base64 blobs.
- Execution sinks are neutralized; nothing in your workflow actually ran the payload.
- Extracted URLs/paths are consistent with the script's logic.
Pitfalls
- Running the script to decode it — the fastest way to get compromised.
- Stopping after one base64 layer when several are nested.
- Missing UTF-16LE vs UTF-8 when decoding
-enc(it is UTF-16LE). - Ignoring
-replace/-ftransforms that rebuild commands at runtime.
References
- See
references/api-reference.mdfor the decoder/deobfuscator. - PowerShell encoded-command docs and PSDecode (linked in frontmatter).
Файлы этой версии
references/11.4 KB
- api-reference.md1.4 KB
scripts/13.2 KB
- analyst.py3.2 KB
- LICENSE340 B
- SKILL.md3.4 KB
Права
| Право | Заявлено | Найдено проверкой |
|---|---|---|
| Читает файлы | Нет | Нет |
| Пишет файлы | Нет | Нет |
| Выполняет команды shell | Да | Да |
| Ходит в сеть | Да | Да |
| Использует коннекторы | Нет | Нет |
| Управляет браузером | Нет | Нет |
Замечания проверки
Проверено 13 нояб. 2026 г.
- СредняяКоманда · command.pipe_to_shellSKILL.md:4
- СредняяКоманда · command.pipe_to_shellSKILL.md:37
- СредняяКоманда · command.pipe_to_shellSKILL.md:39
- СредняяКоманда · command.pipe_to_shellSKILL.md:50
- СредняяКоманда · command.pipe_to_shellSKILL.md:73
- СредняяКоманда · command.pipe_to_shellSKILL.md:78
- СредняяКоманда · command.base64_execSKILL.md:78
- СредняяКоманда · command.pipe_to_shellSKILL.md:87
- СредняяКоманда · command.pipe_to_shellreferences/api-reference.md:6
- СредняяКоманда · command.pipe_to_shellreferences/api-reference.md:32
- СредняяФайл · Исполняемый скрипт в составе навыкаscripts/analyst.py
- ИнфоСсылка · Ссылки на внешние домены
Чистая проверка снижает риск, но не доказывает, что пакет безопасен. Читайте то, что ставите.
| Версия | Опубликована | Коммит | SHA-256 | Подпись | Изменение прав |
|---|---|---|---|---|---|
| v1.0.0 | 13 нояб. 2026 г. | da7600a | 4dd88965 | Подписана | – |
Ещё от meltedinhex
Всё от этого издателя- writing-yara-rules-from-reversed-codemeltedinhex/writing-yara-rules-from-reversed-code4
- validating-detections-with-atomic-testsmeltedinhex/validating-detections-with-atomic-tests4
- writing-suricata-and-snort-rulesmeltedinhex/writing-suricata-and-snort-rules3
- writing-sigma-detection-rulesmeltedinhex/writing-sigma-detection-rules3
Еще в категории «Реверс-инжиниринг и фаззинг»
Вся категорияСпрашивайте обо всём, что позволяет ваш скоуп.
Создайте аккаунт, пополните баланс и задайте первый вопрос в чате или в терминале.
- 1/3
Создайте аккаунт
Личный или для компании. Позже можно перейти на аккаунт компании без потери баланса и ключей.
ЛичныйКомпания - 2/3
Пополните баланс
Картой. Оплата за токены, без подписки.
$5.00минимальное пополнение - 3/3
Спрашивайте
В чате, или установите CLI и выполните notholy login в терминале.
$ notholy login