We have valid credentials that gave us foothold to beachhead on the domain. Now we have to enumerate the domain to further gain access.
We will learn how to use Windows as the attack host to enumerate the domain.
Tools that can be used from Windows attack host:
- SharpHound/BloodHound
- PowerView/SharpView
- Grouper2
- Snaffler
With the beachhead system, we need to obtain information on:
- Misconfigurations
- Permissions
- How is the domain setup?
- Any trusts with other domains
- Pilaging File shares
Active Directory PowerShell Module
When we land on Windows host in the domain, there is a chance we can find valuable tools and scripts on the host.
AD PowerShell Module is a group of powershell cmdlets for administering AD environment.
It consists of 147 different cmdlets.
We first have to import the module.
The Get-Module cmdlet, which is part of the Microsoft.PowerShell.Core module, will list all available modules, their version, and potential commands for use.
Import Module
If the module is not loaded, run Import-Module ActiveDirectory
to load it for use.
To discover modules:
ActiveDirectory Module is not imported yet. Let’s import it:
Get Domain Info
Now that the module is imported, let’s get some basic information about the domain using Get-ADDomain cmdlet.
Get-ADUser
Now let’s get list of users on the domain:
Trust Relationships
Let’s check for domain trust relationships:
Above prints out any trust relationships the domain has.
- Trusts within our forest or with domains in other forests
- Type of trust
- Direction of trust
- Name of the domain the relationship is with
Group Enumeration
Let’s get some AD group information:
Detailed Group Info
Group Membership
All above process can be done super quick using Bloodhound.
PowerView
PowerView can be used for:
- Identifing where users are logged in on a network
- enumerate domain info like users, computers, groups, ACLS, trusts, and more
- Kerberoasting
- etc
Get-DomainUser
Let’s get all information on user we specify:
Recursive Group Membership
Let’s enumerate domain group information.
Trust Enumeration
Local Admin Access Test
Let’s test for local admin access on either the current machine or a remote one:
We can see that the current user is an administrator on the hoset ACADEMY-EA-MS01.
Users with SPN Set
Let’s look for users with SPN set. This users might be vulnerable to kerberoasting.
SharpView
PowerViewis not maintained anymore but it is still excellent for enumerating Active Directory.
To enumerate information about a specific user:
Snaffler
Snaffler is a tool that can help us acquire credentials or other sensitive data in an Active Directory environment.
It first obtains the list of hosts on the domain and enumerates those hosts for shares and readable directories.
-s
: Print the result on console back to us.
-d
: Domain to search within
-o
: Output
We many find passwords, SSH Keys, configuration files, and etc.
Moving On
We have enumerated the password policy, obtained valid list of users.
With those, we attempted password spraying and got a beachhead.
Using the domain joined beachead, we learned how to enumerate domain:
- users, groups, computers
- GPOs
- ACLs
- Local Admin rights
- Access Rights
- SPNs
- etc