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)
|
smb.kerberosLogin(user, passwd, domain, lmhash, nthash, settings.args.aesKey)
|
||||||
else:
|
else:
|
||||||
smb.login(user, passwd, domain, lmhash, nthash)
|
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.user = user
|
||||||
settings.args.passwd = passwd
|
settings.args.passwd = passwd
|
||||||
settings.args.hash = ':'.join(lmhash, nthash)
|
settings.args.hash = ':'.join(lmhash, nthash)
|
||||||
return smb
|
return smb
|
||||||
except SessionError as e:
|
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
|
continue
|
||||||
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
@ -113,12 +113,12 @@ def smart_login(host, smb, domain):
|
||||||
smb.kerberosLogin(user, '', domain, lmhash, nthash, settings.args.aesKey)
|
smb.kerberosLogin(user, '', domain, lmhash, nthash, settings.args.aesKey)
|
||||||
else:
|
else:
|
||||||
smb.login(user, '', domain, lmhash, nthash)
|
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.user = user
|
||||||
settings.args.hash = ntlm_hash
|
settings.args.hash = ntlm_hash
|
||||||
return smb
|
return smb
|
||||||
except SessionError as e:
|
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
|
continue
|
||||||
|
|
||||||
if passwords:
|
if passwords:
|
||||||
|
@ -132,12 +132,12 @@ def smart_login(host, smb, domain):
|
||||||
smb.kerberosLogin(user, passwd, domain, '', '', settings.args.aesKey)
|
smb.kerberosLogin(user, passwd, domain, '', '', settings.args.aesKey)
|
||||||
else:
|
else:
|
||||||
smb.login(user, passwd, domain)
|
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.user = user
|
||||||
settings.args.passwd = passwd
|
settings.args.passwd = passwd
|
||||||
return smb
|
return smb
|
||||||
except SessionError as e:
|
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
|
continue
|
||||||
|
|
||||||
raise socket.error #So we fail without a peep
|
raise socket.error #So we fail without a peep
|
Loading…
Reference in New Issue