Skip to content

Instantly share code, notes, and snippets.

@HarmJ0y
Last active October 27, 2020 11:03
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save HarmJ0y/d2eb8e3aa2db4de0bd365cedcef5a406 to your computer and use it in GitHub Desktop.
Save HarmJ0y/d2eb8e3aa2db4de0bd365cedcef5a406 to your computer and use it in GitHub Desktop.
PowerView GPO ACL Enumeration
Get-DomainObjectAcl -Domain 'dev.testlab.local' -LDAPFilter '(objectCategory=groupPolicyContainer)' -ResolveGUIDs | ? {
($_.SecurityIdentifier -match '^S-1-5-.*-[1-9]\d{3,}$') -and `
($_.ActiveDirectoryRights -match 'WriteProperty|GenericAll|GenericWrite|WriteDacl|WriteOwner')
} | % {
$PrincipalDN = Convert-ADName $_.SecurityIdentifier -OutputType DN
New-Object PSObject -Property @{'ObjectDN'=$_.ObjectDN ; 'PrincipalSID'=$_.SecurityIdentifier; 'PrincipalDN'=$PrincipalDN }
} | fl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment