dMSA Account Creation by an Unusual User

Detects the creation of a delegated Managed Service Account by an unusual subject account. Attackers can abuse the dMSA account migration feature to elevate privileges abusing weak persmission allowing users child objects rights or msDS-DelegatedManagedServiceAccount rights.

Elastic rule (View on GitHub)

 1[metadata]
 2creation_date = "2025/05/23"
 3integration = ["system", "windows"]
 4maturity = "production"
 5updated_date = "2025/05/23"
 6
 7[rule]
 8author = ["Elastic"]
 9description = """
10Detects the creation of a delegated Managed Service Account by an unusual subject account. Attackers can abuse the dMSA
11account migration feature to elevate privileges abusing weak persmission allowing users child objects rights or
12msDS-DelegatedManagedServiceAccount rights.
13"""
14from = "now-9m"
15index = ["winlogbeat-*", "logs-system.security*", "logs-windows.forwarded*"]
16language = "kuery"
17license = "Elastic License v2"
18name = "dMSA Account Creation by an Unusual User"
19note = """## Triage and analysis
20
21### Investigating dMSA Account Creation by an Unusual User
22
23### Possible investigation steps
24- Examine the winlog.event_data.SubjectUserName field and verify if he is allowed and used to create dMSA accounts.
25- Examine all Active Directory modifications performed by the winlog.event_data.SubjectUserName.
26- Investigate the history of the identified user account to determine if there are any other suspicious activities or patterns of behavior.
27- Collaborate with the IT or security team to determine if the changes were authorized or if further action is needed to secure the environment.
28
29### False positive analysis
30
31- Migration of legacy service accounts using delegated managed service account.
32
33### Response and remediation
34
35- Immediately disable the winlog.event_data.SubjectUserName account and revert all changes performed by that account.
36- Identify and isolate the source machines from where the SubjectUserName is authenticating.
37- Reset passwords for all accounts that were potentially affected or had their permissions altered, focusing on privileged accounts to prevent adversaries from regaining access.
38- Escalate the incident to the security operations center (SOC) or incident response team for further investigation and to determine the scope of the breach, including identifying any other compromised systems or accounts.
39- Review and update access control policies and security configurations to prevent similar attacks, ensuring that only authorized personnel have the ability to modify critical Active Directory objects or create OU child objects."""
40references = ["https://www.akamai.com/blog/security-research/abusing-dmsa-for-privilege-escalation-in-active-directory"]
41risk_score = 73
42rule_id = "f0dbff4c-1aa7-4458-9ed5-ada472f64970"
43severity = "high"
44tags = [
45    "Domain: Endpoint",
46    "OS: Windows",
47    "Use Case: Threat Detection",
48    "Tactic: Privilege Escalation",
49    "Use Case: Active Directory Monitoring",
50    "Data Source: Active Directory",
51    "Data Source: Windows Security Event Logs",
52    "Resources: Investigation Guide",
53]
54timestamp_override = "event.ingested"
55type = "new_terms"
56
57query = '''
58event.code:5137 and winlog.event_data.ObjectClass:"msDS-DelegatedManagedServiceAccount"
59'''
60
61
62[[rule.threat]]
63framework = "MITRE ATT&CK"
64[[rule.threat.technique]]
65id = "T1078"
66name = "Valid Accounts"
67reference = "https://attack.mitre.org/techniques/T1078/"
68[[rule.threat.technique.subtechnique]]
69id = "T1078.002"
70name = "Domain Accounts"
71reference = "https://attack.mitre.org/techniques/T1078/002/"
72
73
74[[rule.threat.technique]]
75id = "T1098"
76name = "Account Manipulation"
77reference = "https://attack.mitre.org/techniques/T1098/"
78
79
80[rule.threat.tactic]
81id = "TA0004"
82name = "Privilege Escalation"
83reference = "https://attack.mitre.org/tactics/TA0004/"
84
85[rule.new_terms]
86field = "new_terms_fields"
87value = ["winlog.event_data.SubjectUserName"]
88[[rule.new_terms.history_window_start]]
89field = "history_window_start"
90value = "now-10d"```

Triage and analysis

Investigating dMSA Account Creation by an Unusual User

Possible investigation steps

  • Examine the winlog.event_data.SubjectUserName field and verify if he is allowed and used to create dMSA accounts.
  • Examine all Active Directory modifications performed by the winlog.event_data.SubjectUserName.
  • Investigate the history of the identified user account to determine if there are any other suspicious activities or patterns of behavior.
  • Collaborate with the IT or security team to determine if the changes were authorized or if further action is needed to secure the environment.

False positive analysis

  • Migration of legacy service accounts using delegated managed service account.

Response and remediation

  • Immediately disable the winlog.event_data.SubjectUserName account and revert all changes performed by that account.
  • Identify and isolate the source machines from where the SubjectUserName is authenticating.
  • Reset passwords for all accounts that were potentially affected or had their permissions altered, focusing on privileged accounts to prevent adversaries from regaining access.
  • Escalate the incident to the security operations center (SOC) or incident response team for further investigation and to determine the scope of the breach, including identifying any other compromised systems or accounts.
  • Review and update access control policies and security configurations to prevent similar attacks, ensuring that only authorized personnel have the ability to modify critical Active Directory objects or create OU child objects.

References

Related rules

to-top