SOP-28: Defense Evasion / Security Tool Tampering Response

·

Defense evasion via security tool tampering is the final preparation step before most ransomware deployments and advanced persistent threat (APT) lateral movements. Attackers disable Microsoft Defender, inject AV exclusion paths, stop the MDE sensor service, or patch Event Tracing for Windows (ETW) to blind the SOC before executing destructive payloads. This SOP treats any confirmed security tool disable or AV exclusion injection as a SEV1 precursor event requiring immediate isolation — because the attack payload execution is almost certainly imminent.

Key data sources: DeviceProcessEvents (sc.exe, powershell.exe Set-MpPreference), DeviceRegistryEvents (Defender Exclusions registry keys), DeviceEvents (Tamper Protection disable alerts from MDE sensor).

☰ Table of Contents

01 Background 02 Identification 03 Containment 04 Eradication 05 Escalation
🛠

01 — BACKGROUND

TECHNIQUE OVERVIEW
01
Technique Overview — Defense Evasion
MITRE T1562

Defense evasion via security tool impairment (T1562) is consistently observed in the pre-encryption phase of ransomware attacks and in APT lateral movement campaigns. Attackers disable or modify security tools to prevent detection of their subsequent actions — payload execution, credential dumping, and data exfiltration. This is the "lights-out" step before the main attack.

FieldValue
MITRE TechniqueT1562.001 — Impair Defenses: Disable or Modify Tools
T1562.006 — Impair Defenses: Indicator Blocking (ETW patching)
Kill-chain PhaseDefense Evasion (pre-execution)
Primary Log SourceDeviceProcessEvents, DeviceRegistryEvents, DeviceEvents (MDE)
Secondary Log SourcesSecurityEvent 4703 (privilege use), WindowsEvent 7035 (service stopped)
Common Toolingsc.exe, net.exe stop, powershell.exe (Set-MpPreference, Add-MpPreference), reg.exe, mpcmdrun.exe
Default SeveritySEV1 precursor — treat as active attack in progress
Detection WindowQuery last 1 hour minimum; extend to 24 hours for hunting

Security tool disablement immediately preceding payload execution is the most reliable precursor indicator for ransomware. Any confirmed Defender disable without a change-ticket MUST be treated as SEV1 — assume payload is seconds to minutes away.

🔍

02 — IDENTIFICATION

2 INDICATORS
▶ Investigation Workflow
I1
Defender / AV Service Disable or Tamper
T1562.001
WHY CHECK

Attackers stop or delete the WinDefend / MsSense service and disable real-time protection immediately before payload execution. This event has virtually no legitimate administrative use outside a documented change window — any unticket occurrence is a confirmed attack precursor.

📍 Portal Navigation — Microsoft 365 Defender
security.microsoft.com› Hunting› Advanced Hunting
  • 1In the left sidebar click Hunting, then Advanced Hunting.
  • 2Paste the KQL query below into the query editor.
  • 3Set Time range to Last 1 hour (expand to 24h for hunting).
  • 4Click Run query. For any result, click the row and open the Device Timeline from the DeviceName link to see the full execution chain.
  • 5Navigate to Incidents & alerts → Alerts and filter by Microsoft Defender Antivirus to check for co-incident Tamper Protection alerts.
