Skip to content

Commit 5b14c3f

Browse files
authored
Used parse_result_attributes for parsing RBCD too
Signed-off-by: termanix <50464194+termanix@users.noreply.github.com>
1 parent 29de0cc commit 5b14c3f

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

nxc/protocols/ldap.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1179,12 +1179,11 @@ def printTable(items, header):
11791179
search_filter += "(objectSid=" + ace["Ace"]["Sid"].formatCanonical() + ")"
11801180
search_filter += ")(!(UserAccountControl:1.2.840.113556.1.4.803:=2)))"
11811181
delegUserResp = self.search(search_filter, attributes=["sAMAccountName", "objectCategory"], sizeLimit=999)
1182-
1183-
for item2 in delegUserResp:
1184-
if not isinstance(item2, ldapasn1_impacket.SearchResultEntry):
1185-
continue
1186-
rbcdRights.append(str(item2["attributes"][0]["vals"][0]))
1187-
rbcdObjType.append(str(item2["attributes"][1]["vals"][0]).split("=")[1].split(",")[0])
1182+
delegUserResp_parse = parse_result_attributes(delegUserResp)
1183+
1184+
for rbcd in delegUserResp_parse:
1185+
rbcdRights.append(str(rbcd.get("sAMAccountName")))
1186+
rbcdObjType.append(str(rbcd.get("objectCategory")))
11881187

11891188
if mustCommit:
11901189
if int(userAccountControl) & UF_ACCOUNTDISABLE:

0 commit comments

Comments
 (0)