Potential PowerShell Obfuscated Script via High Entropy

Last updated 2 months ago on 2026-01-08
Created 2 months ago on 2026-01-08

About

Identifies PowerShell script blocks with high entropy and non-uniform character distributions. Attackers may obfuscate PowerShell scripts using encoding, encryption, or compression techniques to evade signature-based detections and hinder manual analysis by security analysts.
Tags
Domain: EndpointOS: WindowsUse Case: Threat DetectionTactic: Defense EvasionData Source: PowerShell LogsLanguage: kuery
Severity
low
Risk Score
21
MITRE ATT&CK™

Defense Evasion (TA0005)(external, opens in a new tab or window)

Execution (TA0002)(external, opens in a new tab or window)

False Positive Examples
Legitimate large or encoded PowerShell scripts (automation frameworks, installers, or admin tooling) can exhibit high entropy or uneven character distributions.
License
Elastic License v2(external, opens in a new tab or window)

Definition

Rule Type
Query (Kibana Query Language)
Integration Pack
Prebuilt Security Detection Rules
Index Patterns
logs-windows.powershell*
Related Integrations

windows(external, opens in a new tab or window)

Query
text code block:
event.category:process and host.os.type:windows and powershell.file.script_block_length > 1000 and powershell.file.script_block_entropy_bits >= 5.3 and powershell.file.script_block_surprisal_stdev > 0.7 and not file.directory: "C:\Program Files (x86)\Microsoft Intune Management Extension\Content\DetectionScripts"

Install detection rules in Elastic Security

Detect Potential PowerShell Obfuscated Script via High Entropy in the Elastic Security detection engine by installing this rule into your Elastic Stack.

To setup this rule, check out the installation guide for Prebuilt Security Detection Rules(external, opens in a new tab or window).