Skip to content

Commit 5456154

Browse files
committed
Fix trust bits
1 parent 1904ee4 commit 5456154

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

nxc/protocols/ldap.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -792,16 +792,14 @@ def resolve_and_display_hostname(name, domain_name=None):
792792
self.logger.fail(f"{prefix}{name} = DNS server did not respond")
793793
except Exception as e:
794794
self.logger.fail(f"{prefix}{name} encountered an unexpected error: {e}")
795-
else:
796-
self.logger.fail(f"{prefix} dNSHostName value is empty, unable to process.")
797795
except Exception as e:
798796
self.logger.fail(f"Skipping item(dNSHostName) {prefix}{name}, error: {e}")
799797

800798
# Find all domain controllers in the current domain
801799
self.logger.info("Enumerating Domain Controllers in current domain...")
802800
search_filter = "(&(objectCategory=computer)(primaryGroupId=516))"
803801
attributes = ["dNSHostName"]
804-
resp = self.search(search_filter, attributes, 0)
802+
resp = self.search(search_filter, attributes)
805803
resp_parse = parse_result_attributes(resp)
806804
for item in resp_parse:
807805
if "dNSHostName" in item: # Get dNSHostName attribute
@@ -824,6 +822,7 @@ def resolve_and_display_hostname(name, domain_name=None):
824822
trust_type = int(trust["trustType"])
825823
trust_attributes = trust["trustAttributes"]
826824

825+
# See: https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-adts/e9a2d23c-c31e-4a6f-88a0-6646fdb51a3c
827826
trust_attribute_flags = {
828827
0x1: "Non-Transitive",
829828
0x2: "Uplevel-Only",
@@ -833,7 +832,8 @@ def resolve_and_display_hostname(name, domain_name=None):
833832
0x20: "Within Forest",
834833
0x40: "Treat as External",
835834
0x80: "Uses RC4 Encryption",
836-
0x100: "Cross Organization No TGT Delegation",
835+
0x200: "Cross Organization No TGT Delegation",
836+
0x800: "Cross Organization Enable TGT Delegation",
837837
0x2000: "PAM Trust"
838838
}
839839

@@ -855,7 +855,7 @@ def resolve_and_display_hostname(name, domain_name=None):
855855
1: "Windows NT",
856856
2: "Active Directory",
857857
3: "Kerberos",
858-
4: "DCE",
858+
4: "Unknown",
859859
5: "Azure Active Directory",
860860
}[trust_type]
861861

0 commit comments

Comments
 (0)