๐Ÿ“”Enumerating Group Policy Objects (GPOs)

GPO Abuse

  • Adding additional rights to a user

  • Adding a local admin

  • Creating an immediate scheduled task

Gain Persistence Via GPOs

  • Configure a GPO to run any of the above attacks.

  • Create a scheduled task to modify group membership, add an account, run DCSync, or send back a reverse shell connection.

  • Install targeted malware across the entire Domain.

Gathering GPO Data

GPO Names

Code

Get-DomainGPO | select displayname

Specific Computer

Code

gpresult (Built-in Tool)

Code

Output Result in HTML

Code

GPO Permissions

Get-DomainGPO | Get-ObjectAcl

Code

Get-GPO

Code

Example

Code Execution Via GP

Paths

  • Add Registry Autoruns

  • Software Installation (Install MSI Package that exists on a share)

  • Scripts in the Startup/Shutdown for a Machine or User

  • Create Shortcuts on Desktops that point to files

  • Scheduled Tasks

If any of the paths points to a file on a share, enumerate the permissions to check if non-administrators can edit the file. The tools will often miss this because they only look at if the Group Policy itself is write-able, not if the executables/scripts the group policy references are writeable.

Last updated