Merge pull request #13 from bcook-r7/land-6039-mssql_idf
catch more network exceptionsbug/bundler_fix
commit
e64804d136
|
@ -385,12 +385,18 @@ module Exploit::Remote::MSSQL
|
|||
disconnect if self.sock
|
||||
connect
|
||||
|
||||
# Send a prelogin packet and check that encryption is not enabled
|
||||
if mssql_prelogin() != ENCRYPT_NOT_SUP
|
||||
print_error("Encryption is not supported")
|
||||
begin
|
||||
# Send a prelogin packet and check that encryption is not enabled
|
||||
if mssql_prelogin() != ENCRYPT_NOT_SUP
|
||||
print_error("Encryption is not supported")
|
||||
return false
|
||||
end
|
||||
rescue EOFError
|
||||
print_error("Probable server or network failure.")
|
||||
return false
|
||||
end
|
||||
|
||||
|
||||
if datastore['USE_WINDOWS_AUTHENT']
|
||||
|
||||
idx = 0
|
||||
|
@ -623,7 +629,12 @@ module Exploit::Remote::MSSQL
|
|||
# Packet header and total length including header
|
||||
pkt = "\x10\x01" + [pkt.length + 8].pack('n') + [0].pack('n') + [1].pack('C') + "\x00" + pkt
|
||||
|
||||
resp = mssql_send_recv(pkt)
|
||||
begin
|
||||
resp = mssql_send_recv(pkt)
|
||||
rescue EOFError
|
||||
print_error("Probable server or network failure.")
|
||||
return false
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
|
|
@ -94,10 +94,16 @@ class Metasploit3 < Msf::Auxiliary
|
|||
sql += "CLOSE table_cursor "
|
||||
sql += "DEALLOCATE table_cursor "
|
||||
|
||||
if mssql_login_datastore
|
||||
result = mssql_query(sql, false)
|
||||
else
|
||||
print_error('Login failed')
|
||||
begin
|
||||
if mssql_login_datastore
|
||||
result = mssql_query(sql, false)
|
||||
column_data = result[:rows]
|
||||
else
|
||||
print_error('Login failed')
|
||||
return
|
||||
end
|
||||
rescue Rex::ConnectionRefused => e
|
||||
print_error("Connection failed: #{e}")
|
||||
return
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue