Enumerating ACLs in Active Directory
This playbook covers the process of enumerating Access Control Lists (ACLs) in Active Directory environments. ACL enumeration is crucial for identifying potential attack paths and understanding the permissions structure within a domain. The importance of understanding the enumerations of ACLs cannot be over emphasised.
Key Concepts:
- ACL: Access Control List
- ACE: Access Control Entry
- SID: Security Identifier
Enumerating ACLs with PowerView
PowerView is a powerful tool for ACL enumeration in Active Directory environments.
Summary
- Use PowerView’s Find-InterestingDomainAcl function for initial enumeration
- Perform targeted enumeration using Get-DomainObjectACL
- Utilize the -ResolveGUIDs flag for human-readable output
Steps:
- Import PowerView module
- Convert target username to SID
- Use Get-DomainObjectACL with the target SID
- Analyze the output for interesting rights
Example:
Import-Module .\PowerView.ps1
$sid = Convert-NameToSid wley
Get-DomainObjectACL -ResolveGUIDs -Identity * | ? {$_.SecurityIdentifier -eq $sid}
Using Built-in PowerShell Cmdlets
When PowerView is not available, built-in PowerShell cmdlets can be used for ACL enumeration.
Summary
- Use Get-ADUser and Get-Acl cmdlets
- Create a list of domain users
- Iterate through users and check for specific access rights
Steps:
- Create a list of domain users
- Use a foreach loop to iterate through users
- Use Get-Acl to retrieve ACL information
- Filter results for specific users or rights
Example:
Get-ADUser -Filter * | Select-Object -ExpandProperty SamAccountName > ad_users.txt
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'}}
Enumerating ACLs with BloodHound
BloodHound provides a graphical interface for visualizing and analyzing ACLs.
Summary
- Upload data gathered with SharpHound ingestor
- Set starting node and explore Outbound Control Rights
- Utilize the Help menu for attack guidance and OPSEC considerations
Steps:
- Upload SharpHound data to BloodHound
- Set starting node (e.g., user wley)
- Explore Node Info tab and Outbound Control Rights
- Investigate First Degree Object Control and Transitive Object Control
- Use the Help menu for detailed attack information