Creation or Modification of Domain Backup DPAPI private key
Identifies the creation or modification of Domain Backup private keys. Adversaries may extract the Data Protection API (DPAPI) domain backup key from a Domain Controller (DC) to be able to decrypt any domain user master key file.
Elastic rule (View on GitHub)
1[metadata]
2creation_date = "2020/08/13"
3integration = ["endpoint", "windows"]
4maturity = "production"
5min_stack_comments = "New fields added: required_fields, related_integrations, setup"
6min_stack_version = "8.3.0"
7updated_date = "2023/06/22"
8
9[rule]
10author = ["Elastic"]
11description = """
12Identifies the creation or modification of Domain Backup private keys. Adversaries may extract the Data Protection API
13(DPAPI) domain backup key from a Domain Controller (DC) to be able to decrypt any domain user master key file.
14"""
15from = "now-9m"
16index = ["winlogbeat-*", "logs-endpoint.events.*", "logs-windows.*", "endgame-*"]
17language = "eql"
18license = "Elastic License v2"
19name = "Creation or Modification of Domain Backup DPAPI private key"
20note = """## Triage and analysis
21
22Domain DPAPI Backup keys are stored on domain controllers and can be dumped remotely with tools such as Mimikatz. The resulting .pvk private key can be used to decrypt ANY domain user masterkeys, which then can be used to decrypt any secrets protected by those keys.
23
24## Setup
25
26If enabling an EQL rule on a non-elastic-agent index (such as beats) for versions <8.2, events will not define `event.ingested` and default fallback for EQL rules was not added until 8.2, so you will need to add a custom pipeline to populate `event.ingested` to @timestamp for this rule to work.
27"""
28references = [
29 "https://www.dsinternals.com/en/retrieving-dpapi-backup-keys-from-active-directory/",
30 "https://posts.specterops.io/operational-guidance-for-offensive-user-dpapi-abuse-1fb7fac8b107",
31]
32risk_score = 73
33rule_id = "b83a7e96-2eb3-4edf-8346-427b6858d3bd"
34severity = "high"
35tags = ["Domain: Endpoint", "OS: Windows", "Use Case: Threat Detection", "Tactic: Credential Access", "Data Source: Elastic Endgame", "Data Source: Elastic Defend"]
36timestamp_override = "event.ingested"
37type = "eql"
38
39query = '''
40file where host.os.type == "windows" and event.type != "deletion" and file.name : ("ntds_capi_*.pfx", "ntds_capi_*.pvk")
41'''
42
43
44[[rule.threat]]
45framework = "MITRE ATT&CK"
46[[rule.threat.technique]]
47id = "T1552"
48name = "Unsecured Credentials"
49reference = "https://attack.mitre.org/techniques/T1552/"
50[[rule.threat.technique.subtechnique]]
51id = "T1552.004"
52name = "Private Keys"
53reference = "https://attack.mitre.org/techniques/T1552/004/"
54
55
56[[rule.threat.technique]]
57id = "T1555"
58name = "Credentials from Password Stores"
59reference = "https://attack.mitre.org/techniques/T1555/"
60
61
62[rule.threat.tactic]
63id = "TA0006"
64name = "Credential Access"
65reference = "https://attack.mitre.org/tactics/TA0006/"
Triage and analysis
Domain DPAPI Backup keys are stored on domain controllers and can be dumped remotely with tools such as Mimikatz. The resulting .pvk private key can be used to decrypt ANY domain user masterkeys, which then can be used to decrypt any secrets protected by those keys.
Setup
If enabling an EQL rule on a non-elastic-agent index (such as beats) for versions <8.2, events will not define event.ingested
and default fallback for EQL rules was not added until 8.2, so you will need to add a custom pipeline to populate event.ingested
to @timestamp for this rule to work.
References
Related rules
- Command Shell Activity Started via RunDLL32
- Credential Acquisition via Registry Hive Dumping
- LSASS Memory Dump Creation
- Microsoft IIS Connection Strings Decryption
- Microsoft IIS Service Account Password Dumped