Creation or Modification of Domain Backup DPAPI Private Keys
Detection of creation or modification of Domain Backup private keys, which adversaries may extract from a Domain Controller (DC) to decrypt domain user master key files.
This detection identifies the creation or modification of Domain Backup private keys (ntds_capi_.pfx, ntds_capi_.pvk) on Windows systems. Attackers may attempt to extract the Data Protection API (DPAPI) domain backup key from a Domain Controller (DC). Successful extraction of these keys allows the adversary to decrypt any domain user’s master key file, granting them unauthorized access to sensitive data and potentially leading to complete domain compromise. This activity is crucial for defenders to detect as it signifies a high-impact credential access attempt. The rule focuses on file creation events associated with specific file names commonly used for DPAPI backup keys.
Attack Chain
- An attacker gains initial access to a Domain Controller (DC).
- The attacker executes a tool or script designed to extract DPAPI domain backup keys.
- The tool retrieves the
ntds.ditfile, the Active Directory database. - The tool extracts DPAPI domain backup keys, creating files named
ntds_capi_*.pfxandntds_capi_*.pvk. - The attacker stages the extracted key files for exfiltration, potentially copying them to a temporary directory or network share.
- The attacker compresses or archives the key files to evade detection.
- The attacker exfiltrates the compressed archive to a remote location.
- The attacker uses the exfiltrated DPAPI domain backup keys to decrypt domain user master keys offline.
Impact
A successful attack can result in complete domain compromise. By extracting and decrypting DPAPI protected secrets, attackers gain unauthorized access to sensitive information, including user credentials, service accounts, and other critical data. This can lead to lateral movement, data theft, and disruption of services. The impact is considered critical due to the potential for widespread damage and long-term consequences.
Recommendation
- Enable Sysmon file creation logging to capture the creation of
ntds_capi_*.pfxandntds_capi_*.pvkfiles. - Deploy the provided Sigma rule to detect the creation or modification of DPAPI backup key files.
- Monitor process execution on domain controllers for suspicious command-line activity associated with potential DPAPI extraction tools as described in the overview.
- Investigate any alerts generated by the Sigma rule, focusing on the process lineage and destination of the created files.
Detection coverage 3
Creation of Domain Backup DPAPI private key
highDetects the creation of DPAPI private key files on Windows systems.
Modification of Domain Backup DPAPI private key
mediumDetects the modification of DPAPI private key files on Windows systems.
DPAPI Backup Key Creation by Suspicious Process
highDetects the creation of DPAPI backup key files by unusual processes like cmd.exe or powershell.exe.
Detection queries are kept inside the platform. Get full rules →