Command / IndicatorMeaningSeverity
sc stop WinDefendStops Windows Defender service — real-time protection haltedCRITICAL
sc delete WinDefendDeletes Defender service entry — requires re-install to restoreCRITICAL
sc stop MsSenseStops Microsoft Defender for Endpoint sensor — telemetry blackoutCRITICAL
Set-MpPreference -DisableRealtimeMonitoring $trueDisables real-time protection via PowerShellCRITICAL
Set-MpPreference -DisableAntiSpyware $trueDisables antispyware engine componentCRITICAL
Set-MpPreference -DisableBehaviorMonitoring $trueDisables behavioral monitoring (blocks AMSI/heuristics)HIGH
netsh advfirewall set allprofiles state offDisables Windows Firewall on all profilesHIGH
bcdedit /set {default} recoveryenabled NoDisables Windows Recovery — ransomware pre-stepHIGH
vssadmin delete shadows /allDeletes all Volume Shadow Copies — ransomware recovery preventionCRITICAL
DETECTS: sc.exe stopping/deleting Defender or MDE sensor; PowerShell Set-MpPreference disablement; firewall off; VSS deletion; recovery disable
KQL — Microsoft Sentinel / Defender XDR Advanced Hunting
DeviceProcessEvents | where Timestamp > ago(1h) | where (FileName =~ "sc.exe" and ProcessCommandLine has_any ("stop WinDefend","delete WinDefend","stop MsSense","stop Sense","stop WdNisSvc")) or (FileName =~ "net.exe" and ProcessCommandLine has_any ("stop WinDefend","stop MsSense","stop Sense")) or (FileName =~ "powershell.exe" and ProcessCommandLine has_any ( "DisableRealtimeMonitoring","DisableBehaviorMonitoring","DisableIOAVProtection", "DisableAntiSpyware","DisableAntiVirus","DisableIntrusionPreventionSystem")) or (FileName =~ "netsh.exe" and ProcessCommandLine has "advfirewall" and ProcessCommandLine has "off") or (FileName =~ "bcdedit.exe" and ProcessCommandLine has "recoveryenabled") or (FileName =~ "vssadmin.exe" and ProcessCommandLine has "delete shadows") | project Timestamp, DeviceName, AccountName, FileName, ProcessCommandLine, InitiatingProcessFileName, InitiatingProcessCommandLine, InitiatingProcessParentFileName | order by Timestamp desc
DETECTS: Same coverage in Splunk — sc.exe, net.exe, PowerShell, netsh, bcdedit, vssadmin activity targeting security services
SPL — Splunk
index=mde sourcetype=DeviceProcessEvents | where (FileName="sc.exe" AND (like(ProcessCommandLine,"%stop WinDefend%") OR like(ProcessCommandLine,"%delete WinDefend%") OR like(ProcessCommandLine,"%stop MsSense%"))) OR (FileName="powershell.exe" AND (like(ProcessCommandLine,"%DisableRealtimeMonitoring%") OR like(ProcessCommandLine,"%DisableAntiSpyware%") OR like(ProcessCommandLine,"%DisableBehaviorMonitoring%"))) OR (FileName="netsh.exe" AND like(ProcessCommandLine,"%advfirewall%off%")) OR (FileName="vssadmin.exe" AND like(ProcessCommandLine,"%delete shadows%")) OR (FileName="bcdedit.exe" AND like(ProcessCommandLine,"%recoveryenabled%")) | table _time DeviceName AccountName FileName ProcessCommandLine InitiatingProcessFileName | sort -_time
I2
AV Exclusion Injection & ETW Indicator Blocking
T1562.001 / T1562.006
WHY CHECK

Adding AV exclusion paths via registry or PowerShell allows attackers to drop and execute payloads in a "blind spot" that Defender will not scan. ETW patching (modifying NtTraceControl or EtwpNotificationThread in ntdll.dll) prevents Event Tracing events from reaching the SIEM. Both are highly targeted evasion techniques used in hands-on-keyboard intrusions.

📍 Portal Navigation — MDE Registry Events
security.microsoft.com› Hunting› Advanced Hunting
  • 1Open Advanced Hunting and run the DeviceRegistryEvents query below targeting Defender Exclusions registry paths.
  • 2For any hit, check InitiatingProcessFileName and InitiatingProcessCommandLine to determine whether the change came from a known admin tool or an unexpected process.
  • 3Cross-reference with I1 — an exclusion addition immediately followed by a Defender disable is a confirmed attack chain.
  • 4For ETW patching: check DeviceEvents for NtTraceControl or EtwEventWrite memory write events from unexpected processes (rare in default MDE telemetry; requires enhanced coverage).
  • 5Check Add-MpPreference in PowerShell command lines — this is the most common exclusion injection method in ransomware pre-attack scripts.
