Catch exception if domain controller not found --kdcHost

main
mpgn 2021-01-21 03:54:26 -05:00
parent af2dc05b7e
commit 908d074815
1 changed files with 13 additions and 0 deletions

View File

@ -218,6 +218,13 @@ class ldap(connection):
self.password)) self.password))
return False return False
except OSError as e:
self.logger.error(u'{}\{}:{} {}'.format(self.domain,
self.username,
self.password,
"Error connecting to the domain, please add option --kdcHost with the IP of the domain controller"))
return False
def hash_login(self, domain, username, ntlm_hash): def hash_login(self, domain, username, ntlm_hash):
lmhash = '' lmhash = ''
@ -283,6 +290,12 @@ class ldap(connection):
self.username, self.username,
self.nthash)) self.nthash))
return False return False
except OSError as e:
self.logger.error(u'{}\{}:{} {}'.format(self.domain,
self.username,
self.nthash,
"Error connecting to the domain, please add option --kdcHost with the IP of the domain controller"))
return False
def create_smbv1_conn(self): def create_smbv1_conn(self):
try: try: