Control over wley using Responder & Hashcat →wley got forcechangepassword over damundsen→damundsen got GenericWrite over Help Desk Level 1 group →Help Desk Level 1 group is nested into Information Technology group. →IT Group got GenericAll over user adunn→adunn got DCSync ability on Domain object.
Let’s
Use wley user right to change the password of damundsen user
Authenticate as damundsen and abuse GenericWrite to add a user on Help Desk Level 1 group
Since Help Desk Level 1 group is nested in IT group, leverage GenericAll to take control of adunn user
forcechangepassword
Let’s authenticate as wley and force change the password of damundsen
PSCredential
Let’s first create PSCredential object for user wley:
Secure String
Next, let’s create SecureString Object which represents password we want to set for target user damundsen:
Change Password
Finally, let’s use Set-DomainUserPassword from PowerView to change target user damundsen’s password.
Now target user damundsen’s password has been changed to what we have set.
Now let’s authenticate as damundsen user and add ourselves to Help Desk Level 1 group.
GenericWrite
User damundsen got GenericWrite over Help Desk Level 1 group. Let’s abuse this and add damundsen to Help Desk Level 1 group.
SecureString
As earlier, create secure string for damundsen:
Add-DomainGroupMember
Next, let’s use Add-DomainGroupMember to add damundsen to the target group.
We will first confirm damundsen not being on Help Desk Level 1 group:
Now that we confirmed damundsen is not in the group, let’s add him to the group:
We can confirm damundsen was added to the group:
Now we are in Help Desk Level 1 group and since HDL1 group is nested in IT group, we have the IT group rights.
GenericAll
Now let’s move on to abusing GenericAll and taking control of user adunn.
Normally, with GenericAll, We can:
Modify group membership
Force change a password
Targeted Kerberoasting attack
Force Changing a password would be a simplist way take control of user adunn but let’s try targeted Kerberoasting attack for the sake of learning.
Targeted Kerberoasting
We can modify account’s ServicePrincipalName (SPN) attribute to create a fake SPN that we can then Kerberoast to obtain the TGS ticket and crack it.
On Linux host, we can use tool such as targetedKerberoastto perform this same attack. It will create a temporary SPN, retrieve hash, and delete the temporary SPN all in one command.
Create Fake SPN
We will use the SecureString created earlier for user damundsen and create a fake SPN:
Rubeus Kerberoasting
Let’s use Rubeus to Kerberoast on user adunn:
CleanUp
In terms of cleanup, there are a few things we need to do:
Remove the fake SPN we created on the adunn user.
Remove the damundsen user from the Help Desk Level 1 group
Set the password for the damundsen user back to its original value (if we know it) or have our client set it/alert the user
Remove fake SPN
Remove the fake SPN we created on the adunn user.
Remove added user from group
Remove the damundsen user from the Help Desk Level 1 group
Let’s confirm damundsen was removed from the group:
Remediation
Auditing for and removing dangerous ACLs - Use Bloodhound etc
Monitor group membership - changes in important group should be alerted to IT staff
we abused forcechangepassword and got control over damundsen→
Abused GenericWrite and got access to IT group → Abused GenericaAll, Targeted Kerberoasting to get access to adunn