Detection rules › Sigma
Microsoft Defender critical security components disabled (PowerShell)
Detects scenarios where an attacker attempts to disable Defender security features in PowerShell
MITRE ATT&CK coverage
| Tactic | Techniques |
|---|---|
| Stealth | T1562.001 Impair Defenses: Disable or Modify Tools |
Event coverage
| Provider | Event | Title |
|---|---|---|
| PowerShell | Event ID 4103 | Payload Context: ContextInfo User Data: UserData. |
| PowerShell | Event ID 4104 | Creating Scriptblock text (MessageNumber of MessageTotal). |
| PowerShell | Event ID 800 | Event ID 800 |
Rule body yaml
title: Microsoft Defender critical security components disabled (PowerShell)
description: Detects scenarios where an attacker attempts to disable Defender security features in PowerShell
references:
- https://github.com/mdecrevoisier/EVTX-to-MITRE-Attack/tree/master/TA0005-Defense%20Evasion/T1562.001-Impair%20Defenses-Disable%20or%20Modify%20tool
- https://github.com/swagkarna/Defeat-Defender-V1.2
- https://docs.microsoft.com/en-us/powershell/module/defender/set-mppreference?view=windowsserver2019-ps
- https://docs.microsoft.com/en-us/windows/client-management/mdm/defender-csp
- https://powershell.one/wmi/root/microsoft/windows/defender/msft_mppreference
- https://gist.github.com/pe3zx/7c5e0080c3b0869ccba1f1dc2ea0c5e0
- https://cloudbrothers.info/en/current-limits-defender-av-tamper-protection/
tags:
- attack.defense_evasion
- attack.t1562.001
author: mdecrevoisier
status: experimental
logsource:
product: windows
category:
- ps_module
- ps_classic_script
- ps_script
detection: # Set-MpPreference -DisableRealtimeMonitoring $true
selection1_powershell_native:
EventID: 800
EventData|contains: Set-MpPreference
EventData|contains:
- '1'
- '$true'
EventData|contains:
- DisableRealtimeMonitoring
- DisableBehaviorMonitoring
- DisableIOAVProtection # scans downloaded files and attachment
- DisableIntrusionPreventionSystem # network protection against exploitation of known vulnerabilities
- DisableInboundConnectionFiltering
selection2_powershell_modern:
EventID: 4103
EventData|contains: Set-MpPreference
Payload|contains:
- '1'
- '$true'
Payload|contains:
- DisableRealtimeMonitoring
- DisableBehaviorMonitoring
- DisableIOAVProtection # scans downloaded files and attachment
- DisableIntrusionPreventionSystem # network protection against exploitation of known vulnerabilities
- DisableInboundConnectionFiltering
selection3_powershell_block:
EventID: 4104
EventData|contains: Set-MpPreference
ScriptBlockText|contains:
- '1'
- '$true'
ScriptBlockText|contains:
- DisableRealtimeMonitoring
- DisableBehaviorMonitoring
- DisableIOAVProtection # scans downloaded files and attachment
- DisableIntrusionPreventionSystem # network protection against exploitation of known vulnerabilities
- DisableInboundConnectionFiltering
condition: 1 of selection*
falsepositives:
- None
level: high
Stages and Predicates
Stage 0: condition
1 of selection*Stage 1: selection1_powershell_native
selection1_powershell_native:
EventID: 800
EventData|contains: Set-MpPreference
EventData|contains:
- '1'
- '$true'
EventData|contains:
- DisableRealtimeMonitoring
- DisableBehaviorMonitoring
- DisableIOAVProtection
- DisableIntrusionPreventionSystem
- DisableInboundConnectionFiltering
Stage 2: selection2_powershell_modern
selection2_powershell_modern:
EventID: 4103
EventData|contains: Set-MpPreference
Payload|contains:
- '1'
- '$true'
Payload|contains:
- DisableRealtimeMonitoring
- DisableBehaviorMonitoring
- DisableIOAVProtection
- DisableIntrusionPreventionSystem
- DisableInboundConnectionFiltering
Stage 3: selection3_powershell_block
selection3_powershell_block:
EventID: 4104
EventData|contains: Set-MpPreference
ScriptBlockText|contains:
- '1'
- '$true'
ScriptBlockText|contains:
- DisableRealtimeMonitoring
- DisableBehaviorMonitoring
- DisableIOAVProtection
- DisableIntrusionPreventionSystem
- DisableInboundConnectionFiltering
Indicators
Each row is a field, operator, and value that the rule matches. The corpus column counts how many other rules in the catalog look for the same combination: high numbers point to widely-used, community-vetted indicators. Blank or 1 shows that the indicator is specific to this rule.
| Field | Kind | Values |
|---|---|---|
EventData | match |
|
Payload | match |
|
ScriptBlockText | match |
|