PowerShell ScriptBlock Logging: Set-MpPreference disables Windows Defender scanning or allows threats

Alert on PowerShell Set-MpPreference usage that disables Defender scanning/monitoring or sets threat default actions to Allow.

FreeReviewedSigma · High · v2
Product
windows
Category
ps_script
Author
frack113, elhoim, Tim Shelton (fps, alias support), Swachchhanda Shrawan Poudel, Nasreddine Bencherchali (Nextron Systems) (SigmaHQ), DRL 1.1
Published
2022-01-16
Updated
2026-07-31

ATT&CK techniques

  1. Recon

  2. Resource Dev

  3. Initial Access

  4. Execution

  5. Persistence

  6. Priv Esc

  7. Defense Evasion

  8. Cred Access

  9. Discovery

  10. Lateral Movement

  11. Collection

  12. C2

  13. Exfiltration

  14. Impact

What it detects

This rule flags PowerShell script content that calls Set-MpPreference to disable multiple Windows Defender scanning and protection components, such as real-time monitoring and various scanning modes. It also matches attempts to change defender default actions to Allow for different threat severities. Attackers may use these preference changes to reduce detection and prevention while running malicious activity. Telemetry relies on Script Block Logging capturing the ScriptBlockText within PowerShell executions.

Related detections9 linkedT1685 — drag to rearrange
Suspicious Vulnerable Intel Ethernet Driver Load for BYOVD via SCATTERED SPIDER (via driver_load)
Malicious Defender Disable And Executable Exclusion Via Registry
Malicious UAC Disable via EnableLUA Registry Modification (via registry_set)
Malicious AMSI and ETW Patching via PowerShell Script
Malicious PowMix AMSI Bypass via amsiInitFailed
Suspicious ThrottleStop Driver Abuse for Defense Evasion in Ransomware Attacks
Malicious Disabling of Microsoft Defender Real-Time Protection via SystemSettingsAdminFlows by DeadLock Ransomware
Suspicious Security Software Uninstallation via WMIC Product Call Uninstall (Chaos Ransomware)
Suspicious Security Product Uninstall via wmic product call uninstall
PowerShell ScriptBlock Logging: Set-MpPreference disables Windows Defender scanning or allows threats
Pivot detection · T1685 · 9 related

Changelog

v2
  1. v2
    Candidate ingested via manual entry.2026-07-31
  2. v1
    No changelog recorded for this version.2026-07-30

Detection content is published as a reviewed draft. Tune thresholds and exclusions against your own telemetry before enabling this rule for alerting.