---
title: "Active Directory as a Directed Graph: How Security Descriptors and Object ACLs Actually Work"
description: "Active Directory stores every user, group, computer, and GPO as an LDAP object with a binary nTSecurityDescriptor. Walking the eight-hop escalation chain in GOAD's sevenkingdoms.local domain shows how ACE masks, Extended Rights GUIDs, and ownership changes turn helpdesk permissions into Domain Controller compromise."
date: 2026-11-03
author: Sevban Dönmez (@jankesec)
canonical: https://jankesec.com/posts/active-directory-acls-and-security-descriptors/
---

## Why Active Directory Behaves Like a Directed Graph Database

When an administrator opens *Active Directory Users and Computers*, the directory appears as a hierarchical tree of Organizational Units (`OUs`). However, this organizational hierarchy merely dictates where objects reside in LDAP (`distinguishedName`); it conveys virtually nothing about administrative control relationships.

Under the hood, Active Directory attaches a binary **`nTSecurityDescriptor`** (`[MS-DTYP §2.4.6]`) attribute to every directory object in `ntds.dit`. Within this security descriptor resides an ordered Discretionary Access Control List (`DACL`) consisting of Access Control Entries (`ACEs`). Each ACE explicitly pairs an authenticated identity (`Trustee SID`) with a specific set of operations (`AccessMask` and optional `ObjectType` GUID) over the target object. When directory objects are treated as **nodes** and non-default ACE entries as **directed edges**, the directory transforms into a complex directed graph.

