Abusing Active Directory ACLs/ACEs
Reading time: 5 minutes
tip
Learn & practice AWS Hacking:HackTricks Training AWS Red Team Expert (ARTE)
Learn & practice GCP Hacking: HackTricks Training GCP Red Team Expert (GRTE)
Learn & practice Az Hacking: HackTricks Training Azure Red Team Expert (AzRTE)
Support HackTricks
- Check the subscription plans!
- Join the đŹ Discord group or the telegram group or follow us on Twitter đŚ @hacktricks_live.
- Share hacking tricks by submitting PRs to the HackTricks and HackTricks Cloud github repos.
Overview
Delegated Managed Service AccountsâŻ(dMSAs) are a brandânew AD principal type introduced with Windows ServerâŻ2025. They are designed to replace legacy service accounts by allowing a oneâclick âmigrationâ that automatically copies the old accountâs ServiceâŻPrincipalâŻNames (SPNs), group memberships, delegation settings, and even cryptographic keys into the new dMSA, giving applications a seamless cutâover and eliminating Kerberoasting risk.
Akamai researchers found that a single attribute â msDSâManagedAccountPrecededByLink
â tells the KDC which legacy account a dMSA âsucceedsâ. If an attacker can write that attribute (and toggle msDSâDelegatedMSAState
 ââŻ2), the KDC will happily build a PAC that inherits every SID of the chosen victim, effectively allowing the dMSA to impersonate any user, including Domain Admins.
What exactly is a dMSA?
- Built on top of gMSA technology but stored as the new AD class
msDSâDelegatedManagedServiceAccount
. - Supports an optâin migration: calling
StartâADServiceAccountMigration
links the dMSA to the legacy account, grants the legacy account write access tomsDSâGroupMSAMembership
, and flipsmsDSâDelegatedMSAState
âŻ=âŻ1. - After
CompleteâADServiceAccountMigration
, the superseded account is disabled and the dMSA becomes fully functional; any host that previously used the legacy account is automatically authorised to pull the dMSAâs password. - During authentication, the KDC embeds a KERBâSUPERSEDEDâBYâUSER hint so Windows 11/24H2 clients transparently retry with the dMSA.
##Â Requirements to attack
- At least one WindowsâŻServerâŻ2025 DC so that the dMSA LDAP class and KDC logic exist.
- Any objectâcreation or attributeâwrite rights on an OU (any OU) â e.g.Â
Create msDSâDelegatedManagedServiceAccount
or simply Create All Child Objects. Akamai found 91âŻ% of realâworld tenants grant such âbenignâ OU permissions to nonâadmins. - Ability to run tooling (PowerShell/Rubeus) from any domainâjoined host to request Kerberos tickets.
No control over the victim user is required; the attack never touches the target account directly.
Stepâbyâstep: BadSuccessor*privilege escalation
- Locate or create a dMSA you control
NewâADServiceAccount Attacker_dMSA ` âDNSHostName ad.lab ` âPath "OU=temp,DC=lab,DC=local"
Because you created the object inside an OU you can write to, you automatically own all its attributes .
- Simulate a âcompleted migrationâ in two LDAP writes:
- Set
msDSâManagedAccountPrecededByLink = DN
of any victim (e.g.CN=Administrator,CN=Users,DC=lab,DC=local
). - Set
msDSâDelegatedMSAState = 2
(migrationâcompleted).
- Set
Tools like SetâADComputer, ldapmodify, or even ADSIÂ Edit work; no domainâadmin rights are needed.
-
Request a TGT for the dMSA â Rubeus supports the
/dmsa
flag:Rubeus.exe asktgs /targetuser:attacker_dmsa$ /service:krbtgt/aka.test /dmsa /opsec /nowrap /ptt /ticket:<Machine TGT>
The returned PAC now contains the SID 500 (Administrator) plus Domain Admins/Enterprise Admins groups.
Gather all the users passwords
During legitimate migrations the KDC must let the new dMSA decrypt tickets issued to the old account before cutâover. To avoid breaking live sessions it places both currentâkeys and previousâkeys inside a new ASN.1 blob called KERBâDMSAâKEYâPACKAGE
.
Because our fake migration claims the dMSA succeeds the victim, the KDC dutifully copies the victimâs RC4âHMAC key into the previousâkeys list â even if the dMSA never had a âpreviousâ password. That RC4 key is unsalted, so it is effectively the victimâs NT hash, giving the attacker offline cracking or âpassâtheâhashâ capability.
Therefore, massâlinking thousands of users lets an attacker dump hashes âat scale,â turning BadSuccessor into both a privilegeâescalation and credentialâcompromise primitive.
Tools
- https://github.com/akamai/BadSuccessor
- https://github.com/logangoins/SharpSuccessor
- https://github.com/LuemmelSec/Pentest-Tools-Collection/blob/main/tools/ActiveDirectory/BadSuccessor.ps1
References
tip
Learn & practice AWS Hacking:HackTricks Training AWS Red Team Expert (ARTE)
Learn & practice GCP Hacking: HackTricks Training GCP Red Team Expert (GRTE)
Learn & practice Az Hacking: HackTricks Training Azure Red Team Expert (AzRTE)
Support HackTricks
- Check the subscription plans!
- Join the đŹ Discord group or the telegram group or follow us on Twitter đŚ @hacktricks_live.
- Share hacking tricks by submitting PRs to the HackTricks and HackTricks Cloud github repos.