Skip to content

Commit 659c225

Browse files
committed
Skip cbt check if port explicitly set to 389
1 parent fde3de7 commit 659c225

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

nxc/protocols/ldap.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,10 @@ def enum_host_info(self):
312312
self.domain = self.targetDomain
313313

314314
self.check_ldap_signing()
315-
self.check_ldaps_cbt()
315+
if getattr(self.args, "port_explicitly_set", False) and self.port == 389:
316+
self.cbt_status = "Unknown"
317+
else:
318+
self.check_ldaps_cbt()
316319

317320
# using kdcHost is buggy on impacket when using trust relation between ad so we kdcHost must stay to none if targetdomain is not equal to domain
318321
if not self.kdcHost and self.domain and self.domain == self.targetDomain:

nxc/protocols/ldap/proto_args.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
from nxc.helpers.args import DisplayDefaultsNotNone
1+
from nxc.helpers.args import DefaultTrackingAction, DisplayDefaultsNotNone
22

33

44
def proto_args(parser, parents):
55
ldap_parser = parser.add_parser("ldap", help="own stuff using LDAP", parents=parents, formatter_class=DisplayDefaultsNotNone)
66
ldap_parser.add_argument("-H", "--hash", metavar="HASH", dest="hash", nargs="+", default=[], help="NTLM hash(es) or file(s) containing NTLM hashes")
7-
ldap_parser.add_argument("--port", type=int, default=389, help="LDAP port")
7+
ldap_parser.add_argument("--port", type=int, default=389, action=DefaultTrackingAction, help="LDAP port")
88

99
dgroup = ldap_parser.add_mutually_exclusive_group()
1010
dgroup.add_argument("-d", metavar="DOMAIN", dest="domain", type=str, default=None, help="domain to authenticate to")

0 commit comments

Comments
 (0)