Delegated Managed Service Account Modification by an Unusual User
Detects modifications in the msDS-ManagedAccountPrecededByLink attribute of a delegated managed service account by an unusual subject account. Attackers can abuse this attribute to take over the permission of a target account and inherit it's permissions allowing them to further elevate privileges.
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 modifications in the msDS-ManagedAccountPrecededByLink attribute of a delegated managed service account by an unusual
11subject account. Attackers can abuse this attribute to take over the permission of a target account and inherit it's permissions
12allowing them to further elevate privileges.
13"""
14from = "now-9m"
15index = ["winlogbeat-*", "logs-system.security*", "logs-windows.forwarded*"]
16language = "kuery"
17license = "Elastic License v2"
18name = "Delegated Managed Service Account Modification by an Unusual User"
19note = """## Triage and analysis
20
21### Investigating Delegated Managed Service Account Modification 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 perform this kind of dMSA changes.
25- Examine the winlog.event_data.AttributeValue field to verify the targeted account and if it's supposed to use dMSA.
26- Examine if there are any recent dMSA account creation by the same winlog.event_data.SubjectUserName.
27- Investigate the history of the identified user account to determine if there are any other suspicious activities or patterns of behavior.
28- Collaborate with the IT or security team to determine if the changes were authorized or if further action is needed to secure the environment.
29
30### False positive analysis
31
32- Migration of legacy service accounts using delegated managed service account.
33
34### Response and remediation
35
36- Immediately disable the winlog.event_data.SubjectUserName account and revert all changes performed by that account.
37- Identify and isolate the source machines from where the SubjectUserName is authenticating.
38- Reset passwords for all accounts that were potentially affected or had their permissions altered, focusing on privileged accounts to prevent adversaries from regaining access.
39- 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.
40- 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."""
41references = ["https://www.akamai.com/blog/security-research/abusing-dmsa-for-privilege-escalation-in-active-directory"]
42risk_score = 73
43rule_id = "2c74e26b-dfe3-4644-b62b-d0482f124210"
44severity = "high"
45tags = [
46 "Domain: Endpoint",
47 "OS: Windows",
48 "Use Case: Threat Detection",
49 "Tactic: Privilege Escalation",
50 "Use Case: Active Directory Monitoring",
51 "Data Source: Active Directory",
52 "Data Source: Windows Security Event Logs",
53 "Resources: Investigation Guide",
54]
55timestamp_override = "event.ingested"
56type = "new_terms"
57
58query = '''
59event.code:5136 and winlog.event_data.AttributeLDAPDisplayName:"msDS-ManagedAccountPrecededByLink"
60'''
61
62
63[[rule.threat]]
64framework = "MITRE ATT&CK"
65[[rule.threat.technique]]
66id = "T1078"
67name = "Valid Accounts"
68reference = "https://attack.mitre.org/techniques/T1078/"
69[[rule.threat.technique.subtechnique]]
70id = "T1078.002"
71name = "Domain Accounts"
72reference = "https://attack.mitre.org/techniques/T1078/002/"
73
74
75[[rule.threat.technique]]
76id = "T1098"
77name = "Account Manipulation"
78reference = "https://attack.mitre.org/techniques/T1098/"
79
80
81[rule.threat.tactic]
82id = "TA0004"
83name = "Privilege Escalation"
84reference = "https://attack.mitre.org/tactics/TA0004/"
85
86[rule.new_terms]
87field = "new_terms_fields"
88value = ["winlog.event_data.SubjectUserName"]
89[[rule.new_terms.history_window_start]]
90field = "history_window_start"
91value = "now-10d"```
Triage and analysis
Investigating Delegated Managed Service Account Modification by an Unusual User
Possible investigation steps
- Examine the winlog.event_data.SubjectUserName field and verify if he is allowed and used to perform this kind of dMSA changes.
- Examine the winlog.event_data.AttributeValue field to verify the targeted account and if it's supposed to use dMSA.
- Examine if there are any recent dMSA account creation by the same 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
- dMSA Account Creation by an Unusual User
- Access to a Sensitive LDAP Attribute
- FirstTime Seen Account Performing DCSync
- Group Policy Abuse for Privilege Addition
- Kerberos Pre-authentication Disabled for User