-
-
Save HarmJ0y/d2eb8e3aa2db4de0bd365cedcef5a406 to your computer and use it in GitHub Desktop.
PowerView GPO ACL Enumeration
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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