Rare Powershell Script

Last updated 2 days ago on 2026-04-01
Created 7 days ago on 2026-03-27

About

A machine learning job detected a rare PowerShell script, identified by its script block hash, that may indicate execution of malware, or persistence mechanisms. Unlike anomaly detection based on content entropy, this rule identifies scripts that have rarely or never been seen in the environment.
Tags
Domain: EndpointOS: WindowsUse Case: Threat DetectionRule Type: MLRule Type: Machine LearningTactic: Execution
Severity
low
Risk Score
21
MITRE ATT&CK™

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

False Positive Examples
A newly installed program or one that runs rarely as part of a monthly or quarterly workflow could trigger this alert. PowerShell scripts that are new to the environment or run infrequently may trigger this alert.
License
Elastic License v2(external, opens in a new tab or window)

Definition

Rule Type
Machine Learning
Integration Pack
Prebuilt Security Detection Rules
Related Integrations

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

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

Query
text code block:

Install detection rules in Elastic Security

Detect Rare Powershell Script 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).