Windows Defender Exclusions Added via PowerShell
Adversaries may attempt to bypass Windows Defender's capabilities by using PowerShell to add exclusions for folders or processes, and this activity can be detected by monitoring PowerShell command lines that use `Add-MpPreference` or `Set-MpPreference` with exclusion parameters.
Attackers may attempt to evade detection by modifying Windows Defender’s configuration to exclude specific files, folders, or processes from scanning. This is often achieved by using PowerShell commands to add exclusions. The tactic allows malware to operate without being detected by the built-in antivirus solution. Observed as early as 2018 with Trickbot disabling Windows Defender, this technique remains relevant today. This activity can be performed using Add-MpPreference or Set-MpPreference commands in PowerShell, specifying exclusions by path or process name. Detecting these modifications is critical for maintaining the integrity of endpoint security. The scope of targeting ranges from individual workstations to entire networks.
Attack Chain
- The attacker gains initial access to the system via an undisclosed method.
- The attacker executes PowerShell with administrative privileges.
- The attacker uses the
Add-MpPreferenceorSet-MpPreferencecmdlet to add an exclusion. - The exclusion specifies a file path, folder, or process that should be ignored by Windows Defender.
- Windows Defender is reconfigured to ignore the specified item.
- The attacker deploys or executes malware in the excluded location.
- The malware operates without interference from Windows Defender.
- The attacker achieves their final objective, such as data theft or lateral movement.
Impact
Successful exploitation allows attackers to operate undetected on compromised systems, leading to potential data breaches, lateral movement within the network, and deployment of ransomware. While the exact number of victims is unknown, this technique is widely used by various threat actors, impacting organizations across various sectors. The lack of detection can lead to prolonged periods of compromise, increasing the potential damage.
Recommendation
- Deploy the Sigma rule “Windows Defender Exclusions Added via PowerShell” to your SIEM to detect suspicious PowerShell commands used to add exclusions.
- Enable Sysmon process creation logging with command line auditing to capture the necessary event data for the Sigma rule.
- Regularly review Windows Defender exclusion lists to identify any unauthorized or suspicious entries.
- Investigate any PowerShell process that uses
Add-MpPreferenceorSet-MpPreferencewith exclusion parameters, as identified by the provided Sigma rule. - Monitor for processes and file modifications within excluded directories.
- Configure alerts to notify security teams when new Windows Defender exclusions are added.
Detection coverage 2
Windows Defender Exclusion Added via PowerShell
mediumDetects the use of PowerShell to add Windows Defender exclusions.
Suspicious PowerShell MpPreference Modification
mediumDetects suspicious modifications to MpPreference settings via PowerShell, excluding legitimate paths.
Detection queries are kept inside the platform. Get full rules →