Registry Path / CommandMeaningSeverity
SOFTWARE\Microsoft\Windows Defender\Exclusions\PathsExclusion path added — files in this path skip AV scanningCRITICAL
SOFTWARE\Microsoft\Windows Defender\Exclusions\ExtensionsFile extension excluded — e.g. .exe, .dll bypasses scanningCRITICAL
Add-MpPreference -ExclusionPathPowerShell exclusion injection — common ransomware dropper techniqueCRITICAL
SOFTWARE\Policies\Microsoft\Windows DefenderGroup Policy Defender settings modified — can disable entire AV via policyHIGH
MpCmdRun.exe -RemoveDefinitions -AllRemoves all Defender signature definitionsHIGH
ETW NtTraceControl patchIn-memory patch to disable ETW telemetry — advanced actor techniqueCRITICAL
DETECTS: Registry writes to Defender Exclusions keys; any process modifying AV exclusion paths or policy overrides
KQL — Defender Exclusion Registry Writes
DeviceRegistryEvents | where Timestamp > ago(1h) | where RegistryKey has_any ( "SOFTWARE\\Microsoft\\Windows Defender\\Exclusions", "SOFTWARE\\Policies\\Microsoft\\Windows Defender", "SOFTWARE\\Microsoft\\Windows Defender\\Features") | where ActionType == "RegistryValueSet" | project Timestamp, DeviceName, AccountName, RegistryKey, RegistryValueName, RegistryValueData, InitiatingProcessFileName, InitiatingProcessCommandLine, InitiatingProcessParentFileName | order by Timestamp desc
DETECTS: PowerShell Add-MpPreference or Set-MpPreference exclusion injection via process commandline
KQL — PowerShell Exclusion Injection
DeviceProcessEvents | where Timestamp > ago(1h) | where FileName =~ "powershell.exe" and ProcessCommandLine has_any ("ExclusionPath","ExclusionExtension","ExclusionProcess","ExclusionIpAddress","Add-MpPreference","MpCmdRun") | project Timestamp, DeviceName, AccountName, ProcessCommandLine, InitiatingProcessFileName, InitiatingProcessCommandLine | order by Timestamp desc
SPL — Defender Exclusion Registry Writes
index=mde sourcetype=DeviceRegistryEvents ActionType=RegistryValueSet (RegistryKey="*Windows Defender*Exclusions*" OR RegistryKey="*Policies*Windows Defender*") | table _time DeviceName AccountName RegistryKey RegistryValueName RegistryValueData InitiatingProcessFileName | sort -_time

ETW patching is rare but devastating — it prevents Sysmon, MDE, and most EDRs from recording events. If a process with no known hash performs NtWriteVirtualMemory into ntdll.dll address space, escalate immediately. Enhanced MDE telemetry (device isolation + live response) is required to confirm ETW patching in-flight.

🚫

03 — CONTAINMENT

IMMEDIATE ACTION
C1
Verdict & Escalation Decision
DECISION GATE
▶ Triage Verdict — Select One
CONFIRMED Defender service stopped, AV exclusion added, or VSS deleted with no change ticket — SEV1, isolate endpoint immediately, page SOC Lead + CISO
PARTIAL Registry write to Exclusions key but no service stop; single PowerShell Set-MpPreference in isolation — SEV2, verify change ticket, isolate if unverified within 15 minutes
FALSE POSITIVE sc.exe from SYSTEM or TrustedInstaller with Windows Update in parent chain; documented admin task with matching change ticket and normal working hours — close with justification, tune detection

Never accept "it was an admin" without a change ticket. Threat actors frequently use stolen admin credentials to disable defenses. Verify the change ticket references this specific device, this specific change, within this time window.

