Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
wpscanteam
GitHub Repository: wpscanteam/wpscan
Path: blob/master/app/controllers/wp_version.rb
485 views
1
# frozen_string_literal: true
2
3
module WPScan
4
module Controller
5
# Wp Version Controller
6
class WpVersion < CMSScanner::Controller::Base
7
def cli_options
8
[
9
OptBoolean.new(['--wp-version-all', 'Check all the version locations'], advanced: true),
10
OptChoice.new(
11
['--wp-version-detection MODE',
12
'Use the supplied mode for the WordPress version detection, ' \
13
'instead of the global (--detection-mode) mode.'],
14
choices: %w[mixed passive aggressive], normalize: :to_sym, advanced: true
15
)
16
]
17
end
18
19
def before_scan
20
DB::DynamicFinders::Wordpress.create_versions_finders
21
end
22
23
def run
24
output(
25
'version',
26
version: target.wp_version(
27
mode: ParsedCli.wp_version_detection || ParsedCli.detection_mode,
28
confidence_threshold: ParsedCli.wp_version_all ? 0 : 100,
29
show_progression: user_interaction?
30
)
31
)
32
end
33
end
34
end
35
end
36
37