Last updated
Last updated
Modifying an existing GPO that is already applied to one or more OUs is the most straightforward scenario. To search for these, we need to enumerate all GPOs in the domain with Get-DomainGPO
and check the ACL of each one with Get-DomainObjectAcl
. We want to filter any for which a principal has modify privileges such as CreateChild, WriteProperty or GenericWrite, and also want to filter out the legitimate principals including SYSTEM, Domain Admins and Enterprise Admins.
One result has been returned. Let's resolve the GPO name and the SID of the principal.
This shows us that members of the "Developers" group can modify "Vulnerable GPO".
We also want to know which OU(s) this GPO applies to, and by extension which computers are in those OUs. GPOs are linked to an OU by modifying the gPLink
property of the OU itself. The Get-DomainOU
cmdlet has a handy -GPLink
parameter which takes a GPO GUID.
Finally, to get the computers in an OU, we can use Get-DomainComputer
and use the OU's distinguished name as a search base.
To modify a GPO without the use of GPMC (Group Policy Management Console), we can modify the associated files directly in SYSVOL (the gpcFileSysPath).
Here's an example using a Computer Startup Script. It will put a startup script in SYSVOL that will be executed each time an effected computer starts (which incidentally also acts as a good persistence mechanism).
Note that you can find this software
share using PowerView:
It can go in any remote location as long as it's accessible by the target computer(s)
Log into the console of Workstation 1 and run gpupdate /force
from a Command Prompt. Then reboot the machine. After it starts up, the DNS Beacon will execute as SYSTEM.
SharpGPOAbuse has other functions such as adding an immediate scheduled task that you may experiment with.
We can do that manually or use an automated tool such as , which has several abuses built into it.