Overview
The WindowsDefender command enumerates Windows Defender (Microsoft Defender Antivirus) configuration settings, including real-time protection status, scanning options, update information, and critically - exclusion paths, processes, and extensions. Exclusions are prime targets for payload placement as they bypass antivirus scanning.Syntax
Remote Execution
Output
Returns Windows Defender configuration:- Real-time protection status
- Cloud protection settings
- Automatic sample submission
- Exclusion paths
- Exclusion processes
- Exclusion extensions
- Threat definitions version
- Last scan information
Use Cases
- Red Team
- Blue Team
- Identify exclusion paths for payload delivery
- Discover excluded processes for injection
- Find excluded file extensions
- Assess Defender protection level
- Plan evasion strategies
- Locate safe directories for tools
Example Output
Remote Execution
This command supports remote execution using the
-computername parameter.Detection Considerations
- Registry Access: Queries
HKLM\SOFTWARE\Microsoft\Windows Defender - WMI Queries: Uses WMI to query Defender configuration
- Event Logs: May generate Security event 4663 (registry access)
- EDR Telemetry: Security product enumeration is often flagged
- Defender Events: May log configuration access
Exclusion Abuse
Common Exclusion Abuse Patterns
Common Exclusion Abuse Patterns
Attacker Objectives:
- Drop payloads in excluded directories
- Inject into excluded processes
- Use excluded file extensions
- Development directories (C:\Dev, C:\Build)
- Database directories
- Backup locations
- Application-specific paths
- Temp directories
- User profile directories
- Downloads folder
- Entire drive roots (C:, D:)
- Common tool locations (C:\Tools, C:\Temp)
Defensive Recommendations
Monitoring and Hardening
Monitoring and Hardening
Monitoring:
- Alert on new exclusion additions
- Track exclusion modifications via GPO audit
- Monitor registry changes to Defender keys
- Log Defender configuration queries
- Minimize exclusions to only required paths
- Document and justify all exclusions
- Regularly review and validate exclusions
- Use centralized exclusion management (GPO/Intune)
- Implement exclusion change approval process
- Enable Defender event logging (Event ID 5007)
- Monitor PowerShell Set-MpPreference commands
- Alert on excluded path file creation
- Correlate with other reconnaissance activities
Related Commands
- AMSIProviders - AMSI provider enumeration
- AntiVirus - Registered AV products
- InterestingProcesses - Security products
- Sysmon - Sysmon configuration