returns queries in PowerShell objects, which can be piped to other cmdlets. This allows us to chain multiple commands together. View "Penetration Testing" & "Active Directory" pages for more. This page will cover PowerView for Cobalt Strike beacons & other C2s.
Note: Most privileges in a domain are delegated for groups, and not individual users. Samantha Coolio is part of IT & PC Support, we can assume they have high privileges.
beacon> powershell Get-DomainOU -Properties Name | sort -Property Name
name
----
Domain Controllers
SQL Servers
Internal Web Servers
Workstations
Get-DomainGPO
Return all Group Policy Objects (GPOs) or a specific GPO object. Note: To enumerate all GPOs that are applied to a particular machine, use -ComputerIdentity.
beacon> powershell Get-DomainGPO -Properties DisplayName | sort -Property DisplayName
displayname
-----------
Computer Certificates
Default Domain Controllers Policy
Default Domain Policy
LAPS
Proxy Settings
Server Admins
Vulnerable GPO
Windows Defender
Windows Firewall
Workstation Admins
Returns all GPOs that modify local group membership through Restricted Groups or Group Policy Preferences.
beacon> powershell Get-DomainGPOLocalGroup | select GPODisplayName, GroupName
GPODisplayName GroupName
-------------- ---------
Workstation Admins DEV\IT & PC Support
Server Admins DEV\IT & PC Support
Note: "IT & PC Support" group is assigned access to the machines these apply to. Machines connected to "Workstation Admins" & "Server Admins". A big one we're looking for is "Remote Desktop Users".
Get-DomainGPOUserLocalGroupMapping
Enumerates the machines where a specific domain user/group is a member of a specific local group. Note: Useful for finding where domain groups have local admin access.
beacon> powershell Get-DomainGPOUserLocalGroupMapping -LocalGroup Administrators | select ObjectName, GPODisplayName, ContainerName, ComputerName | fl
ObjectName : IT & PC Support
GPODisplayName : Server Admins
ContainerName : {OU=Servers,DC=dev,DC=rotta,DC=dev}
ComputerName : {internal-website.dev.rotta.dev, sql.dev.rotta.dev}
ObjectName : IT & PC Support
GPODisplayName : Workstation Admins
ContainerName : {OU=Workstations,DC=dev,DC=rotta,DC=dev}
ComputerName : {win10.dev.rotta.dev, win10.dev.rotta.dev}
Get-DomainTrust
Return all domain trusts for the current or specified domain.\