From 49d68e026952be98c77a452a0d31c2d549ffc8e2 Mon Sep 17 00:00:00 2001 From: mpgn Date: Thu, 3 Nov 2022 15:29:56 -0400 Subject: [PATCH] fix error with connection outside dc --- cme/protocols/ldap.py | 1 - cme/protocols/smb.py | 12 ++++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/cme/protocols/ldap.py b/cme/protocols/ldap.py index 0c9efeb3..3e1c52cc 100644 --- a/cme/protocols/ldap.py +++ b/cme/protocols/ldap.py @@ -197,7 +197,6 @@ class ldap(connection): except Exception as e: if "STATUS_NOT_SUPPORTED" in str(e): self.no_ntlm = True - pass if not self.no_ntlm: self.domain = self.conn.getServerDNSDomainName() diff --git a/cme/protocols/smb.py b/cme/protocols/smb.py index 079eb0e7..e8fca0f7 100755 --- a/cme/protocols/smb.py +++ b/cme/protocols/smb.py @@ -253,19 +253,19 @@ class smb(connection): def enum_host_info(self): self.local_ip = self.conn.getSMBServer().get_socket().getsockname()[0] - + no_ntlm = False try: self.conn.login('' , '') - self.domain = self.conn.getServerDNSDomainName() - self.hostname = self.conn.getServerName() - self.server_os = self.conn.getServerOS() except Exception as e: if "STATUS_NOT_SUPPORTED" in str(e): # no ntlm supported - self.domain = self.args.domain - self.hostname = self.host + no_ntlm = True pass + self.domain = self.conn.getServerDNSDomainName() if not no_ntlm else self.args.domain + self.hostname = self.conn.getServerName() if not no_ntlm else self.host + self.server_os = self.conn.getServerOS() + try: self.signing = self.conn.isSigningRequired() if self.smbv1 else self.conn._SMBConnection._Connection['RequireSigning'] except: