Skip to content

Commit b1faef4

Browse files
authored
Merge pull request Pennyw0rth#836 from Pennyw0rth/neff-add-null-auth
Add null-auth info to host banner
2 parents 4137704 + 49e8016 commit b1faef4

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

nxc/protocols/smb.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,8 @@ def __init__(self, args, db, host):
122122
self.signing = False
123123
self.smb_share_name = smb_share_name
124124
self.pvkbytes = None
125-
self.no_da = None
126125
self.no_ntlm = False
126+
self.null_auth = False
127127
self.protocol = "SMB"
128128
self.is_guest = None
129129
self.isdc = False
@@ -172,9 +172,11 @@ def enum_host_info(self):
172172

173173
try:
174174
self.conn.login("", "")
175+
self.null_auth = True
175176
except BrokenPipeError:
176177
self.logger.fail("Broken Pipe Error while attempting to login")
177178
except Exception as e:
179+
self.null_auth = False
178180
if "STATUS_NOT_SUPPORTED" in str(e):
179181
# no ntlm supported
180182
self.no_ntlm = True
@@ -288,8 +290,9 @@ def enum_host_info(self):
288290
def print_host_info(self):
289291
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"])
290292
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"])
291-
ntlm = colored(f"(NTLM:{not self.no_ntlm})", host_info_colors[2], attrs=["bold"]) if self.no_ntlm else ""
292-
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}")
293+
ntlm = colored(f" (NTLM:{not self.no_ntlm})", host_info_colors[2], attrs=["bold"]) if self.no_ntlm else ""
294+
null_auth = colored(f" (Null Auth:{self.null_auth})", host_info_colors[2], attrs=["bold"]) if self.null_auth else ""
295+
self.logger.display(f"{self.server_os}{f' x{self.os_arch}' if self.os_arch else ''} (name:{self.hostname}) (domin:{self.targetDomain}) ({signing}) ({smbv1}){ntlm}{null_auth}")
293296

294297
if self.args.generate_hosts_file or self.args.generate_krb5_file:
295298
if self.args.generate_hosts_file:

0 commit comments

Comments
 (0)