PowerView
Find-InterestingDomainAcl- huge information dumped- We can streamline this process
Setup
- start with
wley- from llmnr linux Import-Module .\PowerView.ps1$sid = Convert-NameToSid wley
Get-DomainObjectACL
Get-DomainObjectACL -Identity * | ? {$_.SecurityIdentifier -eq $sid}- might take time to load results
- without
ResolveGUIDs- no clear picture of ACLs ObjectAceType- contains theGUIDvalue
- With
GUIDvalue:- search google for the
GUIDvalue - Reverse search & map guid value
$guid= "00299570-246d-11d0-a768-00aa006e0529"Get-ADObject -SearchBase "CN=Extended-Rights,$((Get-ADRootDSE).ConfigurationNamingContext)" -Filter {ObjectClass -like 'ControlAccessRight'} -Properties * |Select Name,DisplayName,DistinguishedName,rightsGuid| ?{$_.rightsGuid -eq $guid} | fl
- search google for the
- Instead of above, use the
ResolveGUIDsflag
MAIN COMMAND
- Get-DomainObjectACL -ResolveGUIDs -Identity * | ? {$_.SecurityIdentifier -eq $sid}
Without PowerShell, using System Tools
- using
Get-AclandGet-ADUser
Create a List of Domain Users
Get-ADUser -Filter * | Select-Object -ExpandProperty SamAccountName > ad_users.txt
Get-ADUser for loop
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'}}- This will output an
ObjectTypehaving a GUID
- This will output an
- With above results, we know that as user
wleywe have control over the userdamundsenviaUser-Force-Change-Password Get-ADUser -Filter 'Name -like "Dana Amundsen"' -Properties *
Further Enumeration
Enum user ACL
$sid2 = Convert-NameToSid damundsenGet-DomainObjectACL -ResolveGUIDs -Identity * | ? {$_.SecurityIdentifier -eq $sid2} -VerbosedamundsenhasGenericWriteoverHelp Desk Level 1- we can add any users to this group and inherit rights
Domain Group Enum
Get-DomainGroup -Identity "Help Desk Level 1"- If nothing interesting here, check the nested groups for inheritance
Get-DomainGroup -Identity "Help Desk Level 1" | select memberof
Enum User Group for ACLs
$itgroupsid = Convert-NameToSid "Information Technology"Get-DomainObjectACL -ResolveGUIDs -Identity * | ? {$_.SecurityIdentifier -eq $itgroupsid} -VerbosedamundsenhasGenericAlloveradunn
Enum adunn access
$adunnsid = Convert-NameToSid adunnGet-DomainObjectACL -ResolveGUIDs -Identity * | ? {$_.SecurityIdentifier -eq $adunnsid} -VerboseadunnhasDS-Replication-Get-ChangesandDS-Replication-Get-Changes-In-Filtered-Setover objects- USE
DCSyncattack
- USE
ACLs with BloodHound
Sharphoundingestor upload data onBloodHound- Set
wleyas aStarting nodein BloodHound - In
Node Info>Outbound Control Rights- Shows objects we have control over directly
- In
Node Info>Transitive Object Control- shows number of objects that our user could lead to us controlling
- Use pre-built queries to confirm the DCSync on
adunn