Skip to content

Instantly share code, notes, and snippets.

@tanaka-geek
Created April 9, 2022 08:52
Show Gist options
  • Save tanaka-geek/6e1b00fd8a7e4ef89f15592f31399388 to your computer and use it in GitHub Desktop.
Save tanaka-geek/6e1b00fd8a7e4ef89f15592f31399388 to your computer and use it in GitHub Desktop.
ldap enumeration
import ldap3
ip = '127.0.0.1'
server = ldap3.Server(ip, get_info = ldap3.ALL, port =389, use_ssl = False)
connection = ldap3.Connection(server)
connection.bind()
res = server.info
print(res)
# enum1
# connection.search(search_base='DC=dc1,DC=local', search_filter='(&(objectClass=*))', search_scope='SUBTREE', attributes='*')
# print(connection.entries)
# enum2
#connection.search(search_base='dc1,DC=LOCAL', search_filter='(&(objectClass=person))', search_scope='SUBTREE', attributes='userPassword')
#print(connection.entries)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment