Overview
The credentials command searches for Windows Credential Manager credential files and decrypts them using masterkeys, domain backup keys, or user credentials. This reveals saved credentials for RDP connections, scheduled tasks, and other applications.Credential files are stored in
%LOCALAPPDATA%\Microsoft\Credentials\ and contain sensitive information like usernames and passwords for various Windows services.Basic Usage
Command Arguments
Decryption Methods
- Domain Backup Key
- Masterkey Mappings
- User Credentials
- RPC Decryption
Targeting Options
| Argument | Description |
|---|---|
/target:FILE | Target specific credential file |
/target:FOLDER | Target specific folder of credentials |
/server:SERVER | Triage remote server (requires admin access + pvk/password) |
Execution Context
- Elevated
- Unelevated
When run with administrative privileges:
- Triages all users on the system
- Accesses credential files in all user profiles
- Maximum credential recovery
Example: Using Masterkey Mappings
Example: Using Domain Backup Key
Types of Credentials Found
The credentials command can reveal various types of saved credentials:RDP Credentials
RDP Credentials
- TargetName:
Domain:target=TERMSRV/IP_OR_HOSTNAME - Contains saved Remote Desktop connection credentials
- Stored when users save RDP passwords
Scheduled Task Credentials
Scheduled Task Credentials
- TargetName:
Domain:batch=TaskScheduler:Task:{GUID} - Credentials for scheduled tasks running as specific users
- High-value targets for persistence
Windows Services
Windows Services
- Service account credentials
- RunAs credentials for applications
- Network authentication credentials
Generic Credentials
Generic Credentials
- Application-specific saved credentials
- Network share credentials
- Other Windows Credential Manager entries
Common Scenarios
Post-Domain Compromise
Post-Domain Compromise
After obtaining domain admin and the backup key:
Using Mimikatz-Extracted Masterkeys
Using Mimikatz-Extracted Masterkeys
Extract masterkeys with Mimikatz and use for decryption:
Specific User Credentials
Specific User Credentials
When you have compromised a user’s password:
Offline/Forensic Analysis
Offline/Forensic Analysis
Analyzing copied credential files:
Credential File Structure
Credential files are located at:- guidMasterKey: GUID of masterkey used for encryption
- Description: Type of credential data
- TargetName: What the credential is for
- UserName: Stored username
- Credential: Encrypted password (decrypted by SharpDPAPI)
Detection Considerations
Host-Based Indicators:- Reading files from
%LOCALAPPDATA%\Microsoft\Credentials\ - Non-standard processes accessing Credential Manager files
- Bulk enumeration of credential files across multiple user profiles
- Access from unauthorized processes
- Monitor access to
%LOCALAPPDATA%\Microsoft\Credentials\directories - Alert on bulk credential file access
- Track processes reading multiple users’ credential data
- Detect credential file access outside user context
- Monitor for LSASS access (when extracting masterkeys)
Related Commands
masterkeys
Decrypt user masterkeys first
vaults
Decrypt Windows Vault data
triage
Comprehensive user DPAPI triage
backupkey
Retrieve domain backup key
Tips
Maximizing Credential Recovery
Maximizing Credential Recovery
- Run elevated to access all users’ credentials
- Use domain backup key for comprehensive coverage
- Check both current and archived credential files
- Correlate TargetName with network infrastructure
- Pay special attention to scheduled task credentials
OPSEC Considerations
OPSEC Considerations
- Run unelevated to only access current user (less noisy)
- Use
/mkfileinstead of inline masterkeys to avoid command line logging - Redirect output to file with
/consoleoutfileto minimize artifacts - Target specific credential files if you know what you’re looking for
- Avoid bulk enumeration if stealth is required
Troubleshooting
Troubleshooting
No credentials decrypted:
- Verify masterkeys or backup key is correct
- Ensure credential files exist in target directories
- Check that you have read permissions
- Confirm the GUID in credential file matches your masterkeys
- Users may have credentials encrypted with different masterkeys
- Extract more masterkeys using Mimikatz
sekurlsa::dpapi - Try using domain backup key for complete coverage
- Check for older/archived masterkey files