-
Notifications
You must be signed in to change notification settings - Fork 391
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #215 from Pennyw0rth/marshall-ldap-users
Update LDAP users lookup to match SMB
- Loading branch information
Showing
4 changed files
with
62 additions
and
37 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
from impacket.ldap import ldapasn1 as ldapasn1_impacket | ||
|
||
def parse_result_attributes(ldap_response): | ||
parsed_response = [] | ||
for entry in ldap_response: | ||
# SearchResultReferences may be returned | ||
if not isinstance(entry, ldapasn1_impacket.SearchResultEntry): | ||
continue | ||
attribute_map = {} | ||
for attribute in entry["attributes"]: | ||
attribute_map[str(attribute["type"])] = str(attribute["vals"][0]) | ||
parsed_response.append(attribute_map) | ||
return parsed_response |
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
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
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