Overview
The machinevaults command elevates to SYSTEM, retrieves the DPAPI_SYSTEM LSA secret, decrypts machine masterkeys, and uses them to decrypt all machine-scope Windows Vault data. This reveals system-level web credentials, network passwords, and other vault-stored secrets.Machine vaults contain system-level credentials stored by Windows and applications, including web credentials, network authentication, and system service passwords.
Basic Usage
How It Works
1
Elevation to SYSTEM
Duplicates a SYSTEM token to elevate privileges
2
DPAPI_SYSTEM Retrieval
Retrieves the DPAPI_SYSTEM LSA secret
3
Masterkey Decryption
Decrypts all machine DPAPI masterkeys using DPAPI_SYSTEM
4
Vault Discovery
Locates machine vault folders in system directories
5
Policy Decryption
Decrypts Policy.vpol files to extract AES keys
6
Credential Decryption
Uses AES keys to decrypt .vcrd credential files
Vault Locations
Machine vaults are stored in:- 4BF4C442-9B8A-41A0-B380-DD4A704DDB28 - Web Credentials
- 2F1A6504-0641-44CF-8BB5-3612D865F2E5 - Windows Credentials
Example Output
How Vaults Work
Windows Vaults use two-stage encryption:1
Policy.vpol Decryption
The Policy.vpol file is encrypted with machine DPAPI masterkey and contains AES encryption keys
2
AES Key Extraction
Decrypting Policy.vpol reveals AES128 and AES256 keys
3
Credential Decryption
The AES keys decrypt .vcrd files containing actual credentials
Types of Machine Vault Data
Web Credentials
Web Credentials
VaultID:
4bf4c442-9b8a-41a0-b380-dd4a704ddb28- Internet Explorer saved passwords (system context)
- System-level web authentication
- Service web credentials
- Internal portal credentials
- Administrative portals
- Internal web applications
- Management interfaces
Windows Credentials
Windows Credentials
VaultID:
2f1a6504-0641-44cf-8bb5-3612d865f2e5- Network authentication credentials
- Domain resource access
- SMB share credentials
- Generic Windows passwords
- Network resource access
- Domain credentials
- Service account passwords
Application Credentials
Application Credentials
- Application-specific vault entries
- Third-party software credentials
- System service passwords
- Background service authentication
- Application access
- Service credentials
- API keys and tokens
Common Scenarios
Post-Exploitation System Credential Gathering
Post-Exploitation System Credential Gathering
After gaining admin access:
Service Account Discovery
Service Account Discovery
Find service-level web and network credentials:
Comprehensive Machine Triage
Comprehensive Machine Triage
Complete machine DPAPI extraction:
Vault File Structure
Each vault folder contains: Policy.vpol:- DPAPI-encrypted with machine masterkey
- Contains AES128 and AES256 keys
- Required for credential decryption
- AES-encrypted credential data
- Contains username, resource, password
- Decrypted using keys from Policy.vpol
- Additional credential files
- Same encryption scheme
Comparison: User vs Machine Vaults
| Aspect | User Vaults | Machine Vaults |
|---|---|---|
| Location | %LOCALAPPDATA%\Microsoft\Vault\ | C:\Windows\System32\config\systemprofile\... |
| Protection | User masterkey | Machine masterkey (DPAPI_SYSTEM) |
| Context | Current user credentials | System/service credentials |
| Typical Contents | Browser passwords, personal creds | Service passwords, system creds |
| Privilege | User context | SYSTEM context |
| Persistence | User-specific | Machine-wide |
Detection Considerations
Host-Based Indicators:- Elevation to SYSTEM privileges
- LSA secret retrieval (DPAPI_SYSTEM)
- Access to system profile vault directories
- Reading Policy.vpol files
- Bulk vault credential file access
- Monitor SYSTEM token impersonation
- Alert on LSA secret access (DPAPI_SYSTEM)
- Track access to system vault directories
- Detect Policy.vpol file access
- Monitor .vcrd file enumeration
Related Commands
machinecredentials
Decrypt machine credential files
machinemasterkeys
Extract machine masterkeys
machinetriage
Comprehensive machine DPAPI triage
vaults
Decrypt user vaults
Tips
Maximizing Vault Value
Maximizing Vault Value
- Focus on Web Credentials vault for portal access
- Check Resource field for target systems
- Test discovered credentials immediately
- Look for administrative interface credentials
- Correlate with known infrastructure
OPSEC Considerations
OPSEC Considerations
- Requires elevation (high visibility)
- SYSTEM privilege elevation generates events
- LSA secret access triggers security alerts
- Vault access may be monitored
- Consider detection capabilities before running
Troubleshooting
Troubleshooting
Access denied:
- Need Administrator privileges
- UAC may prevent elevation
- Security software may block SYSTEM access
- Try running as SYSTEM directly
- System may not have machine-level vaults
- Check ServiceProfiles directories
- Vaults may be empty (no .vcrd files)
- System services may not store credentials in vaults
- Vault may be empty (no credential entries)
- Check for .vcrd files in vault directory
- Verify AES keys were extracted correctly
- Some vaults may only contain metadata
Understanding Machine Vault Usage
Machine vaults are created when:-
System Services:
- Windows services saving web credentials
- Background processes storing passwords
- System-level browser usage
-
Service Accounts:
- LocalService or NetworkService context
- Scheduled tasks running as SYSTEM
- Windows Update and other system services
-
Administrative Tools:
- Management consoles saving credentials
- Remote administration tools
- System monitoring applications
Machine vaults often contain fewer credentials than user vaults, but the credentials are typically more privileged (service accounts, admin portals, etc.).
Web Credential Resources
Common resources found in machine Web Credentials vault:- Administrative web interfaces
- Internal service portals
- Management consoles
- API endpoints
- Monitoring dashboards
AES Key Information
The Policy.vpol file contains two AES keys:| Key Type | Size | Usage |
|---|---|---|
| AES128 | 128-bit | Primary credential encryption (older) |
| AES256 | 256-bit | Enhanced credential encryption (newer) |