Skip to content

Instantly share code, notes, and snippets.

@crypt0rr
Last active November 22, 2021 12:14
Show Gist options
  • Save crypt0rr/29ed56a74c73f95f2ba0b99f1b675c1c to your computer and use it in GitHub Desktop.
Save crypt0rr/29ed56a74c73f95f2ba0b99f1b675c1c to your computer and use it in GitHub Desktop.
LDAPDomainDump High-Priv filter
#!/bin/bash
GROUPLIST=("Domain Admins" "Enterprise Admins" "Administrators" "Schema Admins" "Backup Operators" "Account Operators" "DNS Admins")
for GROUP in ${!GROUPLIST[*]}
do
printf "%s\n" "${GROUPLIST[$GROUP]} contains:"
grep -w "${GROUPLIST[$GROUP]}" domain_users.grep | grep -v ACCOUNT_DISABLED | awk -F ';' '{print $3}' | sort && echo ""
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment