From eb10741912a7a9943bd294340302e4b1aab0fdfe Mon Sep 17 00:00:00 2001 From: Erwan Date: Sun, 2 Sep 2012 14:01:12 +0200 Subject: [PATCH] Fix #10 Improvement is also applied to the error_log check --- lib/wpscan/wp_plugin.rb | 3 ++- lib/wpscan/wp_target.rb | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/wpscan/wp_plugin.rb b/lib/wpscan/wp_plugin.rb index 70e80400..86b43e0b 100644 --- a/lib/wpscan/wp_plugin.rb +++ b/lib/wpscan/wp_plugin.rb @@ -59,7 +59,8 @@ class WpPlugin < Vulnerable # however can also be found in their specific plugin dir. # http://www.exploit-db.com/ghdb/3714/ def error_log? - Browser.instance.get(error_log_url()).body[%r{PHP Fatal error}i] ? true : false + response_body = Browser.instance.get(error_log_url(), :headers => { "range" => "bytes=0-700"}).body + response_body[%r{PHP Fatal error}i] ? true : false end def error_log_url diff --git a/lib/wpscan/wp_target.rb b/lib/wpscan/wp_target.rb index d130831e..cfed24be 100644 --- a/lib/wpscan/wp_target.rb +++ b/lib/wpscan/wp_target.rb @@ -101,7 +101,9 @@ class WpTarget end def has_debug_log? - Browser.instance.get(debug_log_url()).body[%r{\[[^\]]+\] PHP (?:Warning|Error|Notice):}] ? true : false + # We only get the first 700 bytes of the file to avoid loading huge file (like 2Go) + response_body = Browser.instance.get(debug_log_url(), :headers => { "range" => "bytes=0-700"}).body + response_body[%r{\[[^\]]+\] PHP (?:Warning|Error|Notice):}] ? true : false end def debug_log_url