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