Skip to content

Commit 0fc09fa

Browse files
committed
Filter only unconstrained delegation on DCs
1 parent 496b002 commit 0fc09fa

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

nxc/protocols/ldap.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1148,7 +1148,8 @@ def printTable(items, header):
11481148
userAccountControl = int(item["userAccountControl"])
11491149
objectType = item.get("objectCategory")
11501150

1151-
if userAccountControl & UF_TRUSTED_FOR_DELEGATION:
1151+
# Filter out DCs, unconstrained delegation to DCs is not a useful information
1152+
if userAccountControl & UF_TRUSTED_FOR_DELEGATION and not userAccountControl & SERVER_TRUST_ACCOUNT:
11521153
delegation = "Unconstrained"
11531154
rightsTo.append("N/A")
11541155
elif userAccountControl & UF_TRUSTED_TO_AUTHENTICATE_FOR_DELEGATION:
@@ -1188,9 +1189,7 @@ def printTable(items, header):
11881189
if int(userAccountControl) & UF_ACCOUNTDISABLE:
11891190
self.logger.debug(f"Bypassing disabled account {sAMAccountName}")
11901191
else:
1191-
# Check if the entry is invalid, i.e., for "Unconstrained N/A"
1192-
if not (delegation == "Unconstrained" and rightsTo == ["N/A"]):
1193-
answers.append([sAMAccountName, objectType, delegation, rightsTo])
1192+
answers.append([sAMAccountName, objectType, delegation, rightsTo])
11941193

11951194
except Exception as e:
11961195
self.logger.error(f"Skipping item, cannot process due to error {e}")

0 commit comments

Comments
 (0)