fixes issue #43

main
byt3bl33d3r 2015-11-11 09:26:01 -07:00
parent 9ebc95519a
commit 4690ca29b9
1 changed files with 6 additions and 6 deletions

View File

@ -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