Land #8412, fix for smb_login errors

Merge branch 'land-8412' into upstream-master
bug/bundler_fix 4.14.19
bwatters-r7 2017-05-18 13:43:10 -05:00
commit 02211db664
No known key found for this signature in database
GPG Key ID: ECC0F0A52E65F268
2 changed files with 15 additions and 13 deletions

View File

@ -343,7 +343,7 @@ GEM
rspec-mocks (~> 3.6.0)
rspec-support (~> 3.6.0)
rspec-support (3.6.0)
ruby_smb (0.0.12)
ruby_smb (0.0.14)
bindata
rubyntlm
windows_error

View File

@ -100,6 +100,7 @@ module Metasploit
client = RubySMB::Client.new(self.dispatcher, username: username, password: password, domain: realm)
status_code = client.login
if status_code == WindowsError::NTStatus::STATUS_SUCCESS
# Windows SMB will return an error code during Session
# Setup, but nix Samba requires a Tree Connect. Try admin$
# first, since that will tell us if this user has local
@ -114,6 +115,7 @@ module Metasploit
rescue Exception => e
client.tree_connect("\\\\#{host}\\IPC$")
end
end
case status_code.name
when *StatusCodes::CORRECT_CREDENTIAL_STATUS_CODES