From 8ecdcebf4debf4e17b960e7e3e44e4a31585cdf7 Mon Sep 17 00:00:00 2001 From: Marshall Hallenbeck Date: Sat, 21 Oct 2023 19:24:31 -0400 Subject: [PATCH] fix redundant lines --- nxc/protocols/ldap.py | 9 --------- 1 file changed, 9 deletions(-) diff --git a/nxc/protocols/ldap.py b/nxc/protocols/ldap.py index 6c5faac9..c030527a 100644 --- a/nxc/protocols/ldap.py +++ b/nxc/protocols/ldap.py @@ -303,8 +303,6 @@ class ldap(connection): self.logger.extra["port"] = "445" if not self.no_ntlm else "389" 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"]) 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"]) - 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"]) - 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"]) self.logger.display(f"{self.server_os}{f' x{self.os_arch}' if self.os_arch else ''} (name:{self.hostname}) (domain:{self.domain}) ({signing}) ({smbv1})") self.logger.extra["protocol"] = "LDAP" return True @@ -341,7 +339,6 @@ class ldap(connection): self.nthash = nthash if self.password == "" and self.args.asreproast: - hash_tgt = KerberosAttacks(self).get_tgt_asroast(self.username) hash_tgt = KerberosAttacks(self).get_tgt_asroast(self.username) if hash_tgt: self.logger.highlight(f"{hash_tgt}") @@ -467,7 +464,6 @@ class ldap(connection): self.domain = domain if self.password == "" and self.args.asreproast: - hash_tgt = KerberosAttacks(self).get_tgt_asroast(self.username) hash_tgt = KerberosAttacks(self).get_tgt_asroast(self.username) if hash_tgt: self.logger.highlight(f"{hash_tgt}") @@ -559,7 +555,6 @@ class ldap(connection): self.domain = domain if self.hash == "" and self.args.asreproast: - hash_tgt = KerberosAttacks(self).get_tgt_asroast(self.username) hash_tgt = KerberosAttacks(self).get_tgt_asroast(self.username) if hash_tgt: self.logger.highlight(f"{hash_tgt}") @@ -628,14 +623,12 @@ class ldap(connection): return False def create_smbv1_conn(self): - self.logger.debug("Creating smbv1 connection object") self.logger.debug("Creating smbv1 connection object") try: self.conn = SMBConnection(self.host, self.host, None, 445, preferredDialect=SMB_DIALECT) self.smbv1 = True if self.conn: self.logger.debug("SMBv1 Connection successful") - self.logger.debug("SMBv1 Connection successful") except OSError as e: if str(e).find("Connection reset by peer") != -1: self.logger.debug(f"SMBv1 might be disabled on {self.host}") @@ -646,14 +639,12 @@ class ldap(connection): return True def create_smbv3_conn(self): - self.logger.debug("Creating smbv3 connection object") self.logger.debug("Creating smbv3 connection object") try: self.conn = SMBConnection(self.host, self.host, None, 445) self.smbv1 = False if self.conn: self.logger.debug("SMBv3 Connection successful") - self.logger.debug("SMBv3 Connection successful") except OSError: return False except Exception as e: