Skip to content

Instantly share code, notes, and snippets.

@komodoooo
Last active February 8, 2025 19:44
Show Gist options
  • Save komodoooo/66674ad269771db4681e5e4800d22956 to your computer and use it in GitHub Desktop.
Save komodoooo/66674ad269771db4681e5e4800d22956 to your computer and use it in GitHub Desktop.
Automatically dump misconfigured ldap server
#!/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