Skip to content
Threat Feed
high advisory

Suspicious PowerShell Command Removing Windows Defender Directory

A PowerShell command attempting to remove the Windows Defender directory is detected via PowerShell Script Block Logging, potentially indicating an attacker's attempt to disable endpoint protection for further malicious activities.

This threat brief addresses a specific PowerShell command designed to remove the Windows Defender directory, a critical component of endpoint security on Windows systems. Attackers may attempt to delete or corrupt Windows Defender to bypass its protection mechanisms, allowing them to execute malicious activities undetected. The detection focuses on identifying PowerShell commands containing “rmdir” and targeting the specific path associated with Windows Defender. This activity is typically observed following successful initial access and privilege escalation, as attackers attempt to establish persistence or conduct data exfiltration without interference from security software. The original Splunk analytic was published in May 2026, highlighting the enduring relevance of this technique.

Attack Chain

  1. Initial Access: The attacker gains initial access to the system through various methods, such as phishing, exploiting vulnerabilities, or using stolen credentials.
  2. Privilege Escalation: The attacker elevates their privileges to gain administrative rights, enabling them to perform sensitive actions on the system.
  3. Defense Evasion: The attacker attempts to disable or impair security controls.
  4. PowerShell Execution: The attacker leverages PowerShell to execute malicious commands.
  5. Directory Removal: The attacker executes the rmdir command within a PowerShell script, targeting the Windows Defender directory.
  6. Bypass Security Controls: By removing the Windows Defender directory, the attacker disables real-time protection and other security features.
  7. Lateral Movement/Data Exfiltration: With endpoint protection disabled, the attacker can move laterally within the network, steal sensitive data, or deploy ransomware without triggering alerts.
  8. Impact: The attacker achieves their final objective, such as data theft, system disruption, or financial gain, due to the compromised security posture of the endpoint.

Impact

Successful removal of the Windows Defender directory can have severe consequences. It allows attackers to bypass endpoint protection, leading to undetected malware infections, data breaches, and system compromise. Depending on the attacker’s objective, this can result in significant financial losses, reputational damage, and operational disruption. Such techniques have been observed in destructive malware campaigns targeting organizations.

Recommendation

Detection coverage 2

Detect Windows Defender Directory Removal via PowerShell

high

Detects PowerShell commands attempting to remove the Windows Defender directory by looking for 'rmdir' and the Defender path in Script Block Logging.

sigma tactics: defense_evasion sources: process_creation, windows

Detect Windows Defender Directory Removal via PowerShell Script Block Logging

high

Detects PowerShell commands attempting to remove the Windows Defender directory using PowerShell Script Block Logging (EventCode 4104).

sigma tactics: defense_evasion sources: process_creation, windows

Detection queries are kept inside the platform. Get full rules →