> For the complete documentation index, see [llms.txt](https://alham-rizvi.gitbook.io/alhamrizvi/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://alham-rizvi.gitbook.io/alhamrizvi/active-directory/08.-dacl-abuse.md).

# 08. DACL Abuse

**What it is:** every object in Active Directory — users, groups, OUs, certificate templates — carries a **DACL** (Discretionary Access Control List), a set of Access Control Entries (ACEs) defining exactly who can do what to that object.

## Common Dangerous Rights

| Right          | What it lets you do                                                                       |
| -------------- | ----------------------------------------------------------------------------------------- |
| `GenericAll`   | Full control — change any attribute, including group membership, passwords, etc.          |
| `GenericWrite` | Write most attributes (not full control, but often enough — e.g. add yourself to a group) |
| `WriteOwner`   | Make yourself the object's owner, then grant yourself further rights                      |
| `WriteDACL`    | Directly edit the object's ACL to grant yourself any right you want                       |

## Why These Accumulate

Over an AD environment's lifetime, rights get delegated for legitimate reasons — a helpdesk script that needs to reset passwords, a service account that manages group membership — and they're rarely cleaned up. It's extremely common to find a low-privileged account sitting on excessive, forgotten rights over a sensitive object.

## Worked Example — Discovering and Abusing a Writable Object

```bash
# enumerate what jane.doe can write to
bloodyAD --host dc2.sub.htb -d sub.htb -u 'jane.doe@domain.htb' -k get writable
# -> CN=Sensitive Group,CN=Users,DC=sub,DC=htb : WRITE_DACL
```

Having `WriteDACL` means you can grant yourself anything, including full control:

```bash
bloodyAD --host dc2.sub.htb -d sub.htb -u 'jane.doe@domain.htb' -k \
  add genericAll 'CN=Sensitive Group,CN=Users,DC=sub,DC=htb' \
  '<jane.doe-SID>'
```

From `GenericAll`, you can now modify group membership, change the group's type (`09_Group_Scope.md`), or anything else needed for the next step in the chain.

## Note on Cross-Domain SIDs

When the target object is in a *different* domain than your account, name resolution across the trust can be unreliable — always use the raw SID of your principal instead of its `domain\username` form when granting rights across a forest boundary.

## Key Terms

| Term     | Definition                                                       |
| -------- | ---------------------------------------------------------------- |
| **DACL** | Discretionary Access Control List — per-object permissions in AD |
| **ACE**  | Access Control Entry — one rule within a DACL                    |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://alham-rizvi.gitbook.io/alhamrizvi/active-directory/08.-dacl-abuse.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
