Repository navigation
BadSuccessor
The BadSuccessor orchestrator automates the Akamai research on Windows Server 2025 Delegated Managed Service Accounts (dMSA). The attack chain abuses the msDS-ManagedAccountPrecededByLink attribute to inherit the Kerberos identity of an arbitrary account through dMSA migration semantics.
Status: shipped in v1.5. The three ADWS writes are implemented through the shared
ADWSConnect.put()helper. The post-exploitation step (requesting a service ticket as the migrated identity) relies on a patched impacket and is out of scope for Soaphound.py itself.
- A target DC running Windows Server 2025. The dMSA object class and the two Managed Account attributes are only present on that schema version.
- An attacker identity with
CreateChildpermissions formsDS-DelegatedManagedServiceAccounton at least one OU in the target domain. This is the only pre-requisite - no AdminSDHolder write, no local admin, no Kerberos TGS forging. - The DN of the target account to migrate (any user including Tier-0 principals, up to and including
krbtgt). - Clock within 5 minutes of the DC.
| Flag | Purpose |
|---|---|
--badsuccessor |
Enable the orchestrator. Mutually exclusive with the BloodHound collection flags. |
--target DN |
DN of the account to inherit from. Example: CN=Administrator,CN=Users,DC=corp,DC=local. |
--dmsa-cn CN |
Short name for the dMSA to create. Example: svc-badsuccessor$. |
--dmsa-ou OU_DN |
DN of the OU where the dMSA will be created. Must be an OU where the caller has CreateChild (msDS-DelegatedManagedServiceAccount). |
--dry-run |
Compute the three SOAP envelopes and print them; do not call the DC. |
--rollback |
Delete the dMSA created by a previous --badsuccessor run (identified by --dmsa-cn). |
| Step | Operation | SOAP body |
|---|---|---|
| 1 | WS-Transfer Create
|
New msDS-DelegatedManagedServiceAccount object under --dmsa-ou, with the mandatory msDS-ManagedPasswordId, msDS-ManagedPasswordInterval, msDS-GroupMSAMembership placeholders. |
| 2 | WS-Transfer Put
|
Set msDS-ManagedAccountPrecededByLink on the newly created dMSA to the DN passed in --target. |
| 3 | WS-Transfer Put
|
Set msDS-DelegatedMSAState=2 on the dMSA. State 2 marks the migration as "complete", which triggers the KDC into granting tickets for the dMSA that bundle the target's PAC on next lookup. |
All three operations ride a single ADWS session on tcp/9389. No LDAP write (4662 on writeProperty) is generated.
soaphound \
-u alice -p 'Password123!' \
-d corp.local \
-dc dc01.corp.local -dc-ip 10.0.0.10 \
--badsuccessor --dry-run \
--target 'CN=Administrator,CN=Users,DC=corp,DC=local' \
--dmsa-cn 'svc-bs$' \
--dmsa-ou 'OU=Delegated,DC=corp,DC=local'Dry-run output includes the three serialized WS-Transfer envelopes and the exact ResourceCreated / Put endpoints that would be hit on the DC.
soaphound \
-u alice -p 'Password123!' \
-d corp.local \
-dc dc01.corp.local -dc-ip 10.0.0.10 \
--badsuccessor \
--target 'CN=Administrator,CN=Users,DC=corp,DC=local' \
--dmsa-cn 'svc-bs$' \
--dmsa-ou 'OU=Delegated,DC=corp,DC=local'After the three writes complete, the attacker requests a service ticket for the dMSA. The KDC embeds the Administrator PAC into the response, giving the attacker code execution as Administrator against any service the dMSA is permitted to authenticate to. The ticket request step requires the Akamai-patched impacket: https://github.com/fortra/impacket/blob/master/examples/badsuccessor.py.
soaphound \
-u alice -p 'Password123!' \
-d corp.local \
-dc dc01.corp.local -dc-ip 10.0.0.10 \
--badsuccessor --rollback \
--dmsa-cn 'svc-bs$' \
--dmsa-ou 'OU=Delegated,DC=corp,DC=local'Deletes the dMSA via WS-Transfer Delete. The msDS-ManagedAccountPrecededByLink reference is cleaned up as part of the standard tombstoning.
- Transport:
tcp/9389only. No LDAP, no DCOM, no SMB. - DC-side events:
5137(object created) on step 1,5136(attribute modified) on steps 2 and 3. Both only fire with a per-container SACL and the Advanced Audit Policy "Directory Service Changes" subcategory enabled. - No
4662is generated for the writes because they are not routed through LDAP. - Kerberos events:
4769with the dMSA SPN on exploitation. The TGS request's PAC inheritance is not visible on the wire - only the ticket client identity is. -
--rollbackfires5141(object deleted) when SACLs are in place.
- Akamai research - "Introducing BadSuccessor": https://www.akamai.com/fr/blog/security-research/abusing-dmsa-for-privilege-escalation-in-active-directory
- Microsoft Delegated Managed Service Accounts: https://learn.microsoft.com/en-us/windows-server/identity/ad-ds/manage/delegated-managed-service-accounts/delegated-managed-service-accounts-overview
- MS-ADA2
msDS-ManagedAccountPrecededByLink: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-ada2/ -
src/soaphound/ad/adws.py-ADWSConnect.put()used for the two attribute writes