Fix #54 False positive when a plugin directory redirects to the homepage

This commit is contained in:
erwanlr
2012-12-21 12:21:40 +01:00
parent c0a05a4119
commit 9b14a8d038
5 changed files with 85 additions and 43 deletions

View File

@@ -18,8 +18,6 @@
module WebSite
#@error_404_hash = nil
# Checks if the remote website is up.
def online?
Browser.instance.get(@uri.to_s).code != 0

View File

@@ -57,11 +57,12 @@ class WpEnumerator
request_count += 1
request.on_complete do |response|
page_hash = Digest::MD5.hexdigest(response.body)
print "\rChecking for #{enumerate_size} total #{options[:type]}... #{(request_count * 100) / enumerate_size}% complete." if options[:show_progress_bar]
if WpTarget.valid_response_codes.include?(response.code)
if Digest::MD5.hexdigest(response.body) != options[:error_404_hash]
if page_hash != options[:error_404_hash] and page_hash != options[:homepage_hash]
if options[:exclude_content_based]
unless response.body[exclude_regexp]
found << target