Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
wpscanteam
GitHub Repository: wpscanteam/wpscan
Path: blob/master/app/finders/plugins/config_parser.rb
485 views
1
# frozen_string_literal: true
2
3
module WPScan
4
module Finders
5
module Plugins
6
# Plugins finder from Dynamic Finder 'ConfigParser'
7
class ConfigParser < Finders::DynamicFinder::WpItems::Finder
8
DEFAULT_CONFIDENCE = 40
9
10
# @param [ Hash ] opts The options from the #passive, #aggressive methods
11
# @param [ Typhoeus::Response ] response
12
# @param [ String ] slug
13
# @param [ String ] klass
14
# @param [ Hash ] config The related dynamic finder config hash
15
#
16
# @return [ Plugin ] The detected plugin in the response, related to the config
17
def _process_response(_opts, _response, slug, klass, config)
18
#
19
# TODO. Currently not implemented, and not even loaded by the Finders, as this
20
# finder only has an aggressive method, which has been disabled (globally)
21
# when checking for plugins
22
#
23
24
Model::Plugin.new(
25
slug,
26
target,
27
opts.merge(found_by: found_by(klass), confidence: config['confidence'] || DEFAULT_CONFIDENCE)
28
)
29
end
30
end
31
end
32
end
33
end
34
35