Overview
TheWindowsCredentialFiles command searches for Windows credential files protected by DPAPI (Data Protection API). These encrypted blob files contain saved credentials, certificates, and other sensitive data that can be decrypted with the appropriate DPAPI master keys.
Important: User commands run for the current user if not elevated and for ALL users if elevated.
Syntax
Output
The command returns:- Credential file locations
- File names and GUIDs
- File sizes and timestamps
- User context for each credential file
- DPAPI blob indicators
- Credential file counts per user
Use Cases
Red Team
- Credential Access: Locate DPAPI-protected credential files for offline decryption
- Data Harvesting: Identify credential stores for post-exploitation
- Privilege Escalation: Target high-value credential files
- Persistence: Understand credential storage for long-term access
- DPAPI Attacks: Prepare for DPAPI master key extraction and blob decryption
Blue Team
- Forensic Analysis: Identify credential files during investigations
- Data Protection Audit: Verify DPAPI-protected credential security
- Incident Response: Assess credential exposure during security events
- Security Baseline: Document credential storage locations and permissions
- Risk Assessment: Evaluate exposure from credential files
Example Output
Privilege Context
- Non-Elevated: Searches for Windows credential files for the current user only
- Elevated: Searches for Windows credential files for ALL users on the system, providing comprehensive credential file discovery
Remote Execution
This command does not support remote execution (not marked with + in the command list).Detection Considerations
Indicators
- File system enumeration in Credentials directories
- Access to %LOCALAPPDATA%\Microsoft\Credentials
- Reading DPAPI blob files
- Enumeration across multiple user profiles
Defensive Monitoring
- Monitor access to Credentials directories by non-system processes
- Alert on bulk enumeration of credential files
- Track processes reading DPAPI blob files
- Log unusual access patterns to credential storage
- Detect credential dumping tools accessing DPAPI files
- Monitor for credential file exfiltration attempts
- Alert on copying or moving credential files
DPAPI Protection
- Credential files are encrypted with DPAPI
- Decryption requires user’s DPAPI master key
- Master keys derived from user’s password
- Can be decrypted with master key or user’s password
- Elevation or SYSTEM access may enable decryption
What Credential Files May Contain
- Saved network passwords
- Application credentials
- Certificate private keys
- Generic Windows credentials
- Domain credentials
- Web credentials
- RDP saved passwords
Security Recommendations
- Protect DPAPI master key directories with strict ACLs
- Enable file access auditing on Credentials folders
- Monitor for offline credential extraction tools
- Implement Windows Defender Credential Guard
- Use EDR solutions that detect DPAPI attacks
- Regularly audit credential file access
- Educate users on secure credential management
Related Commands
- DpapiMasterKeys: Lists DPAPI master keys needed for decryption
- WindowsVault: Enumerates credentials in Windows Vault
- CredEnum: Lists saved credentials using Windows API
- Certificates: Finds certificate files which may use DPAPI
- SecPackageCreds: Obtains credentials from security packages