Remove useless code
This commit is contained in:
@@ -5,7 +5,7 @@ class WpItems < Array
|
|||||||
|
|
||||||
attr_reader :vulns_file, :item_xpath
|
attr_reader :vulns_file, :item_xpath
|
||||||
|
|
||||||
# @param [ Wptarget ] wp_target
|
# @param [ WpTarget ] wp_target
|
||||||
# @param [ Hash ] options
|
# @param [ Hash ] options
|
||||||
# @option options [ Boolean ] :show_progression Whether or not output the progress bar
|
# @option options [ Boolean ] :show_progression Whether or not output the progress bar
|
||||||
# @option options [ Boolean ] :only_vulnerable Only check for vulnerable items
|
# @option options [ Boolean ] :only_vulnerable Only check for vulnerable items
|
||||||
@@ -13,7 +13,6 @@ class WpItems < Array
|
|||||||
#
|
#
|
||||||
# @return [ WpItems ]
|
# @return [ WpItems ]
|
||||||
def aggressive_detection(wp_target, options = {})
|
def aggressive_detection(wp_target, options = {})
|
||||||
queue_count = 0
|
|
||||||
browser = Browser.instance
|
browser = Browser.instance
|
||||||
hydra = browser.hydra
|
hydra = browser.hydra
|
||||||
targets = targets_items(wp_target, options)
|
targets = targets_items(wp_target, options)
|
||||||
@@ -42,12 +41,6 @@ class WpItems < Array
|
|||||||
end
|
end
|
||||||
|
|
||||||
hydra.queue(request)
|
hydra.queue(request)
|
||||||
queue_count += 1
|
|
||||||
|
|
||||||
if queue_count == browser.max_threads
|
|
||||||
hydra.run
|
|
||||||
queue_count = 0
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
hydra.run
|
hydra.run
|
||||||
|
|||||||
@@ -29,10 +29,7 @@ class WpItem
|
|||||||
#
|
#
|
||||||
# @return [ Boolean ]
|
# @return [ Boolean ]
|
||||||
def exists_from_response?(response, options = {})
|
def exists_from_response?(response, options = {})
|
||||||
# FIXME : The response is supposed to follow locations, so we should not have 301 or 302.
|
if [200, 401, 403].include?(response.code)
|
||||||
# However, due to an issue with Typhoeus or Webmock, the location is not followed in specs
|
|
||||||
# See https://github.com/typhoeus/typhoeus/issues/279
|
|
||||||
if [200, 301, 302, 401, 403].include?(response.code)
|
|
||||||
if response.has_valid_hash?(options[:error_404_hash], options[:homepage_hash])
|
if response.has_valid_hash?(options[:error_404_hash], options[:homepage_hash])
|
||||||
if options[:exclude_content]
|
if options[:exclude_content]
|
||||||
unless response.body.match(options[:exclude_content])
|
unless response.body.match(options[:exclude_content])
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ shared_examples 'WpItem::Existable' do
|
|||||||
end
|
end
|
||||||
|
|
||||||
context 'w/o exclude_content' do
|
context 'w/o exclude_content' do
|
||||||
[200, 301, 302, 401, 403].each do |code|
|
[200, 401, 403].each do |code|
|
||||||
it "returns true on #{code}" do
|
it "returns true on #{code}" do
|
||||||
@resp_opt = { code: code, body: '' }
|
@resp_opt = { code: code, body: '' }
|
||||||
@expected = true
|
@expected = true
|
||||||
|
|||||||
Reference in New Issue
Block a user