Overview
The Registry AutoLogons check searches for plaintext credentials stored in the Windows registry for automatic logon functionality. When auto-logon is configured, Windows stores the username and password in plaintext in the registry, accessible to any user who can read the registry.How It Works
SharpUp checks the Winlogon registry key for auto-logon configuration:AutoAdminLogon- Must be set to “1”DefaultUserName- Username for auto-logonDefaultPassword- Plaintext passwordDefaultDomainName- Domain nameAltDefaultUserName- Alternative usernameAltDefaultPassword- Alternative passwordAltDefaultDomainName- Alternative domain
Example Output
- Auto-logon is enabled
- Administrator account credentials are stored in plaintext
- Domain is CONTOSO
- These credentials can be used immediately for privilege escalation
Exploitation
Method 1: Direct Credential Read
Method 2: Use Credentials with RunAs
Method 3: PSExec with Credentials
Method 4: Remote Authentication
Remediation
1
Disable Auto-Logon
2
Change Exposed Password
3
Use Alternative Auto-Logon Solutions
If auto-logon is required:
- Autologon.exe from Sysinternals - Encrypts credentials using LSA secrets
- Windows Credential Manager - More secure credential storage
- Smart Card authentication - Hardware-based authentication
- Windows Hello - Biometric authentication
4
Verify Removal
Detection
Defensive Monitoring
Detection Strategies
- Registry Monitoring
- Credential Usage
- Configuration Auditing
- Monitor Winlogon registry key for changes
- Alert when AutoAdminLogon is set to 1
- Detect DefaultPassword value creation
- Track who reads these registry values
Real-World Scenarios
Scenario 1: Kiosk System
Scenario 1: Kiosk System
Context: Public kiosk system configured with auto-logon for convenience. Administrator credentials used.Risk:
- Anyone can read registry and obtain administrator password
- Password likely reused across all kiosks
- Complete compromise of kiosk infrastructure
- Use dedicated kiosk account with minimal privileges
- Enable Assigned Access (kiosk mode)
- Don’t use administrator accounts
- Rotate credentials regularly
Scenario 2: Server Auto-Restart
Scenario 2: Server Auto-Restart
Context: Server configured to auto-logon after reboot to start applications automatically.Impact:
- Service account credentials in plaintext
- Credentials may have broad access
- Enables lateral movement
- Use Windows Services instead of interactive logon
- Implement gMSA or sMSA
- Use scheduled tasks with proper credential storage
Scenario 3: Penetration Test
Scenario 3: Penetration Test
Context: Gained access as low-privileged user on workstation.Attack Path:
- Run SharpUp to discover auto-logon credentials
- Find Domain Admin credentials in registry
- Use credentials to access domain controller
- Complete domain compromise
Prevention Best Practices
Never Use Auto-Logon
Avoid auto-logon in enterprise environments. It’s inherently insecure.
Minimal Privilege Accounts
If auto-logon is necessary, use accounts with minimal privileges.
Use Services
Use Windows Services or Scheduled Tasks instead of interactive logon.
Regular Audits
Regularly scan for auto-logon configurations across all systems.
Automated Detection Script
Related Checks
Cached GPP Password
Cached Group Policy Preference passwords
Unattended Install Files
Credentials in unattended installation files
Domain GPP Password
GPP passwords in SYSVOL
Remediation Guide
Comprehensive remediation guidance