Skip to content

Commit cafa670

Browse files
committed
Create new connection object if we want to log in
1 parent 425ad8e commit cafa670

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

nxc/protocols/smb.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,10 @@ def enum_host_info(self):
302302
self.kdcHost = result["host"] if result else None
303303
self.logger.info(f"Resolved domain: {self.domain} with dns, kdcHost: {self.kdcHost}")
304304

305+
# If we want to authenticate we should create another connection object, because we already logged in
306+
if self.args.username or self.args.cred_id or self.kerberos:
307+
self.create_conn_obj()
308+
305309
def print_host_info(self):
306310
signing = colored(f"signing:{self.signing}", host_info_colors[0], attrs=["bold"]) if self.signing else colored(f"signing:{self.signing}", host_info_colors[1], attrs=["bold"])
307311
smbv1 = colored(f"SMBv1:{self.smbv1}", host_info_colors[2], attrs=["bold"]) if self.smbv1 else colored(f"SMBv1:{self.smbv1}", host_info_colors[3], attrs=["bold"])

0 commit comments

Comments
 (0)