Create & Link a GPO
Find principals that can create new GPOs in the domain
powershell Get-DomainObjectAcl -Identity "CN=Policies,CN=System,DC=dev,DC=cyberbotic,DC=io" -ResolveGUIDs | ? { $_.ObjectAceType -eq "Group-Policy-Container" -and $_.ActiveDirectoryRights -contains "CreateChild" } | % { ConvertFrom-SID $_.SecurityIdentifier }
DEV\DevelopersLook for linkable OU's
powershell Get-DomainOU | Get-DomainObjectAcl -ResolveGUIDs | ? { $_.ObjectAceType -eq "GP-Link" -and $_.ActiveDirectoryRights -match "WriteProperty" } | select ObjectDN,ActiveDirectoryRights,ObjectAceType,SecurityIdentifier | fl
ObjectDN : OU=Workstations,DC=dev,DC=cyberbotic,DC=ioThis shows that members of the "Developers" group can link GPOs to the "Workstations" OU.
Check if required module present on machine
powershell Get-Module -List -Name GroupPolicy | select -expand ExportedCommands
Backup-GPO Backup-GPO
Block-GPInheritance Block-GPInheritance
Copy-GPO Copy-GPO
Get-GPInheritance Get-GPInheritance
Get-GPO Get-GPONecessary module not present? Use SharpGPO instead -> SharpGPO/SharpGPOAbuse
Create and link a new GPO
Some abuses can be implemented directly using RSAT. For example, the Set-GPPrefRegistryValue cmdlet can be used to add an HKLM autorun key to the registry.
Next, apply the GPO to the target OU
Last updated