Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
wpscanteam
GitHub Repository: wpscanteam/wpscan
Path: blob/master/app/finders/main_theme/urls_in_homepage.rb
485 views
1
# frozen_string_literal: true
2
3
module WPScan
4
module Finders
5
module MainTheme
6
# URLs In Homepage Finder
7
class UrlsInHomepage < CMSScanner::Finders::Finder
8
include WpItems::UrlsInPage
9
10
# @param [ Hash ] opts
11
#
12
# @return [ Array<Theme> ]
13
def passive(opts = {})
14
found = []
15
16
slugs = items_from_links('themes', uniq: false) + items_from_codes('themes', uniq: false)
17
18
slugs.each_with_object(Hash.new(0)) { |slug, counts| counts[slug] += 1 }.each do |slug, occurences|
19
found << Model::Theme.new(slug, target, opts.merge(found_by: found_by, confidence: 2 * occurences))
20
end
21
22
found
23
end
24
25
# @return [ Typhoeus::Response ]
26
def page_res
27
@page_res ||= target.homepage_res
28
end
29
end
30
end
31
end
32
end
33
34