Merge pull request #150 from Pennyw0rth/neff-enum_trusts

Remove domain DN from ldap query, fixes #144
main
Alex 2023-12-23 15:48:53 +01:00 committed by GitHub
commit 5e964bb0eb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 2 deletions

View File

@ -17,12 +17,11 @@ class NXCModule:
pass pass
def on_login(self, context, connection): def on_login(self, context, connection):
domain_dn = ",".join(["DC=" + dc for dc in connection.domain.split(".")])
search_filter = "(&(objectClass=trustedDomain))" search_filter = "(&(objectClass=trustedDomain))"
attributes = ["flatName", "trustPartner", "trustDirection", "trustAttributes"] attributes = ["flatName", "trustPartner", "trustDirection", "trustAttributes"]
context.log.debug(f"Search Filter={search_filter}") context.log.debug(f"Search Filter={search_filter}")
resp = connection.ldapConnection.search(searchBase=domain_dn, searchFilter=search_filter, attributes=attributes, sizeLimit=0) resp = connection.ldapConnection.search(searchFilter=search_filter, attributes=attributes, sizeLimit=0)
trusts = [] trusts = []
context.log.debug(f"Total of records returned {len(resp)}") context.log.debug(f"Total of records returned {len(resp)}")