Skip to content

Commit fddc0c4

Browse files
authored
Update isdc initialization and checks
Change isdc initialization from False to None and update related checks. Signed-off-by: mpgn <5891788+mpgn@users.noreply.github.com>
1 parent f51459d commit fddc0c4

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

nxc/protocols/smb.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ def __init__(self, args, db, host):
128128
self.null_auth = False
129129
self.protocol = "SMB"
130130
self.is_guest = None
131-
self.isdc = False
131+
self.isdc = None
132132

133133
connection.__init__(self, args, db, host)
134134

@@ -299,8 +299,7 @@ def print_host_info(self):
299299
self.logger.display(f"{self.server_os}{f' x{self.os_arch}' if self.os_arch else ''} (name:{self.hostname}) (domain:{self.targetDomain}) ({signing}) ({smbv1}){ntlm}{null_auth}{guest}")
300300

301301
if self.args.generate_hosts_file or self.args.generate_krb5_file:
302-
# don't call is_host_dc if no ntlm since already call in the enum
303-
if not self.no_ntlm:
302+
if self.isdc == None:
304303
self.is_host_dc()
305304
if self.args.generate_hosts_file:
306305
with open(self.args.generate_hosts_file, "a+") as host_file:
@@ -758,6 +757,8 @@ def is_host_dc(self):
758757
self.logger.debug("Host appears to be a DC (multiple DC ports open)")
759758
self.isdc = True
760759
return True
760+
self.isdc = False
761+
return False
761762

762763
def _is_port_open(self, port, timeout=1):
763764
"""Check if a specific port is open on the target host."""

0 commit comments

Comments
 (0)