Domain Enumeration with PowerView
PowerView is a PowerShell tool for enumerating a domain from a compromised host. This works through the common commands against the MARVEL domain.
PowerView Cheat Sheet: https://gist.github.com/HarmJ0y/184f9822b195c52dd50c379ed3117993
Load PowerView
Launch a command prompt and navigate to the directory that stores PowerView.ps1. Then start PowerShell with execution policy bypass so scripts can run:
powershell -ExecutionPolicy bypass
Initialize the script by dot-sourcing it:
. .\PowerView.ps1
Domain Details
Get-NetDomain gathers details on the machine and its relationship in the domain:
Get-NetDomain
Get-NetDomainController finds the DC for the environment:
Get-NetDomainController
This reveals the DC IP at 192.168.57.140 and the name HYDRA-DC.MARVEL.local.
Domain Policy
Learn more about the domain policies:
Get-DomainPolicy
The listed policies can be enumerated further by indexing into a value, such as:
(Get-DomainPolicy)."system access"
This discloses a password policy with a minimum of 7 characters required and no limit on failed login attempts.
Users
Find users in the domain:
Get-NetUser
Description fields can hold stored data that reveals avenues for account escalation or access:
We can also grep information like cn for usernames or samaccountname to find SAM accounts:
And grep the description field too:
User Properties
Another good command is Get-UserProperty:
Get-UserProperty
This can be narrowed by specifying the property to detail:
Get-UserProperty -Properties pwdlastset
The same applies to any other value, like logoncount:
One thing to note: accounts with 0 logon attempts could potentially be a honeypot account. Avoid these.
Computers
Find all computers in the domain:
Get-NetComputer
Get-NetComputer -fulldata lists more information.
Groups
To find domain admins:
Get-NetGroup -GroupName "Domain Admins"
A broader search for any admin:
Get-NetGroup -GroupName *admin*
To find members assigned to a group:
Get-NetGroupMember -GroupName "Domain Admins"
Shares
Invoke-ShareFinder finds all SMB shares in the network:
Invoke-ShareFinder
Group Policy
To find all the group policies:
Get-NetGPO
Narrow it down like this:
Get-NetGPO | select displayname, whenchanged