Windows PowerShell: Disable Microsoft Defender Scanning via Set-MpPreference
Flags PowerShell commands that disable Microsoft Defender scanning/protection settings using Set-MpPreference, including encoded variants.
- Product
- windows
- Category
- process_creation
- Author
- Florian Roth (Nextron Systems) (SigmaHQ), DRL 1.1
- Published
- 2022-03-03
- Updated
- 2026-07-30
ATT&CK techniques
Recon
Resource Dev
Initial Access
Execution
Persistence
Priv Esc
Defense Evasion
Cred Access
Discovery
Lateral Movement
Collection
C2
Exfiltration
Impact
What it detects
This rule identifies PowerShell process executions that use Set-MpPreference to disable Microsoft Defender scanning and related protections (e.g., archive scanning, real-time monitoring, IOAV, and behavior monitoring). Attackers may impair endpoint defenses to reduce detection and increase the likelihood of persistence or successful execution. It relies on Windows process creation telemetry capturing the PowerShell command line, including both plain-text parameters and Base64-encoded command content or modifiers.
Reporting behind it
- learn.microsoft.comhttps://learn.microsoft.com/en-us/powershell/module/defender/set-mppreference?view=windowsserver2022-ps
- virustotal.comhttps://www.virustotal.com/gui/file/d609799091731d83d75ec5d1f030571af20c45efeeb94840b67ea09a3283ab65/behavior/C2AE
- virustotal.comhttps://www.virustotal.com/gui/search/content%253A%2522Set-MpPreference%2520-Disable%2522/files
- github.comhttps://github.com/SigmaHQ/sigma/blob/master/rules/windows/process_creation/proc_creation_win_powershell_defender_disable_feature.yml
Detection content is published as a reviewed draft. Tune thresholds and exclusions against your own telemetry before enabling this rule for alerting.
title: "Windows PowerShell: Disable Microsoft Defender Scanning via Set-MpPreference"
id: 80ac1930-d17d-4cee-8816-6acb1acc707a
status: test
description: This rule identifies PowerShell process executions that use Set-MpPreference to disable Microsoft Defender scanning and related protections (e.g., archive scanning, real-time monitoring, IOAV, and behavior monitoring). Attackers may impair endpoint defenses to reduce detection and increase the likelihood of persistence or successful execution. It relies on Windows process creation telemetry capturing the PowerShell command line, including both plain-text parameters and Base64-encoded command content or modifiers.
references:
- https://learn.microsoft.com/en-us/powershell/module/defender/set-mppreference?view=windowsserver2022-ps
- https://www.virustotal.com/gui/file/d609799091731d83d75ec5d1f030571af20c45efeeb94840b67ea09a3283ab65/behavior/C2AE
- https://www.virustotal.com/gui/search/content%253A%2522Set-MpPreference%2520-Disable%2522/files
- https://github.com/SigmaHQ/sigma/blob/master/rules/windows/process_creation/proc_creation_win_powershell_defender_disable_feature.yml
author: Florian Roth (Nextron Systems), Huntrule Team
date: 2022-03-03
modified: 2024-01-02
tags:
- attack.defense-impairment
- attack.t1685
logsource:
category: process_creation
product: windows
detection:
selection_cli_cmdlet:
CommandLine|contains:
- "Add-MpPreference "
- "Set-MpPreference "
selection_cli_option:
CommandLine|contains:
- "DisableArchiveScanning "
- "DisableRealtimeMonitoring "
- "DisableIOAVProtection "
- "DisableBehaviorMonitoring "
- "DisableBlockAtFirstSeen "
- "DisableCatchupFullScan "
- "DisableCatchupQuickScan "
selection_cli_value:
CommandLine|contains:
- $true
- " 1 "
selection_encoded_modifier:
CommandLine|base64offset|contains:
- "disablearchivescanning "
- "DisableArchiveScanning "
- "disablebehaviormonitoring "
- "DisableBehaviorMonitoring "
- "disableblockatfirstseen "
- "DisableBlockAtFirstSeen "
- "disablecatchupfullscan "
- "DisableCatchupFullScan "
- "disablecatchupquickscan "
- "DisableCatchupQuickScan "
- "disableioavprotection "
- "DisableIOAVProtection "
- "disablerealtimemonitoring "
- "DisableRealtimeMonitoring "
selection_encoded_direct:
CommandLine|contains:
- RABpAHMAYQBiAGwAZQBSAGUAYQBsAHQAaQBtAGUATQBvAG4AaQB0AG8AcgBpAG4AZwAgA
- QAaQBzAGEAYgBsAGUAUgBlAGEAbAB0AGkAbQBlAE0AbwBuAGkAdABvAHIAaQBuAGcAIA
- EAGkAcwBhAGIAbABlAFIAZQBhAGwAdABpAG0AZQBNAG8AbgBpAHQAbwByAGkAbgBnACAA
- RABpAHMAYQBiAGwAZQBJAE8AQQBWAFAAcgBvAHQAZQBjAHQAaQBvAG4AIA
- QAaQBzAGEAYgBsAGUASQBPAEEAVgBQAHIAbwB0AGUAYwB0AGkAbwBu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ByAGkAbgBnACAA
- ZABpAHMAYQBiAGwAZQBiAGwAbwBjAGsAYQB0AGYAaQByAHMAdABzAGUAZQBuACAA
- QAaQBzAGEAYgBsAGUAYgBsAG8AYwBrAGEAdABmAGkAcgBzAHQAcwBlAGUAbgAgA
- kAGkAcwBhAGIAbABlAGIAbABvAGMAawBhAHQAZgBpAHIAcwB0AHMAZQBlAG4AIA
- RABpAHMAYQBiAGwAZQBDAGEAdABjAGgAdQBwAEYAdQBsAGwAUwBjAGEAbgA
- RABpAHMAYQBiAGwAZQBDAGEAdABjAGgAdQBwAFEAdQBpAGMAawBTAGMAYQBuAA
- RABpAHMAYQBiAGwAZQBBAHIAYwBoAGkAdgBlAFMAYwBhAG4AbgBpAG4AZwA
condition: all of selection_cli_* or 1 of selection_encoded_*
falsepositives:
- Possible administrative activity
- Other Cmdlets that may use the same parameters
level: high
license: DRL-1.1
related:
- id: 1ec65a5f-9473-4f12-97da-622044d6df21
type: derived