Suspicious Access to Windows DPAPI Master Keys by Uncommon Applications
Adversaries can access Windows Data Protection API (DPAPI) master keys using uncommon applications like Mimikatz to decrypt user credentials and sensitive data, indicating credential theft activities.
This threat brief details the detection of suspicious file access attempts targeting Windows Data Protection API (DPAPI) master keys by applications not typically associated with such operations. DPAPI master keys are critical components used by Windows to protect a wide range of sensitive user data, including stored credentials, web browser passwords, VPN configurations, Wi-Fi passwords, and certificates. When an adversary gains unauthorized access to these master keys, they can decrypt this protected information, leading to credential theft, lateral movement, and further compromise of the environment. Tools like Mimikatz, specifically its dpapi::masterkey function, are commonly used by attackers post-exploitation to extract these keys. Detecting such access from uncommon processes serves as a strong indicator of malicious activity and potential credential compromise within an organization's Windows endpoints.
Attack Chain
- Initial Access & Execution: An adversary gains initial access to a Windows system through various means (e.g., exploiting vulnerabilities, phishing) and establishes execution of a malicious tool or script.
- Credential Dumping Tool Deployment: The attacker deploys and executes a specialized credential dumping tool, such as Mimikatz or a custom variant, designed to interact with Windows security components.
- DPAPI Master Key Function Invocation: The malicious tool initiates specific functions aimed at the Windows DPAPI (Data Protection API), often targeting the extraction of master keys.
- Master Key File Location: The tool attempts to locate DPAPI master key files, which are typically stored in specific paths like
C:\Windows\System32\Microsoft\Protect\S-1-5-18\for system context orC:\Users\<username>\AppData\Roaming\Microsoft\Protect\S-1-5-21-for user contexts. - Unauthorized File Access: The malicious process performs file access operations (e.g., read, copy) on the identified DPAPI master key files, attempting to bypass standard access controls. This is the activity detected by the provided Sigma rule.
- Decryption of Protected Data: Using the extracted master keys, the attacker's tool decrypts various sensitive data encrypted by DPAPI, including cached credentials, browser passwords, and other secrets.
- Data Exfiltration/Lateral Movement: The decrypted credentials and sensitive information are then used by the attacker for lateral movement within the network, privilege escalation, or exfiltration to external command and control infrastructure.
Impact
Successful compromise of Windows DPAPI master keys allows attackers to decrypt a vast array of sensitive information stored on affected systems, including user passwords, private keys, session cookies, and authentication tokens. This can directly lead to unauthorized access to critical systems, applications, and cloud services, facilitating lateral movement, privilege escalation, and data exfiltration. Organizations may face significant financial losses due to intellectual property theft, reputational damage, regulatory fines, and extensive recovery costs from widespread credential compromise. The number of potential victims depends on the scope of the attacker's access and the number of compromised systems storing DPAPI-protected data.
Recommendation
- Deploy the provided Sigma rule to your SIEM and tune for your environment to detect suspicious access to DPAPI master keys.
- Ensure the
Microsoft-Windows-Kernel-File ETW provideris enabled and configured to capture relevant file access events for the detection rule to function effectively. - Implement strong application whitelisting policies to prevent the execution of unauthorized or uncommon applications that could attempt to access sensitive system files like DPAPI master keys.
- Monitor for high-volume file access events to the
\Microsoft\Protect\directory from processes not typically involved in system management or security operations.
Detection coverage 1
Access To Windows DPAPI Master Keys By Uncommon Applications
mediumDetects file access requests to Windows Data Protection API Master keys by uncommon applications, which can indicate credential stealing activities such as Mimikatz usage.
Detection queries are available on the platform. Get full rules →