Enumeration
Domain Information
$ADCLass = [System.DirectoryServices.ActiveDirectory.Domain];$ADClass::GetCurrentDomain();
Get-WmiObject -Namespace root\directory\ldap -Class ds_domain | select ds_dc, ds_distinguishedname, pscomputername
#get DC
Get-WmiObject -Namespace root\directory\ldap -Class ds_computer | where {$_.ds_useraccountcontrol -match 532480} | select ds_cn, ds_dnshostname, ds_operatingsystem
#get servers
Get-WmiObject -Namespace root\directory\ldap -Class ds_computer | where {$_.ds_useraccountcontrol -match 4096} | select ds_cn, ds_dnshostname, ds_operatingsystemGet-NetDomain
Get-NetDomain -Domain <domain>
Get-DomainSID
Get-DomainPolicy
(Get-DomainPolicy)."system access"
(Get-DomainPolicy)."kerberos policy"
Get-NetDomainController
#Trust policies
Get-NetDomainTrust
Get-NetDomainTrust -Domain <domain>
#Forest
Get-NetForest
Get-NetForest -Forest <forest domain>
Get-NetForestDomain
Get-NetForestDomain -Forest <forest domain>
Get-NetForestCatalog
Get-NetForestCatalog -Forest <forest domain>
Get-NetForestTrust
Get-NetForestTrust -Forest <forest domain>Machines
Get-WmiObject -Namespace root\directory\ldap -Class ds_computerGet-NetComputer
Get-NetComputer -OperatingSystem "*<OS>*"
Get-NetComputer -Ping
Get-NetComputer -FullDataFind shares and files
Invoke-ShareFinder -Verbose
Invoke-FileFinder -Verbose //show files from readable shares
Get-NetFileServerGet-ADComputer -Filter * -Properties name | select name
Get-ADComputer -Filter 'OperatingSystem like "*<OS>*"' -Properties * | select name.OperatingSystem
Get-ADComputer -Filter * -Properties DNSHostName | %{Test-Connection -Count 1 -ComputerName $_.DNSHostName}
Get-ADComputer -Filter * -Properties *User Information
net user /domain #list all
net user <user>/domain #get info on the user
net accounts /domain #get info on the account policiesGet-WmiObject -Class win32_useraccount
Get-WmiObject -Class win32_useraccount | select name, domain, accounttypeList of machines where the current user is administrator
$pcs = Get-WmiObject -Namespace root\directory\ldap -Class ds_computer | select -ExpandProperty ds_cn
foreach ($pc in $pcs) {
(Get-WmiObject -Class win32_computersystem -ComputerName $pc -ErrorAction silentlycontinue).name
}Get-NetUser
Get-NetUser -Username <username>
Get-UserProperty #List of properties
Get-UserProperty -Properties <property> #value of property values for all users
Get-UserProperty -Properties description #might contain credentialsSearch a string in user properties
Find-userField -SearchField <property> -SearchTerm "<str>"Get logged users
Get-NetLoggedOn -ComputerName <fqd name> #requires local admin
Get-LoggedOnLocal -ComputerName <fqd name>
Get-LastLoggedOn -ComputerName <fqd name> #requires local admin
Get-NetSession -ComputerName <fqd name> #summary of users and concurrent sessionsUser Hunting
Find-LocalAdminAccess -Verbose //find all machines where current user is admin
Invoke-CheckLocalAdminAccess //check if user has admin privilege on given machine
Invoke-UserHunter //find machines where current user has sessions
Invoke-UserHunter -GroupName "RDPUsers" //find machines where user can RDP to
Invoke-UserHunter -CheckAccess //check for admin accessSearch a string in user properties
Groups
Users in group
Groups of user
Users in group
Groups of user
List all groups on a machine. Requires administrative privileges or the machine has to be a domain controller
Users in group
Groups of user
Group Policies (GPO)
Users under the machine's group policy
Organization Units
list GPO
get details of GPO
Last updated