fixes issue #43
parent
9ebc95519a
commit
4690ca29b9
|
@ -45,13 +45,13 @@ def smart_login(host, smb, domain):
|
|||
smb.kerberosLogin(user, passwd, domain, lmhash, nthash, settings.args.aesKey)
|
||||
else:
|
||||
smb.login(user, passwd, domain, lmhash, nthash)
|
||||
print_succ("{}:{} Login successful {}\\{}:{}".format(host, settings.args.port, domain, user, passwd))
|
||||
print_succ(u"{}:{} Login successful {}\\{}:{}".format(host, settings.args.port, domain, user, passwd))
|
||||
settings.args.user = user
|
||||
settings.args.passwd = passwd
|
||||
settings.args.hash = ':'.join(lmhash, nthash)
|
||||
return smb
|
||||
except SessionError as e:
|
||||
print_error("{}:{} {}\\{}:{} {}".format(host, settings.args.port, domain, user, passwd, e))
|
||||
print_error(u"{}:{} {}\\{}:{} {}".format(host, settings.args.port, domain, user, passwd, e))
|
||||
continue
|
||||
|
||||
except Exception as e:
|
||||
|
@ -113,12 +113,12 @@ def smart_login(host, smb, domain):
|
|||
smb.kerberosLogin(user, '', domain, lmhash, nthash, settings.args.aesKey)
|
||||
else:
|
||||
smb.login(user, '', domain, lmhash, nthash)
|
||||
print_succ("{}:{} Login successful {}\\{}:{}".format(host, settings.args.port, domain, user, ntlm_hash))
|
||||
print_succ(u"{}:{} Login successful {}\\{}:{}".format(host, settings.args.port, domain, user, ntlm_hash))
|
||||
settings.args.user = user
|
||||
settings.args.hash = ntlm_hash
|
||||
return smb
|
||||
except SessionError as e:
|
||||
print_error("{}:{} {}\\{}:{} {}".format(host, settings.args.port, domain, user, ntlm_hash, e))
|
||||
print_error(u"{}:{} {}\\{}:{} {}".format(host, settings.args.port, domain, user, ntlm_hash, e))
|
||||
continue
|
||||
|
||||
if passwords:
|
||||
|
@ -132,12 +132,12 @@ def smart_login(host, smb, domain):
|
|||
smb.kerberosLogin(user, passwd, domain, '', '', settings.args.aesKey)
|
||||
else:
|
||||
smb.login(user, passwd, domain)
|
||||
print_succ("{}:{} Login successful {}\\{}:{}".format(host, settings.args.port, domain, user, passwd))
|
||||
print_succ(u"{}:{} Login successful {}\\{}:{}".format(host, settings.args.port, domain, user, passwd))
|
||||
settings.args.user = user
|
||||
settings.args.passwd = passwd
|
||||
return smb
|
||||
except SessionError as e:
|
||||
print_error("{}:{} {}\\{}:{} {}".format(host, settings.args.port, domain, user, passwd, e))
|
||||
print_error(u"{}:{} {}\\{}:{} {}".format(host, settings.args.port, domain, user, passwd, e))
|
||||
continue
|
||||
|
||||
raise socket.error #So we fail without a peep
|
Loading…
Reference in New Issue