Merge pull request #77 from Slowerzs/main

Fix LDAP search for domains with numerous computers
This commit is contained in:
Login Securite 2024-10-18 14:25:52 +02:00 committed by GitHub
commit 61bc351263
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 1 deletions

View File

@ -141,10 +141,13 @@ def fetch_all_computers(options):
options.lmhash, options.lmhash,
options.nthash, options.nthash,
) )
paged_search_control = ldapasn1.SimplePagedResultsControl(criticality=True, size=1000)
results = ldap_connection.search( results = ldap_connection.search(
searchFilter=ldap_filter, searchFilter=ldap_filter,
attributes=attributes, attributes=attributes,
sizeLimit=0, searchControls=[paged_search_control],
) )
except Exception as e: except Exception as e:
donpapi_logger.error(f"Exception while requesting targets: {e}") donpapi_logger.error(f"Exception while requesting targets: {e}")