From f15d179a5076f9b23f56a0cf4f80f8d24929255d Mon Sep 17 00:00:00 2001 From: Samirbous <64742097+Samirbous@users.noreply.github.com> Date: Tue, 29 Sep 2020 21:14:07 +0200 Subject: [PATCH] [New Rule]- Credential Access - Domain DPAPI Backup key (#125) * new rule - credential access Domain Backup DPAPI Private Keys Access * Update credential_access_domain_backup_dpapi_private_keys.toml * Update rules/windows/credential_access_domain_backup_dpapi_private_keys.toml Co-authored-by: Justin Ibarra * Update rules/windows/credential_access_domain_backup_dpapi_private_keys.toml Co-authored-by: Justin Ibarra * Update rules/windows/credential_access_domain_backup_dpapi_private_keys.toml Co-authored-by: Justin Ibarra * Update rules/windows/credential_access_domain_backup_dpapi_private_keys.toml Co-authored-by: Brent Murphy <56412096+bm11100@users.noreply.github.com> * Linted * added an extra reference * Update rules/windows/credential_access_domain_backup_dpapi_private_keys.toml Co-authored-by: Justin Ibarra Co-authored-by: Justin Ibarra Co-authored-by: Brent Murphy <56412096+bm11100@users.noreply.github.com> --- ...cess_domain_backup_dpapi_private_keys.toml | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 rules/windows/credential_access_domain_backup_dpapi_private_keys.toml diff --git a/rules/windows/credential_access_domain_backup_dpapi_private_keys.toml b/rules/windows/credential_access_domain_backup_dpapi_private_keys.toml new file mode 100644 index 000000000..85a763f45 --- /dev/null +++ b/rules/windows/credential_access_domain_backup_dpapi_private_keys.toml @@ -0,0 +1,46 @@ +[metadata] +creation_date = "2020/08/13" +ecs_version = ["1.6.0"] +maturity = "production" +updated_date = "2020/08/13" + +[rule] +author = ["Elastic"] +description = """ +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. +""" +from = "now-9m" +index = ["winlogbeat-*", "logs-endpoint.events.*"] +language = "kuery" +license = "Elastic License" +name = "Creation or Modification of Domain Backup DPAPI private key" +note = "### 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." +references = [ + "https://www.dsinternals.com/en/retrieving-dpapi-backup-keys-from-active-directory/", + "https://www.harmj0y.net/blog/redteaming/operational-guidance-for-offensive-user-dpapi-abuse/", +] +risk_score = 73 +rule_id = "b83a7e96-2eb3-4edf-8346-427b6858d3bd" +severity = "high" +tags = ["Elastic", "Windows"] +type = "query" + +query = ''' +event.category:file and not event.type:deletion and + file.name:(ntds_capi_*.pfx or ntds_capi_*.pvk) +''' + + +[[rule.threat]] +framework = "MITRE ATT&CK" +[[rule.threat.technique]] +id = "T1145" +name = "Private Keys" +reference = "https://attack.mitre.org/techniques/T1145/" + + +[rule.threat.tactic] +id = "TA0006" +name = "Credential Access" +reference = "https://attack.mitre.org/tactics/TA0006/"