Overview
The Cached GPP Password check searches for locally cached Group Policy Preference (GPP) XML files that may contain encrypted passwords. These files are stored in%ALLUSERSPROFILE%\Microsoft\Group Policy\History and can contain credentials for local users, service accounts, scheduled tasks, and mapped drives.
Even though Microsoft patched the ability to create new GPP passwords (KB2962486), old cached files may still contain these credentials.
How It Works
SharpUp searches the local GPP cache directory for XML files that commonly contain passwords:- Groups.xml (local group membership with passwords)
- Services.xml (service account credentials)
- Scheduledtasks.xml (scheduled task credentials)
- DataSources.xml (database connection strings)
- Printers.xml (printer configurations)
- Drives.xml (mapped drive credentials)
- Registry.xml (registry settings)
Technical Details
- Locates the Group Policy cache folder
- Recursively searches for target XML files
- Parses XML for encrypted password fields (
cpasswordattribute) - Reports files containing passwords
- Can decrypt passwords using the published AES key
Decryption
GPP passwords are encrypted with AES-256-CBC, but Microsoft published the static encryption key:Example Output
Exploitation
Method 1: Using PowerUp
Method 2: Manual Decryption
Method 3: Using gpp-decrypt
Method 4: Python Script
Remediation
1
Locate Cached Files
2
Review and Delete
3
Change Exposed Credentials
Any credentials found in cached GPP files should be changed immediately:
4
Clean SYSVOL Source
Also remediate the source in SYSVOL - see Domain GPP Password for details.
Detection
Defensive Monitoring
Detection Strategies
- File Access Monitoring
- Process Monitoring
- Network Monitoring
- Monitor read access to Group Policy History folder
- Alert on access to Groups.xml, Services.xml, etc.
- Track which users are accessing cached GPP files
Real-World Scenarios
Scenario 1: Old Domain Migration
Scenario 1: Old Domain Migration
Context: Organization migrated from old domain but workstations retain cached GPP files from 5+ years ago.Risk: Cached files may contain credentials for:
- Old administrator accounts (may still be valid)
- Service accounts (often not changed)
- Shared local administrator passwords
Scenario 2: Scheduled Task Credentials
Scenario 2: Scheduled Task Credentials
Context: Scheduledtasks.xml in cache contains domain service account credentials.Attack Path:
- Find cached Scheduledtasks.xml
- Extract and decrypt service account password
- Authenticate as service account
- Escalate if service account has elevated privileges
Scenario 3: Local Administrator Password
Scenario 3: Local Administrator Password
Context: Groups.xml set the local administrator password for all workstations.Impact:
- Attacker can authenticate as local admin on any workstation
- Enables lateral movement across entire environment
- Potential for credential dumping via mimikatz
Prevention
Best Practices
Don't Use GPP Passwords
Never use Group Policy Preferences to deploy passwords. Use alternatives like LAPS or gMSA.
Clean Old Files
Regularly audit and delete cached GPP files from all systems.
Rotate Credentials
Assume any credential in GPP is compromised and rotate immediately.
Use LAPS
Implement Local Administrator Password Solution for managing local admin passwords.
Automated Cleanup Script
Related Checks
Domain GPP Password
Check SYSVOL for GPP passwords on domain controllers
Registry AutoLogons
Find plaintext passwords in registry
Unattended Install Files
Discover credentials in unattended installation files
Remediation Guide
Comprehensive remediation guidance