Query Details
name: Execution, Potential PowerShell Downgrade Attack
description: Detects PowerShell downgrade attack through commandline analysis
references: https://detection.fyi/sigmahq/sigma/windows/process_creation/proc_creation_win_powershell_downgrade_attack
tags: Execution, T1059.001
search_query:
(DeviceProcessEvents
| where FileName in~ ("powershell.exe", "powershell_ise.exe")
| where ProcessCommandLine has "-v 2"
or ProcessCommandLine has "-v 2.0"
or ProcessCommandLine has "-version 2"
or ProcessCommandLine has "-versi 2"
or ProcessCommandLine has "-vers 2"
or ProcessCommandLine has "-ver 2"
or ProcessCommandLine has "-ve 2"
or ProcessCommandLine has "-ve 2"
or ProcessCommandLine has "-version 2.0"| where InitiatingProcessFileName != "MonitoringHost.exe")
This query is designed to detect potential PowerShell downgrade attacks by analyzing command line inputs. Here's a simplified summary:
DeviceProcessEvents).powershell.exe or powershell_ise.exe.-v 2, -version 2.0, etc.).MonitoringHost.exe.In essence, this query identifies instances where PowerShell is being run with commands that suggest a downgrade to version 2, which could be indicative of an attack, while ignoring legitimate monitoring processes.

Ali Hussein
Released: January 22, 2024
Tables
Keywords
Operators