|
37 | 37 | from impacket.smb3structs import FILE_SHARE_WRITE, FILE_SHARE_DELETE, SMB2_0_IOCTL_IS_FSCTL |
38 | 38 | from impacket.dcerpc.v5 import tsts as TSTS |
39 | 39 |
|
40 | | -from nxc.config import process_secret, host_info_colors |
| 40 | +from nxc.config import process_secret, host_info_colors, check_guest_account |
41 | 41 | from nxc.connection import connection, sem, requires_admin, dcom_FirewallChecker |
42 | 42 | from nxc.helpers.misc import gen_random_string, validate_ntlm |
43 | 43 | from nxc.logger import NXCAdapter |
@@ -185,6 +185,14 @@ def enum_host_info(self): |
185 | 185 | self.no_ntlm = True |
186 | 186 | self.logger.debug("NTLM not supported") |
187 | 187 |
|
| 188 | + if check_guest_account and not self.no_ntlm: |
| 189 | + try: |
| 190 | + self.conn.login("Guest", "") |
| 191 | + self.logger.debug("Guest authentication successful") |
| 192 | + self.is_guest = True |
| 193 | + except Exception: |
| 194 | + self.is_guest = False |
| 195 | + |
188 | 196 | # self.domain is the attribute we authenticate with |
189 | 197 | # self.targetDomain is the attribute which gets displayed as host domain |
190 | 198 | if not self.no_ntlm: |
@@ -295,7 +303,8 @@ def print_host_info(self): |
295 | 303 | 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"]) |
296 | 304 | ntlm = colored(f" (NTLM:{not self.no_ntlm})", host_info_colors[2], attrs=["bold"]) if self.no_ntlm else "" |
297 | 305 | null_auth = colored(f" (Null Auth:{self.null_auth})", host_info_colors[2], attrs=["bold"]) if self.null_auth else "" |
298 | | - 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}") |
| 306 | + guest = colored(f" (Guest Auth:{self.is_guest})", host_info_colors[1], attrs=["bold"]) if self.is_guest else "" |
| 307 | + 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}") |
299 | 308 |
|
300 | 309 | if self.args.generate_hosts_file or self.args.generate_krb5_file: |
301 | 310 | if self.args.generate_hosts_file: |
|
0 commit comments