How the attack works
A group managed service account (gMSA) has a long random password that Active Directory generates and rotates. The hosts that run the service read it from the constructed attribute msDS-ManagedPassword, and Active Directory returns it only to principals listed in the account's PrincipalsAllowedToRetrieveManagedPassword (stored in msDS-GroupMSAMembership).
If that list is too broad, or an attacker can change it through write access on the gMSA, any listed principal can read the password blob and derive the account's NT hash and Kerberos keys. With a SACL that audits reads of the attribute, each retrieval is logged on the domain controller in event 4662 with the attribute's schemaIDGUID e362ed86-b728-0842-b27d-2dea7a9df218 in Properties and the Read Property access mask 0x10. A change of the retrieval list is logged as event 5136 on msDS-GroupMSAMembership when writes to that attribute are audited, and a second rule on this page matches it.
What an attacker needs
- Membership in the gMSA's PrincipalsAllowedToRetrieveManagedPassword, directly or through a group, or write access to msDS-GroupMSAMembership or to the gMSA's DACL.
- LDAP access to a domain controller.
Impact
The attacker can authenticate as the gMSA wherever it has rights. gMSAs often run database, web or backup services with administrative access to servers, and some are members of privileged groups.
Detection rules
gMSA Managed Password Read by a Non-Computer Account
Detects a read of the msDS-ManagedPassword attribute (schemaIDGUID e362ed86-b728-0842-b27d-2dea7a9df218, Read Property 0x10) in event 4662 by an account that is not a computer account. gMSA passwords are meant to be retrieved by the computers that run the service, so a user or service account reading one is unusual. Requires Audit Directory Service Access and a SACL that audits Read Property on msDS-ManagedPassword for gMSA objects. A read made with the computer account of a compromised host, including one that is allowed to retrieve the password, is excluded by the filter and is not detected.
title: gMSA Managed Password Read by a Non-Computer Account
id: 867d4fc8-a9d5-45ce-aa6f-26ba4bccde65
status: experimental
description: >-
Detects a read of the msDS-ManagedPassword attribute (schemaIDGUID
e362ed86-b728-0842-b27d-2dea7a9df218, Read Property 0x10) in event 4662 by an
account that is not a computer account. gMSA passwords are meant to be
retrieved by the computers that run the service, so a user or service account
reading one is unusual. Requires Audit Directory Service Access and a SACL
that audits Read Property on msDS-ManagedPassword for gMSA objects.
A read made with the computer account of a compromised host, including one
that is allowed to retrieve the password, is excluded by the filter and is not
detected.
references:
- https://learn.microsoft.com/en-us/windows/win32/adschema/a-msds-managedpassword
- https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-10/security/threat-protection/auditing/event-4662
author: Forestall
date: 2026-11-10
tags:
- attack.credential-access
- attack.t1555
logsource:
product: windows
service: security
detection:
selection:
EventID: 4662
AccessMask: '0x10'
Properties|contains: 'e362ed86-b728-0842-b27d-2dea7a9df218'
filter_computer_accounts:
SubjectUserName|endswith: '$'
condition: selection and not filter_computer_accounts
falsepositives:
- User or service accounts that were deliberately added to PrincipalsAllowedToRetrieveManagedPassword, for example for a scheduled task. Confirm the design and exclude them by exact SubjectUserName.
level: high
False positives
- User or service accounts that were deliberately added to PrincipalsAllowedToRetrieveManagedPassword, for example for a scheduled task. Confirm the design and exclude them by exact SubjectUserName.
gMSA Password Retrieval List Changed
Detects a value written to msDS-GroupMSAMembership (event 5136, Value Added). Active Directory uses this attribute for the access check that decides whether a requester may retrieve the password of a group managed service account. It is what the PrincipalsAllowedToRetrieveManagedPassword setting writes. A principal with write access to the gMSA can add itself to the list and then read the password, so the change is the step before the read that the other rule of this page watches. The attribute holds a security descriptor, and Microsoft does not document how event 5136 renders such a value, so the rule does not test the value. It fires on any write and does not say who was added. Read the current list on the gMSA after an alert. Requires Audit Directory Service Changes and a SACL that audits writes to the attribute on gMSA objects.
title: gMSA Password Retrieval List Changed
id: 49315db6-6a6b-4138-ac82-b33d2c71f5a0
status: experimental
description: >-
Detects a value written to msDS-GroupMSAMembership (event 5136, Value
Added). Active Directory uses this attribute for the access check that
decides whether a requester may retrieve the password of a group managed
service account. It is what the PrincipalsAllowedToRetrieveManagedPassword
setting writes. A principal with write access to the gMSA can add itself to
the list and then read the password, so the change is the step before the
read that the other rule of this page watches. The attribute holds a
security descriptor, and Microsoft does not document how event 5136
renders such a value, so the rule does not test the value. It fires on any
write and does not say who was added. Read the current list on the gMSA
after an alert. Requires Audit
Directory Service Changes and a SACL that audits writes to the attribute on
gMSA objects.
references:
- https://learn.microsoft.com/en-us/windows/win32/adschema/a-msds-groupmsamembership
- https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-10/security/threat-protection/auditing/event-5136
- https://learn.microsoft.com/en-us/windows-server/identity/ad-ds/manage/group-managed-service-accounts/group-managed-service-accounts/group-managed-service-accounts-overview
- https://attack.mitre.org/techniques/T1555/
author: Forestall
date: 2026-11-18
tags:
- attack.credential-access
- attack.t1555
logsource:
product: windows
service: security
detection:
selection:
EventID: 5136
AttributeLDAPDisplayName: msDS-GroupMSAMembership
OperationType:
- '%%14674'
- 'Value Added'
condition: selection
falsepositives:
- Administrators who add or remove the hosts of a service, for example when a server joins a farm or a gMSA is set up. The change should have a matching request. Confirm that the list holds only the computers that run the service.
level: medium
False positives
- Administrators who add or remove the hosts of a service, for example when a server joins a farm or a gMSA is set up. The change should have a matching request. Confirm that the list holds only the computers that run the service.
Detection logic
Patterns that need more than one event, a baseline or knowledge of your own environment. Each is a hypothesis to build and tune in your SIEM, not a ready rule.
gMSA retrieval list changed, then the password read by a non-computer account
An attacker with write access to a gMSA first adds a principal it controls to the list of accounts that may retrieve the password and then reads the password with it. Each step alone can be routine. A change of the list that is followed shortly by a read from an account that is not a computer is the pattern of the takeover.
- The retrieval list of a gMSA is written: event 5136 with
AttributeLDAPDisplayNamemsDS-GroupMSAMembership. KeepObjectDN,ObjectGUIDand the writer inSubjectUserName. - Within 24 hours the managed password of the same object is read: event 4662 with access mask 0x10 and the GUID e362ed86-b728-0842-b27d-2dea7a9df218 in
Properties. - Join the two on the object. Microsoft describes
ObjectNameof event 4662 as the distinguished name and its example shows the object GUID, so compare it with bothObjectDNandObjectGUIDof the first event. - Raise the priority when
SubjectUserNameof the read does not end with a dollar sign, or when it is the account that changed the list.
Events51364662
LimitsSetting up a new gMSA or adding a host to a service produces the same two events, with a computer account as the reader. The read is logged only where a SACL audits Read Property on msDS-ManagedPassword. The 24 hours are a starting point. An attacker who waits longer, or who reads the password with a computer account it controls, is not found this way.
Triage
- Identify the reader (SubjectUserName) and the gMSA (ObjectName), and check whether the reader is listed in that gMSA's PrincipalsAllowedToRetrieveManagedPassword and why.
- Correlate SubjectLogonId with event 4624 to find the source host; a read from a workstation or by an interactive user account is not normal service behaviour.
- Check recent 5136 events on the gMSA for changes to msDS-GroupMSAMembership or its DACL just before the read.
- If unexplained, remove the reader from the retrieval list and review where the account was used. The password that was read stays valid until Active Directory rotates it.
Response
Once the attack is confirmed:
- Disable the account that read the password, and take it out of the retrieval list or out of the group that put it there.
- If the retrieval list or the DACL of the gMSA was changed to make the read possible, restore both and remove the write access that allowed the change.
- Treat the gMSA as compromised until its password has changed. Removing the reader does not affect the password that was already read. Windows rotates a gMSA password on a fixed interval, 30 days by default, and Microsoft's password reset for managed service accounts applies to standalone accounts, not to gMSAs. Where waiting is not acceptable, move the service to a new gMSA and delete the old one.
- Review logons and ticket requests of the gMSA from hosts that do not run the service, and investigate the systems it reached. If the gMSA is a member of a privileged group, widen the response to everything that group controls.
- Confirm afterwards that reads of the password come only from the computers that run the service.
Mitigation
- Limit PrincipalsAllowedToRetrieveManagedPassword to the computer accounts (or a dedicated computer group) that run the service, never to user groups.
- Review who can write msDS-GroupMSAMembership or the DACL of each gMSA and remove non-administrative principals.
- Keep gMSAs out of privileged groups and grant them only the rights the service needs.
- Add a SACL that audits Read Property on msDS-ManagedPassword for gMSA objects so that retrievals are logged.
Frequently asked questions
Can the rule detect a read made from a compromised server that runs the service?
No. Reads by computer accounts are filtered out, because that is how the service hosts retrieve the password. An attacker who controls such a host, or any computer account on the retrieval list, reads the password in a way that looks like normal operation. Keep the retrieval list short and protect the hosts on it like the gMSA itself.
Why is no event logged when a gMSA password is retrieved?
Event 4662 is written for this read only when the gMSA objects have a SACL that audits Read Property on `msDS-ManagedPassword` and domain controllers have the audit subcategory Audit Directory Service Access enabled. Without the SACL, retrievals leave no event, by the service hosts or by anyone else.
Is removing the reader from the retrieval list enough?
No. The list controls who can read the password from now on. The password that was already read stays valid until Active Directory rotates it, and with it the attacker can authenticate as the gMSA wherever it has rights. Until the password has changed, treat every use of the account from an unexpected host as hostile.
What does a legitimate read by a non-computer account look like?
A user or service account that was deliberately added to PrincipalsAllowedToRetrieveManagedPassword, for example for a scheduled task, reads the password in the same way. Confirm the design with the owner of the service and exclude that account by its exact name. A read by an interactive user from a workstation is not that case.