Overview
The AuditPolicyRegistry command enumerates audit policy settings by reading them directly from the Windows registry. Unlike the AuditPolicies command which uses native APIs, this command queries the registry, making it suitable for remote execution scenarios. This provides insight into which security events are being logged, helping to assess the detection capabilities and logging posture of a target system.Syntax
Remote Execution
Output
The command returns audit policy settings from the registry:- Advanced audit policy subcategories
- Success/Failure audit configuration
- Policy GUIDs and friendly names
- Enforcement status
HKLM\Security\Policy\PolAdtEvHKLM\Software\Microsoft\Windows\CurrentVersion\Policies\System\Audit
Use Cases
- Red Team
- Blue Team
- Remotely enumerate audit policies without agent deployment
- Identify logging blind spots across multiple targets
- Assess detection capabilities before engagement
- Plan stealthy operations based on logging gaps
- Understand which credential access methods are monitored
- Determine if command-line logging is enabled
Example Output
Remote Execution
This command supports remote execution using the
-computername parameter.Detection Considerations
- Registry Access: Queries to Security and Policies registry hives
- WMI Activity: Remote execution generates WMI registry provider events
- Event Logs:
- Event ID 4656/4663 - Registry object access (if audited)
- Event ID 5857-5861 - WMI activity
- Network Traffic: Remote WMI connections over RPC/DCOM
- EDR Telemetry: Security products may flag registry enumeration
Defensive Recommendations
Detection Strategies
Detection Strategies
Registry Monitoring:
- Enable auditing on Security policy registry keys
- Alert on access to
HKLM\Security\Policyby non-system processes - Monitor for multiple registry queries in succession
- Track StdRegProv method calls to Security hive
- Correlate WMI activity with authentication events
- Alert on remote registry enumeration patterns
- Monitor RPC/DCOM traffic for suspicious patterns
- Track connections to port 135 and dynamic RPC ports
- Correlate with authentication and privilege escalation attempts
Related Commands
- AuditPolicies - Native API-based audit policy enumeration
- Sysmon - Sysmon configuration and enhanced logging
- WindowsEventForwarding - WEF settings
- LocalGPOs - Local Group Policy configuration
- PowerShell - PowerShell logging and transcription settings