← Back to SOC feed Coverage →

Detect PowerShell v2 Downgrade

kql MEDIUM Azure-Sentinel
DeviceImageLoadEvents
evasionhuntingmicrosoftofficialpowershell
This rule was pulled from an open-source repository and enriched with AI. Validate in a test environment before deploying to production.
View original rule at Azure-Sentinel →
Retrieved: 2026-05-19T23:00:00Z · Confidence: medium

Hunt Hypothesis

Adversaries may downgrade to PowerShell v2 to exploit deprecated features or bypass modern security controls. SOC teams should proactively hunt for this behavior in Azure Sentinel to identify potential lateral movement or persistence tactics that leverage older, less secure PowerShell versions.

KQL Query

DeviceImageLoadEvents
| where InitiatingProcessFileName =~ 'powershell.exe'
    and FileName in~ ('system.management.automation.ni.dll','System.Management.Automation.dll')
    and FolderPath matches regex @"[12]\.(\d)+\.(\d)+\.(\d)+"

Analytic Rule Definition

id: 70c41ff4-b95a-43a3-8fb5-794ed69be100
name: Detect PowerShell v2 Downgrade
description: |
  This query looks for processes that load an older version of the system.management.automation libraries. While not inherently malicious, downgrading to PowerShell version 2
  can enable an attacker to bypass some of the protections afforded by modern PowerShell. It is worth noting that some tools and scripts perform this to enable
  backwards compatibility, so the technique is not inherently malicious. You will likely need to filter the processes within your environment that legitimately use this
  capability for this to be effective.
requiredDataConnectors:
- connectorId: MicrosoftThreatProtection
  dataTypes:
  - DeviceImageLoadEvents
tactics:
- Execution
query: |
  DeviceImageLoadEvents
  | where InitiatingProcessFileName =~ 'powershell.exe'
      and FileName in~ ('system.management.automation.ni.dll','System.Management.Automation.dll')
      and FolderPath matches regex @"[12]\.(\d)+\.(\d)+\.(\d)+"

Required Data Sources

Sentinel TableNotes
DeviceImageLoadEventsEnsure this data connector is enabled

MITRE ATT&CK Context

References

False Positive Guidance

Original source: https://github.com/Azure/Azure-Sentinel/blob/main/Hunting Queries/Microsoft 365 Defender/Execution/Detect PowerShell v2 Downgrade.yaml