C2
Isolate Endpoint & Preserve Forensic State
MDE ISOLATION
📍 Portal Navigation — MDE Device Isolation
security.microsoft.com› Assets› Devices› [Device Name]› Isolate Device
  • 1Navigate to the affected device in Assets → Devices. Click the device name.
  • 2Click Actions (⋮) in the top-right and select Isolate Device. Choose Full Isolation.
  • 3Before isolation: initiate a Live Response session (Actions → Initiate Live Response) and collect a memory image and running process list — volatile evidence will be lost after network isolation.
  • 4After isolation is confirmed (device status changes to "Isolated"), navigate back to Incidents & alerts and link all related alerts to a new incident.
  • 5Check all other devices in the same subnet via Advanced Hunting — confirm whether the disable command was executed on multiple endpoints simultaneously (indicates automated ransomware propagation).
C3
Re-Enable Defenses & Block Attack Vector
RESTORATION
  • 1Via MDE Live Response or on a physically accessed device, restart Defender: sc start WinDefend and sc start MsSense.
  • 2Remove injected exclusions: run Remove-MpPreference -ExclusionPath <path> or delete the registry key under HKLM\SOFTWARE\Microsoft\Windows Defender\Exclusions\Paths.
  • 3Enable Tamper Protection via MDE portal: Settings → Endpoints → Advanced features → Tamper Protection → On. This prevents future service stops without MDE authorization.
  • 4If vssadmin delete shadows was executed, check if shadow copies still exist on other hosts — ransomware may not have fully propagated yet. Act immediately to snapshot remaining systems.
  • 5Block the initiating process path or hash via MDE indicator: Settings → Endpoints → Indicators → File → Add indicator.

If VSS deletion was confirmed, assume encryption may already be in progress on some files. Treat this as a ransomware incident (SOP-03) in parallel with this SOP.

🗑

04 — ERADICATION

CLEANUP
E1
Remove Persistence & Restore Security Posture
ERADICATION
  • 1Identify the initiating process chain from I1/I2. Trace back to the initial access point — phishing email, RDP session, or lateral movement from another compromised host.
  • 2Search for scheduled tasks, registry run keys, or WMI subscriptions created by the same account or process around the same time (cross-reference SOP-26 and SOP-30).
  • 3Run a full Defender scan on the isolated endpoint after re-enabling protection: Start-MpScan -ScanType FullScan via Live Response.
  • 4If VSS deletion was confirmed, recover from a known-good backup from before the intrusion timeline — do not trust any files on the affected system.
  • 5Audit all accounts that authenticated to the affected device in the 48 hours prior: check for credential compromise and force password resets on any interactive session accounts.
  • 6Verify Tamper Protection is enforced via Intune/MDE policy — ensure no policy allows local override of Tamper Protection settings.
📢

05 — ESCALATION

ESCALATION PATHS
ES1
Escalation Matrix & Notification
ESCALATION
ConditionSeverityActionNotify
Defender stopped / MDE sensor killedSEV1Isolate immediately, open war roomSOC Lead → CISO → IR Team
VSS deletion confirmedSEV1Treat as active ransomware — escalate to SOP-03SOC Lead → CISO → CEO
AV exclusion added, no service stopSEV2Isolate within 15 min, verify change ticketSOC Lead → Security Manager
Firewall disabled onlySEV2Re-enable firewall, investigate initiating processSOC Lead → Security Manager
bcdedit recoveryenabled NoSEV2Assume ransomware staging, treat as SEV1 if Defender also disabledSOC Lead
Admin task with valid change ticketFPClose, document, tune detection ruleL3 Analyst log only

If Defender is disabled AND VSS is deleted — this is a live ransomware deployment. Immediately escalate to SOP-03, notify CISO and CEO, and initiate business continuity procedures. Do not wait for confirmation of encrypted files.


Stay Threat-Ready

Follow CyberHawk Threat Intel for daily SOC analyst playbooks, detection engineering guides, and threat intelligence.

📺 YouTube 🎤 TikTok 🐦 X / Twitter 📡 Telegram
All SOPs Blog Web App (Free)
They can't exploit you if you are the Exploit.