Created
April 9, 2022 08:52
-
-
Save tanaka-geek/6e1b00fd8a7e4ef89f15592f31399388 to your computer and use it in GitHub Desktop.
ldap 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
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