PowerShell adding exclusion path for Microsoft Defender of ProgramData


Description

Identify PowerShell creating an exclusion path of ProgramData directory for Microsoft Defender to not monitor.

Query · kql

DeviceProcessEvents 
| where FileName =~ "powershell.exe" and ProcessCommandLine has_all("try", "Add-MpPreference", "-ExclusionPath", "ProgramData", "catch")
Raw source PowerShell adding exclusion path for Microsoft Defender of ProgramData · KQL
Esc
Published by Azure/Azure-Sentinel ↗, licensed under MIT ↗. Reproduced here unmodified.
id: bd6e909c-dfb1-4f8f-a94a-14d417bbe87b
name: PowerShell adding exclusion path for Microsoft Defender of ProgramData
description: |
  Identify PowerShell creating an exclusion path of ProgramData directory for Microsoft Defender to not monitor.
requiredDataConnectors:
- connectorId: MicrosoftThreatProtection
  dataTypes:
  - DeviceProcessEvents
tactics:
- Defense Evasion
query: |   
  DeviceProcessEvents 
  | where FileName =~ "powershell.exe" and ProcessCommandLine has_all("try", "Add-MpPreference", "-ExclusionPath", "ProgramData", "catch")

Detection rules belong to the projects that publish them and remain under their own licenses. This site indexes and links to them; it claims no rights in them.