Avoids duplicates in finding the same thing diffrent pages
This commit is contained in:
@@ -34,7 +34,10 @@ module WPScan
|
||||
[target.homepage_res, target.error_404_res].each do |page_res|
|
||||
item = process_response(opts, page_res, slug, klass, config)
|
||||
|
||||
found << item if item.is_a?(Model::WpItem)
|
||||
if item.is_a?(Model::WpItem)
|
||||
found << item
|
||||
break # No need to check the other page if detected in the current
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -68,6 +68,15 @@ shared_examples WPScan::Finders::DynamicFinder::WpItems::Finder do
|
||||
expect(finder.passive).to match_array(expected_items.map { |item| eql(item) })
|
||||
end
|
||||
end
|
||||
|
||||
context 'from both the homepage and 404' do
|
||||
let(:homepage_body) { File.read(passive_fixture) }
|
||||
let(:error_404_body) { File.read(passive_fixture) }
|
||||
|
||||
it 'does not contains the same finding twice (but from different page)' do
|
||||
expect(finder.passive).to match_array(expected_items.map { |item| eql(item) })
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user