Changes to mssql_clr_payload error handling based on code review
parent
44fb059cea
commit
ba880d1a85
|
@ -98,6 +98,9 @@ class MetasploitModule < Msf::Exploit::Remote
|
||||||
def set_trustworthy(on)
|
def set_trustworthy(on)
|
||||||
result = mssql_query("ALTER DATABASE [#{datastore['DATABASE']}] SET TRUSTWORTHY #{on ? 'ON' : 'OFF'}", false)
|
result = mssql_query("ALTER DATABASE [#{datastore['DATABASE']}] SET TRUSTWORTHY #{on ? 'ON' : 'OFF'}", false)
|
||||||
unless result[:errors].empty?
|
unless result[:errors].empty?
|
||||||
|
result[:errors].each do |err|
|
||||||
|
vprint_error(err)
|
||||||
|
end
|
||||||
fail_with(Failure::Unknown, "Failed to change Trustworthy setting")
|
fail_with(Failure::Unknown, "Failed to change Trustworthy setting")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -117,6 +120,9 @@ RECONFIGURE;
|
||||||
^
|
^
|
||||||
result = mssql_query(query, false)
|
result = mssql_query(query, false)
|
||||||
unless result[:errors].empty?
|
unless result[:errors].empty?
|
||||||
|
result[:errors].each do |err|
|
||||||
|
vprint_error(err)
|
||||||
|
end
|
||||||
fail_with(Failure::Unknown, "Failed to change CLR setting")
|
fail_with(Failure::Unknown, "Failed to change CLR setting")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue