Overview
The ExplicitLogonEvents command parses Windows Security Event Log entries for Event ID 4648 (Explicit Logon events). These events are generated when a user explicitly provides credentials to access a resource, such as using RunAs, mapping a network drive with credentials, or accessing a remote system. This command helps identify lateral movement, credential usage patterns, and potential privilege escalation attempts.Syntax
Arguments
- days (optional) - Number of days to search backwards from the current date. Default is 7 days.
Examples
Output
The command returns:- Event timestamp
- Subject account (user who initiated the action)
- Subject domain
- Target account (account whose credentials were used)
- Target domain
- Target server name
- Process name that initiated the logon
- Process ID
- IP address (if applicable)
Use Cases
Red Team
- Identify credential reuse patterns across the network
- Map lateral movement paths between systems
- Discover administrative accounts and their usage
- Identify potential targets based on credential access patterns
- Detect accounts with elevated privileges
- Find systems where credentials have been used
- Identify service accounts and their usage patterns
Blue Team
- Detect lateral movement and credential theft
- Investigate suspicious privilege escalation attempts
- Identify unauthorized use of administrative credentials
- Audit credential usage across the network
- Detect Pass-the-Hash and credential replay attacks
- Monitor for abnormal RunAs or explicit credential usage
- Correlate explicit logon events with other security events
- Identify compromised accounts based on unusual logon patterns
- Validate least privilege principles
Example Output
Performance Considerations
This command reads from the Windows Security Event Log, which can be time-intensive depending on:- Size of the Security Event Log
- Number of days specified in the argument
- Event log rotation and retention settings
- System performance and disk I/O
Remote Execution
This command supports remote execution via WMI. Use the-computername parameter to query explicit logon events on remote systems:
Detection Considerations
Indicators
- Security Event Log access (Event ID 4663, 4656)
- WMI queries to remote event logs
- Large-scale event log enumeration
- Access to HKLM\SYSTEM\CurrentControlSet\Services\EventLog
- Unusual processes reading Security event logs
Defensive Recommendations
- Enable Security Event Log auditing (Event ID 4663)
- Monitor for mass event log queries
- Alert on event log access by non-authorized tools
- Implement SIEM correlation for explicit logon patterns
- Restrict event log access to authorized accounts only
- Monitor for abnormal explicit logon events (e.g., after-hours, unusual accounts)
- Correlate Event ID 4648 with other logon events (4624, 4625, 4672)
- Baseline normal explicit logon behavior per user/system
Related Commands
- LogonEvents - Logon events (Event ID 4624) from the security event log
- ProcessCreationEvents - Process creation logs (Event ID 4688) with sensitive data
- PowerShellEvents - PowerShell script block logs (Event ID 4104) with sensitive data
- SysmonEvents - Sysmon process creation logs (Event ID 1) with sensitive data
- PoweredOnEvents - Reboot and sleep schedule based on System event log