Powershell Windows Defender Exclusion Commands
The following analytic detects the use of PowerShell commands to add or set Windows Defender exclusions. It leverages EventCode 4104 to identify suspicious `Add-MpPreference` or `Set-MpPreference` commands with…
Description
The following analytic detects the use of PowerShell commands to add or set Windows Defender exclusions. It leverages EventCode 4104 to identify suspicious `Add-MpPreference` or `Set-MpPreference` commands with exclusion parameters. This activity is significant because adversaries often use it to bypass Windows Defender, allowing malicious code to execute without detection. If confirmed malicious, this behavior could enable attackers to evade antivirus defenses, maintain persistence, and execute further malicious activities undetected.
Detection logic
Detection requirements
- Platform
- ContainersESXiIaaSLinuxmacOSNetwork DevicesWindows
The rule states no platform. This is derived from the ATT&CK technique it maps to.
- Log source category
- powershell_script_block_logging_4104
Known benign triggers
- admin or user may choose to use this windows features.
MITRE ATT&CK mappings
0 exclusive techniques.This is coverage no other published rule has; it is not this rule's total technique count.
References
| Reference | Cited by |
|---|---|
| app.any.run/tasks/cf1245de-06a7-4366-8209-8e3006f2bfe5/ | 3 |
| tccontre.blogspot.com/2020/01/remcos-rat-evading-windows-defender-av.html | 10 |
| www.microsoft.com/security/blog/2022/01/15/destructive-malware-targeting-ukrainian-organizations/ | 27from 2 sources |
From the source
- At source
- Open at source
- Upstream identifier
- 907ac95c-4dd9-11ec-ba2c-acde48001122
- Tagged by the source as
- AgentTeslaBlankGrabber StealerCISA AA22-320AData DestructionNetSupport RMM Tool AbuseRemcosSalat StealerWarzone RATWhisperGateWindows Defense Evasion TacticsEndpointendpointSplunk CloudSplunk EnterpriseSplunk Enterprise Securityendpoint
Licence
- Published under
- Apache License 2.0Read the licence
- Attribution
- Required
- Obtained under
- Apache-2.0Read the origin licence
Authorship
- Written by
- Published
- Aug 26, 2026
- Version
- 1