In [GOAD (Game of Active Directory)](https://orange-cyberdefense.github.io/GOAD/), BloodHound maps an unbroken eight-hop path in `sevenkingdoms.local` starting from `tywin.lannister` (whose cleartext password is recovered from a `SYSVOL` script) straight to the Forest Root Domain Controller `KINGSLANDING$` (`192.168.56.10`). Deconstructing this path reveals how Windows Security Reference Monitor (`SRM`) access checks translate into administrative takeover.

<figure class="diagram">
<svg viewBox="0 0 760 360" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="Binary anatomy of the Active Directory nTSecurityDescriptor attribute and how the Security Reference Monitor converts an ACCESS_ALLOWED_OBJECT_ACE into an effective graph edge.">
<defs>
  <marker id="ad-en-d1-m-arr" viewBox="0 0 8 8" refX="7" refY="4" markerWidth="6" markerHeight="6" orient="auto"><path d="M0,0 L8,4 L0,8 z" class="dg-arrow" /></marker>
  <marker id="ad-en-d1-m-crit" viewBox="0 0 8 8" refX="7" refY="4" markerWidth="6" markerHeight="6" orient="auto"><path d="M0,0 L8,4 L0,8 z" class="dg-arrow-crit" /></marker>
</defs>
<text x="12" y="18" class="dg-muted">nTSecurityDescriptor ANATOMY · BINARY LAYOUT &amp; ACE EVALUATION ENGINE</text>
<rect x="12" y="30" width="226" height="318" rx="8" class="dg-box-accent" />
<text x="24" y="50" class="dg-accent">nTSecurityDescriptor</text>
<text x="24" y="66" class="dg-muted dg-compact">OBJECT BINARY ATTRIBUTE [MS-DTYP]</text>
<rect x="22" y="76" width="206" height="44" rx="5" class="dg-box" />
<text x="32" y="94" class="dg-label dg-compact">Control Flags (16-bit)</text>
<text x="32" y="110" class="dg-mono dg-compact">0x8004 (SE_DACL_PRESENT | SELF_REL)</text>
<rect x="22" y="128" width="206" height="52" rx="5" class="dg-box" />
<text x="32" y="146" class="dg-label dg-compact">Owner SID</text>
<text x="32" y="160" class="dg-mono dg-compact">S-1-5-32-544 (Domain Admins)</text>
<text x="32" y="172" class="dg-crit dg-compact">Implicit: WRITE_DAC &amp; READ_CONTROL</text>
<rect x="22" y="188" width="206" height="42" rx="5" class="dg-box" />
<text x="32" y="206" class="dg-label dg-compact">Group SID &amp; SACL</text>
<text x="32" y="220" class="dg-muted dg-compact">Primary Group SID · Audit ACE Array</text>
<rect x="22" y="238" width="206" height="98" rx="5" class="dg-box-accent" />
<text x="32" y="258" class="dg-accent dg-compact">DACL (Ordered ACE Array)</text>
<text x="32" y="274" class="dg-mono dg-compact">Canonical: Explicit Deny ➔ Allow</text>
<text x="32" y="290" class="dg-label dg-compact">AceCount: Active ACE Records</text>
<text x="32" y="306" class="dg-muted dg-compact">Each ACE: AccessMask + ObjectType</text>
<text x="32" y="322" class="dg-crit dg-compact">BloodHound Ingestion ➔</text>
<line x1="228" y1="287" x2="256" y2="287" class="dg-line" marker-end="url(#ad-en-d1-m-arr)" />
<rect x="260" y="30" width="244" height="318" rx="8" class="dg-box" />
<text x="272" y="50" class="dg-label">ACCESS_ALLOWED_OBJECT_ACE</text>
<text x="272" y="66" class="dg-muted dg-compact">TYPE 0x05 · OBJECT-SPECIFIC ACE</text>
<rect x="270" y="76" width="224" height="44" rx="5" class="dg-box" />
<text x="280" y="94" class="dg-label dg-compact">ACE Header (4 Bytes)</text>
<text x="280" y="110" class="dg-mono dg-compact">Type: 0x05 · Flags: 0x00 (Explicit)</text>
<rect x="270" y="128" width="224" height="52" rx="5" class="dg-box-accent" />
<text x="280" y="146" class="dg-label dg-compact">AccessMask (32-bit Bitmask)</text>
<text x="280" y="160" class="dg-mono dg-compact">0x00000100 (ControlAccess)</text>
<text x="280" y="172" class="dg-accent dg-compact">Extended Right Operation Filter</text>
<rect x="270" y="188" width="224" height="66" rx="5" class="dg-box-accent" />
<text x="280" y="206" class="dg-label dg-compact">ObjectType GUID (128-bit)</text>
<text x="280" y="222" class="dg-mono dg-compact">00299570-246d-11d0-a768-00aa006e0529</text>
<text x="280" y="238" class="dg-crit dg-compact">CN=User-Force-Change-Password</text>
<rect x="270" y="262" width="224" height="74" rx="5" class="dg-box" />
<text x="280" y="280" class="dg-label dg-compact">Trustee SID (Grantee Account)</text>
<text x="280" y="296" class="dg-mono dg-compact">S-1-5-21-3291916993-...-1113</text>
<text x="280" y="312" class="dg-accent dg-compact">Identity: tywin.lannister</text>
<text x="280" y="326" class="dg-muted dg-compact">Holds explicit right on target</text>
<line x1="504" y1="221" x2="526" y2="221" class="dg-line-crit" marker-end="url(#ad-en-d1-m-crit)" />
<rect x="530" y="30" width="218" height="318" rx="8" class="dg-box-danger" />
<text x="542" y="50" class="dg-crit" font-weight="700">SRM &amp; GRAPH RESOLUTION</text>
<text x="542" y="66" class="dg-muted dg-compact">SECURITY REFERENCE MONITOR</text>
<rect x="538" y="76" width="202" height="52" rx="5" class="dg-box" />
<text x="548" y="94" class="dg-label dg-compact">Access Check Invocation</text>
<text x="548" y="108" class="dg-mono dg-compact">Caller Token: tywin (SID 1113)</text>
<text x="548" y="120" class="dg-muted dg-compact">Target Object: jaime (SID 1114)</text>
<rect x="538" y="136" width="202" height="54" rx="5" class="dg-box" />
<text x="548" y="154" class="dg-label dg-compact">Evaluation Engine</text>
<text x="548" y="168" class="dg-mono dg-compact">Token SIDs match Trustee SID?</text>
<text x="548" y="180" class="dg-ok dg-compact">STATUS_SUCCESS (Granted)</text>
<rect x="538" y="198" width="202" height="138" rx="5" class="dg-box-danger" />
<text x="548" y="218" class="dg-crit dg-compact" font-weight="700">EFFECTIVE GRAPH EDGE</text>
<text x="548" y="234" class="dg-label dg-compact">Node: tywin.lannister</text>
<text x="548" y="252" class="dg-crit dg-compact">──[ForceChangePassword]──►</text>
<text x="548" y="270" class="dg-label dg-compact">Target: jaime.lannister</text>
<text x="548" y="292" class="dg-mono dg-compact">Primitive: Reset unicodePwd</text>
<text x="548" y="308" class="dg-muted dg-compact">Tool: net rpc / bloodyAD</text>
<text x="548" y="324" class="dg-accent dg-compact">Outcome: Account Compromised</text>
</svg>
<figcaption>Binary architecture of the Active Directory <code>nTSecurityDescriptor</code>: The Security Reference Monitor (SRM) parses DACL entries (ACEs) against caller token SIDs to establish attack graph edges.</figcaption>
</figure>

---

## 1. Anatomy of an Object-Specific ACE (`ACCESS_ALLOWED_OBJECT_ACE`)

Unlike NTFS filesystem permissions where access masks simply encode generic read, write, and execute flags, Active Directory objects represent rich schema entities containing dozens of distinct attributes (`member`, `servicePrincipalName`, `msDS-KeyCredentialLink`) and specialized operations (`User-Force-Change-Password`, `DS-Replication-Get-Changes-All`).

To provide fine-grained delegation without exhausting bits in a 32-bit mask, Active Directory utilizes **Object-Specific ACEs (`ACCESS_ALLOWED_OBJECT_ACE`, Type `0x05`)**:

1. **`AccessMask` (`ActiveDirectoryRights`):** Encodes the operational class (`0x00000020 = ADS_RIGHT_DS_WRITE_PROP`, `0x00000100 = ADS_RIGHT_DS_CONTROL_ACCESS`, `0x00040000 = WRITE_DAC`, `0x00080000 = WRITE_OWNER`, `0x10000000 = GENERIC_ALL`).
2. **`ObjectType` (128-bit GUID):** Restricts the `AccessMask` to a specific attribute schema GUID or Extended Right GUID. When `ObjectType` is null (`GUID_NULL`), the permission applies unconditionally to **all attributes or operations** across the object.

Inspecting non-inherited ACE entries across the eight targets in `sevenkingdoms.local` using `impacket-dacledit`:

```bash
Principal (Trustee SID)                  RightName            Inherited  Target Object (SID)
---------------------------------------  -------------------  ---------  ---------------------------------------------
TYWIN.LANNISTER (...-1113)               ForceChangePassword  False      JAIME.LANNISTER (...-1114)
JAIME.LANNISTER (...-1114)               GenericWrite         False      JOFFREY.BARATHEON (...-1118)
JOFFREY.BARATHEON (...-1118)             WriteDacl            False      TYRON.LANNISTER (...-1116)
TYRON.LANNISTER (...-1116)               AddSelf              False      SMALL COUNCIL (...-1108)
SMALL COUNCIL (...-1108)                 AddMember            False      DRAGONSTONE (...-1109)
DRAGONSTONE (...-1109)                   WriteOwner           False      KINGSGUARD (...-1110)
KINGSGUARD (...-1110)                    GenericAll           False      STANNIS.BARATHEON (...-1120)
STANNIS.BARATHEON (...-1120)             GenericAll           False      KINGSLANDING.SEVENKINGDOMS.LOCAL (...-1001)
```

<figure class="diagram">
<svg viewBox="0 0 760 442" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="The eight-hop Active Directory DACL privilege escalation graph in GOAD sevenkingdoms.local: from low-privileged tywin.lannister through group nesting and object ownership takeovers to Domain Controller KINGSLANDING.">
<defs>
  <marker id="ad-en-d2-m-right" viewBox="0 0 8 8" refX="7" refY="4" markerWidth="6" markerHeight="6" orient="auto"><path d="M0,0 L8,4 L0,8 z" class="dg-arrow-crit" /></marker>
  <marker id="ad-en-d2-m-left" viewBox="0 0 8 8" refX="1" refY="4" markerWidth="6" markerHeight="6" orient="auto"><path d="M8,0 L0,4 L8,8 z" class="dg-arrow-crit" /></marker>
  <marker id="ad-en-d2-m-down" viewBox="0 0 8 8" refX="4" refY="7" markerWidth="6" markerHeight="6" orient="auto"><path d="M0,0 L4,8 L8,0 z" class="dg-arrow-crit" /></marker>
</defs>
<text x="12" y="18" class="dg-muted">GOAD SEVENKINGDOMS.LOCAL · 8-HOP PRIVILEGE ESCALATION DIRECTED GRAPH</text>
<rect x="12" y="28" width="736" height="114" rx="8" class="dg-box-accent" />
<text x="22" y="44" class="dg-accent dg-compact">STAGE 1 · USER ACCOUNT HOPS (EXTENDED RIGHTS &amp; PROPERTY WRITES)</text>
<rect x="22" y="54" width="130" height="76" rx="6" class="dg-box" />
<text x="30" y="71" class="dg-accent dg-compact">[ENTRY · USER]</text>
<text x="30" y="88" class="dg-label">tywin.lannister</text>
<text x="30" y="104" class="dg-mono dg-compact">RID 1113 · SYSVOL</text>
<text x="30" y="117" class="dg-muted dg-compact">Cleartext Password</text>
<line x1="152" y1="92" x2="210" y2="92" class="dg-line-crit" marker-end="url(#ad-en-d2-m-right)" />
<rect x="156" y="65" width="50" height="16" rx="3" class="dg-box-danger" />
<text x="181" y="76" text-anchor="middle" class="dg-crit dg-compact" font-size="8">1: FCP</text>
<rect x="215" y="54" width="130" height="76" rx="6" class="dg-box" />
<text x="223" y="71" class="dg-muted dg-compact">[USER · RESET]</text>
<text x="223" y="88" class="dg-label">jaime.lannister</text>
<text x="223" y="104" class="dg-mono dg-compact">RID 1114 · Reset</text>
<text x="223" y="117" class="dg-accent dg-compact">net rpc password</text>
<line x1="345" y1="92" x2="403" y2="92" class="dg-line-crit" marker-end="url(#ad-en-d2-m-right)" />
<rect x="349" y="65" width="50" height="16" rx="3" class="dg-box-danger" />
<text x="374" y="76" text-anchor="middle" class="dg-crit dg-compact" font-size="8">2: GW</text>
<rect x="408" y="54" width="130" height="76" rx="6" class="dg-box" />
<text x="416" y="71" class="dg-muted dg-compact">[USER · SHADOW]</text>
<text x="416" y="88" class="dg-label">joffrey.baratheon</text>
<text x="416" y="104" class="dg-mono dg-compact">RID 1118 · PKINIT</text>
<text x="416" y="117" class="dg-accent dg-compact">pywhisker (KeyCred)</text>
<line x1="538" y1="92" x2="596" y2="92" class="dg-line-crit" marker-end="url(#ad-en-d2-m-right)" />
<rect x="542" y="65" width="50" height="16" rx="3" class="dg-box-danger" />
<text x="567" y="76" text-anchor="middle" class="dg-crit dg-compact" font-size="8">3: WD</text>
<rect x="601" y="54" width="137" height="76" rx="6" class="dg-box-accent" />
<text x="609" y="71" class="dg-crit dg-compact">[USER · DACL EDIT]</text>
<text x="609" y="88" class="dg-label">tyron.lannister</text>
<text x="609" y="104" class="dg-mono dg-compact">RID 1116 · FullCtrl</text>
<text x="609" y="117" class="dg-accent dg-compact">impacket-dacledit</text>
<line x1="670" y1="130" x2="670" y2="168" class="dg-line-crit" marker-end="url(#ad-en-d2-m-down)" />
<rect x="680" y="137" width="56" height="22" rx="4" class="dg-box-danger" />
<text x="708" y="148" text-anchor="middle" class="dg-crit dg-compact" font-weight="700">Hop 4</text>
<text x="708" y="156" text-anchor="middle" class="dg-label dg-compact" font-size="7.5">AddSelf</text>
<rect x="12" y="168" width="736" height="114" rx="8" class="dg-box" />
<text x="22" y="184" class="dg-muted dg-compact">STAGE 2 · SECURITY GROUP NESTING &amp; OBJECT OWNERSHIP REWRITES</text>
<rect x="508" y="194" width="230" height="76" rx="6" class="dg-box" />
<text x="518" y="212" class="dg-muted dg-compact">[GROUP · SELF-ENROLL]</text>
<text x="518" y="230" class="dg-label">SMALL COUNCIL</text>
<text x="518" y="246" class="dg-mono dg-compact">RID 1108 · bloodyAD add self</text>
<text x="518" y="258" class="dg-accent dg-compact">tyron self-adds to group</text>
<line x1="508" y1="232" x2="456" y2="232" class="dg-line-crit" marker-end="url(#ad-en-d2-m-left)" />
<rect x="458" y="205" width="46" height="16" rx="3" class="dg-box-danger" />
<text x="481" y="216" text-anchor="middle" class="dg-crit dg-compact" font-size="8">5: AM</text>
<rect x="248" y="194" width="204" height="76" rx="6" class="dg-box" />
<text x="258" y="212" class="dg-muted dg-compact">[GROUP · NESTED]</text>
<text x="258" y="230" class="dg-label">DRAGONSTONE</text>
<text x="258" y="246" class="dg-mono dg-compact">RID 1109 · member attribute</text>
<text x="258" y="258" class="dg-accent dg-compact">WriteProperty on member</text>
<line x1="248" y1="232" x2="196" y2="232" class="dg-line-crit" marker-end="url(#ad-en-d2-m-left)" />
<rect x="198" y="205" width="46" height="16" rx="3" class="dg-box-danger" />
<text x="221" y="216" text-anchor="middle" class="dg-crit dg-compact" font-size="8">6: WO</text>
<rect x="22" y="194" width="170" height="76" rx="6" class="dg-box-accent" />
<text x="32" y="212" class="dg-crit dg-compact">[GROUP · TAKEOVER]</text>
<text x="32" y="230" class="dg-label">KINGSGUARD</text>
<text x="32" y="246" class="dg-mono dg-compact">RID 1110 · Owner Changed</text>
<text x="32" y="258" class="dg-accent dg-compact">impacket-owneredit</text>
<line x1="107" y1="270" x2="107" y2="308" class="dg-line-crit" marker-end="url(#ad-en-d2-m-down)" />
<rect x="117" y="277" width="68" height="22" rx="4" class="dg-box-danger" />
<text x="151" y="288" text-anchor="middle" class="dg-crit dg-compact" font-weight="700">Hop 7</text>
<text x="151" y="296" text-anchor="middle" class="dg-label dg-compact" font-size="7.5">GenericAll</text>
<rect x="12" y="308" width="736" height="124" rx="8" class="dg-box-danger" />
<text x="22" y="324" class="dg-crit dg-compact" font-weight="700">STAGE 3 · RESOURCE-BASED CONSTRAINED DELEGATION (RBCD) &amp; FOREST TAKEOVER</text>
<rect x="22" y="334" width="240" height="86" rx="6" class="dg-box" />
<text x="32" y="352" class="dg-muted dg-compact">[USER · CONTROLLED PRINCIPAL]</text>
<text x="32" y="370" class="dg-label">stannis.baratheon</text>
<text x="32" y="386" class="dg-mono dg-compact">RID 1120 · GenericAll Target</text>
<text x="32" y="402" class="dg-accent dg-compact">pywhisker (Shadow Cred) ➔ TGT</text>
<line x1="262" y1="377" x2="370" y2="377" class="dg-line-crit" marker-end="url(#ad-en-d2-m-right)" />
<rect x="272" y="349" width="94" height="26" rx="4" class="dg-box-danger" />
<text x="319" y="361" text-anchor="middle" class="dg-crit dg-compact" font-weight="700">Hop 8: GenericAll</text>
<text x="319" y="371" text-anchor="middle" class="dg-mono dg-compact" font-size="8">RBCD · S4U2Proxy</text>
<rect x="376" y="334" width="362" height="86" rx="6" class="dg-box-danger" />
<text x="388" y="352" class="dg-crit dg-compact" font-weight="700">[TIER-0 FOREST ROOT DOMAIN CONTROLLER]</text>
<text x="388" y="370" class="dg-label" font-size="14">KINGSLANDING.SEVENKINGDOMS.LOCAL</text>
<text x="388" y="386" class="dg-mono dg-compact">192.168.56.10 · RID 1001 · DC01$ (Computer)</text>
<text x="388" y="404" class="dg-crit dg-compact" font-weight="700">DCSync (krbtgt + DA Hashes) ➔ FULL FOREST ROOT COMPROMISE</text>
</svg>
<figcaption>The full 8-hop privilege escalation graph in <code>sevenkingdoms.local</code>: from entry point <code>tywin.lannister</code> through password resets, shadow credentials, DACL rewrites, group nesting, and object ownership to Tier-0 Forest Root takeover via RBCD and DCSync.</figcaption>
</figure>

---

## 2. Extended Rights: Operations Beyond Attribute Writes

Hop 1 demonstrates why the two-part ACE exists. A user password cannot be updated by setting a cleartext string over LDAP: `unicodePwd` requires specialized protocol wrapping. Resetting a password without knowing the existing credential is an **Extended Right (`ADS_RIGHT_DS_CONTROL_ACCESS` / `0x100`)**:

```bash
$ impacket-dacledit -action read -principal tywin.lannister -target jaime.lannister \
    'sevenkingdoms.local/samwell.tarly:Heartsbane' -dc-ip 192.168.56.10
[*] ACE[0] info:
[*]   ACE Type                  : ACCESS_ALLOWED_OBJECT_ACE
[*]   AccessMask                : ControlAccess (0x00000100)
[*]   ObjectType                : User-Force-Change-Password (00299570-246d-11d0-a768-00aa006e0529)
```

When `AccessMask` contains `0x00000100`, the KDC resolves `ObjectType` against `CN=Extended-Rights,CN=Configuration`:
- **`00299570-246d-11d0-a768-00aa006e0529` (`User-Force-Change-Password`):** Permits `tywin.lannister` to issue RPC `SamrSetInformationUser` (`net rpc password`) or LDAPS password modifications (`bloodyAD set password`) against `jaime.lannister`.
- **`1131f6ad-9c07-11d1-f79f-00c04fc2dcd2` (`DS-Replication-Get-Changes-All`):** When granted on the domain partition root (`DC=sevenkingdoms,DC=local`), permits non-DC accounts to invoke `DRSGetNCChanges` (`DCSync`), retrieving password hashes forest-wide.

---

## 3. Property Writes: Scoped Rights vs. GenericWrite

Hops 2, 4, and 5 illustrate property write delegation:

1. **`AddMember` (`SMALL COUNCIL` to `DRAGONSTONE`):** `AccessMask = 0x20` (`WriteProperty`) filtered by `ObjectType = bf9679c0-0de6-11d0-a285-00aa003049e2` (the schema GUID for the **`member`** attribute). Any member of `SMALL COUNCIL` can append arbitrary user accounts into `DRAGONSTONE`.
2. **`AddSelf` (`tyron.lannister` to `SMALL COUNCIL`):** Combines `ADS_RIGHT_DS_SELF` (`0x08`) with the `Self-Membership` GUID (`bf9679c0-0de6-11d0-a285-00aa003049e2`). `tyron.lannister` is restricted strictly to appending his *own* identity to the group.
3. **`GenericWrite` (`jaime.lannister` to `joffrey.baratheon`):** Grants `WriteProperty` (`0x20`) across *all non-protected attributes* without GUID filtering. Crucially, `GenericWrite` lacks `ControlAccess` (`0x100`), so `jaime` cannot directly force-reset `joffrey`'s password.

Instead, `GenericWrite` enables three modern takeover primitives:
- **Shadow Credentials (`msDS-KeyCredentialLink`):** Injecting an X.509 certificate public key structure into `msDS-KeyCredentialLink` (`5b47d60f-6090-40b2-9f37-2a4de88f3063`) allows acquiring a Kerberos TGT and recovering the user's NT hash via PKINIT without altering the user's password.
- **Targeted Kerberoasting (`servicePrincipalName`):** Writing a fake SPN to `servicePrincipalName`, requesting a service ticket, and cracking the password hash offline.
- **Computer RBCD (`msDS-AllowedToActOnBehalfOfOtherIdentity`):** When the target is a computer, writing a machine account SID into `msDS-AllowedToActOnBehalfOfOtherIdentity` enables `S4U2Proxy` execution as `Administrator`.

---

## 4. Security Descriptor Manipulation: `WriteDacl`, `WriteOwner`, and `GenericAll`

Hops 3, 6, 7, and 8 target the `nTSecurityDescriptor` binary structure itself:

- **`WriteDacl` (`0x00040000`, `joffrey` to `tyron`):** Grants permission to rewrite the target's DACL, permitting the injection of an explicit `GenericAll` ACE.
- **`WriteOwner` (`0x00080000`, `DRAGONSTONE` to `KINGSGUARD`):** Permits changing the object's Owner SID. Under Windows SRM architecture (`[MS-DTYP]`), **an object's Owner inherently possesses implicit `READ_CONTROL` and `WRITE_DAC` (`0x00040000`) permissions**, even if the DACL explicitly denies access. Consequently, `WriteOwner` is mathematically equivalent to `WriteDacl`.
- **`GenericAll` (`0x10000000`, `stannis` to `KINGSLANDING$`):** Encompasses all standard, specific, and generic rights. Holding `GenericAll` on a Domain Controller computer object enables immediate takeover via RBCD or Shadow Credentials, resulting in `DCSync` domain dominance.

---

## Telemetry and Defensive Engineering

### Directory Access Control Telemetry Matrix

| Event ID | Log Provider | Event Name | Technical Context |
| :--- | :--- | :--- | :--- |
| `5136` | Directory Service Changes | A Directory Object Was Modified | Logs attribute modifications including `nTSecurityDescriptor`, `msDS-KeyCredentialLink`, and `msDS-AllowedToActOnBehalfOfOtherIdentity`. |
| `4724` | Security | Password Reset Attempt | Tracks execution of `User-Force-Change-Password` extended right. |
| `4728` / `4732` / `4756` | Security | Member Added to Security Group | Logs additions to global, domain local, or universal security groups. |
| `4738` | Security | User Account Modified | Monitors additions of `servicePrincipalName` (Targeted Kerberoasting). |

```kql
// KQL Query: Detect Unauthorized Modifications to Active Directory Security Descriptors
SecurityEvent
| where EventID == 5136
| where AttributeLDAPDisplayName in~ ("nTSecurityDescriptor", "msDS-AllowedToActOnBehalfOfOtherIdentity", "msDS-KeyCredentialLink")
| project TimeGenerated, Computer, SubjectUserName, ObjectDN, AttributeLDAPDisplayName, OperationType
```

### Remediation and Boundary Enforcement

1. **Enforce AdminSDHolder Protection:** High-privilege objects (Domain Admins, Enterprise Admins) must remain protected by `AdminSDHolder`. The `SDProp` process runs every 60 minutes to overwrite unauthorized DACL alterations.
2. **Audit Tier-0 Object Ownership:** Ensure object ownership (`Owner SID`) on Tier-0 accounts and groups is strictly assigned to `Domain Admins` or `Enterprise Admins`.
3. **Eliminate Transitive Permission Chains:** Use BloodHound to audit and prune transitive permission chains linking Tier-2 or Tier-1 identities to Tier-0 assets.

---

## Summary of ACL Primitives

| Right Name | Binary Representation (`AccessMask` + `ObjectType`) | GOAD Exploit Step | Execution Primitive | Detection Telemetry |
| :--- | :--- | :--- | :--- | :--- |
| **`ForceChangePassword`** | `0x00000100` (`ControlAccess`) + `User-Force-Change-Password` | `tywin` → `jaime` | Overwrite `unicodePwd` via RPC/SAMR or LDAPS. | Event ID `4724`; restrict helpdesk reset delegation. |
| **`GenericWrite`** | `0x00020028` (`ReadControl \| Self \| WriteProp`) | `jaime` → `joffrey` | Shadow Credentials (`msDS-KeyCredentialLink`) or RBCD. | Event ID `5136` on sensitive LDAP attributes. |
| **`AddSelf` / `AddMember`** | `0x00000008` / `0x00000020` + `member` GUID | `tyron` → `SMALL COUNCIL` → `DRAGONSTONE` | Inject user DN into group `member` attribute. | Event IDs `4728`, `4732`, `4756`. |
| **`WriteDacl`** | `0x00040000` (`WRITE_DAC`) | `joffrey` → `tyron` | Inject `GenericAll` ACE into target DACL. | Event ID `5136` on `nTSecurityDescriptor`. |
| **`WriteOwner`** | `0x00080000` (`WRITE_OWNER`) | `DRAGONSTONE` → `KINGSGUARD` | Change Owner SID to gain implicit `WRITE_DAC`. | Event ID `5136`; audit non-default object owners. |
| **`GenericAll`** | `0x10000000` (`GENERIC_ALL`) | `stannis` → `KINGSLANDING$` | Full object control; RBCD or Shadow Credentials on DC. | Protect Tier-0 with `AdminSDHolder` / `SDProp`. |

---

## Evidence and limits

The ACE dumps, GUIDs, and eight-hop examples come from the GOAD directory used in Part 3. `impacket-dacledit` output was compared with the corresponding BloodHound edges and the Microsoft definitions of `ACCESS_ALLOWED_OBJECT_ACE`, access masks, and object-specific rights. The article therefore treats BloodHound as a path finder and the directory security descriptor as the authority.

This is not an exhaustive Windows authorization model. Inheritance, deny ACE ordering, AdminSDHolder, protected objects, validated writes, and application-specific checks can change effective access. A graph edge is a testable hypothesis until the precise ACE and target behavior are verified; the examples here were verified only in the isolated GOAD lab.

## References

- **Microsoft Open Specifications, `[MS-ADTS]` §5.1.3 Authorization:** [learn.microsoft.com/en-us/openspecs/windows_protocols/ms-adts](https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-adts/4e11a7e6-e18c-46e4-a781-3ca2b4de6f30)
- **Microsoft Open Specifications, `[MS-DTYP]` §2.4.6 `SECURITY_DESCRIPTOR` and `ACE` Structures:** [learn.microsoft.com/en-us/openspecs/windows_protocols/ms-dtyp](https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-dtyp/7d4dac05-9cef-4563-a058-f108abecce1d)
- **Orange Cyberdefense, GOAD (Game of Active Directory):** [orange-cyberdefense.github.io/GOAD](https://orange-cyberdefense.github.io/GOAD/)
- **MITRE ATT&CK, File and Directory Permissions Modification: Windows (`T1222.001`):** [attack.mitre.org/techniques/T1222/001](https://attack.mitre.org/techniques/T1222/001/)