Detect File/Path Exclusions in CrowdStrike LogScale
Adversaries may attempt to hide their file-based artifacts by writing them to specific folders or file names excluded from antivirus (AV) scanning and other defensive capabilities. AV and other file-based scanners often include exclusions to optimize performance as well as ease installation and legitimate use of applications. These exclusions may be contextual or hardcoded strings referencing specific folders and files assumed to be trusted. Adversaries typically perform a discovery phase first — enumerating existing exclusion paths via registry queries or Get-MpPreference — then stage payloads precisely in those excluded locations to bypass real-time scanning. Turla has been documented placing LunarWeb implant files in AV-excluded directories as part of long-term persistence operations against diplomatic targets.
MITRE ATT&CK
- Tactic
- Defense Evasion
- Technique
- T1564 Hide Artifacts
- Sub-technique
- T1564.012 File/Path Exclusions
- Canonical reference
- https://attack.mitre.org/techniques/T1564/012/
LogScale Detection Query
#event_simpleName = "ProcessRollup2"
| (ImageFileName = /(powershell|pwsh)\.exe$/i AND
CommandLine = /Add-MpPreference/i AND
CommandLine = /(-ExclusionPath|-ExclusionExtension|-ExclusionProcess)/i)
OR (ImageFileName = /RegAsm|reg\.exe$/i AND
CommandLine = /(Windows Defender.*Exclusions|DisableRealtimeMonitoring)/i)
| eval risk = "high"
| table timestamp, ComputerName, UserName, ImageFileName, CommandLine, ParentBaseFileName, risk
| sort by timestamp desc Detects AV/EDR exclusion additions via PowerShell or registry commands in CrowdStrike Falcon.
Data Sources
Required Tables
False Positives & Tuning
- Windows Update agent (wuauclt.exe, WUDFHost.exe) legitimately writes executables and packages to SoftwareDistribution during patch download cycles
- Software installers (msiexec.exe) extracting temporary payload files to %TEMP% or %LOCALAPPDATA%\Temp during installation sequences
- Security vendors and EDR agents writing their own components to directories they have self-excluded for performance — especially during product updates
- Developer CI/CD pipelines and build tools that output compiled binaries to %TEMP% directories configured as AV exclusions to speed up builds
- SCCM or Intune distribution agents staging software packages in excluded directories before deployment execution
Other platforms for T1564.012
Testing Methodology
Validate this detection against 4 adversary techniques from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are available with Pro.
- Test 1Enumerate Windows Defender Exclusion Paths via Registry Query
Expected signal: Security Event ID 4657 (if SACL auditing is configured on Defender exclusion keys): ObjectName matching 'Windows Defender\Exclusions', ProcessName=reg.exe. DeviceRegistryEvents in MDE: ActionType=RegistryKeyQueried, RegistryKey containing 'Windows Defender\Exclusions', InitiatingProcessFileName=reg.exe. Sysmon Event ID 1: Process Create with Image=reg.exe and CommandLine containing 'Windows Defender\Exclusions\Paths'.
- Test 2Enumerate Defender Exclusions via PowerShell Get-MpPreference and Stage Payload
Expected signal: Sysmon Event ID 1: Process Create with Image=powershell.exe and CommandLine containing 'Get-MpPreference'. PowerShell ScriptBlock Log Event ID 4104: Full script captured including Get-MpPreference call and Set-Content file write. DeviceRegistryEvents in MDE: RegistryValueRead on Defender exclusion paths by powershell.exe. Sysmon Event ID 11: FileCreate for argus-t1564012-test.ps1 in the exclusion path with Image=powershell.exe.
- Test 3Stage Executable Payload in Windows SoftwareDistribution (Default AV Exclusion)
Expected signal: Sysmon Event ID 11: FileCreate with TargetFilename=C:\Windows\SoftwareDistribution\argus-t1564012-payload.exe and Image=cmd.exe. DeviceFileEvents in MDE: ActionType=FileCreated, FolderPath containing 'SoftwareDistribution', FileName=argus-t1564012-payload.exe, InitiatingProcessFileName=cmd.exe. SHA256 will match notepad.exe (benign hash) but the location is anomalous — demonstrates why path-based detection is essential for this technique.
- Test 4Execute Staged Payload from Exclusion Path (Full Attack Chain Validation)
Expected signal: Sysmon Event ID 11: FileCreate for argus-t1564012-exec.ps1 in C:\Windows\Temp with Image=cmd.exe. Sysmon Event ID 1: Process Create with Image=powershell.exe, CommandLine referencing C:\Windows\Temp\argus-t1564012-exec.ps1, ParentImage=cmd.exe. PowerShell ScriptBlock Log Event ID 4104: Captures the script content. DeviceProcessEvents in MDE: FolderPath=C:\Windows\Temp, FileName=powershell.exe, ProcessCommandLine containing 'argus-t1564012-exec.ps1'.
References (9)
- https://attack.mitre.org/techniques/T1564/012/
- https://learn.microsoft.com/en-us/microsoft-365/security/defender-endpoint/configure-contextual-file-folder-exclusions-microsoft-defender-antivirus
- https://learn.microsoft.com/en-us/defender-endpoint/configure-exclusions-microsoft-defender-antivirus
- https://www.welivesecurity.com/en/eset-research/turla-lunar-toolset/
- https://learn.microsoft.com/en-us/defender-endpoint/advanced-hunting-devicefileevents-table
- https://learn.microsoft.com/en-us/defender-endpoint/advanced-hunting-deviceregistryevents-table
- https://github.com/redcanaryco/atomic-red-team/blob/master/atomics/T1564.012/T1564.012.md
- https://learn.microsoft.com/en-us/powershell/module/defender/get-mppreference
- https://docs.microsoft.com/en-us/windows/security/threat-protection/auditing/event-4657
Unlock Pro Content
Get the full detection package for T1564.012 including response playbook, investigation guide, and atomic red team tests.