Class: WPScan::Controller::WpVersion

Inherits:
CMSScanner::Controller::Base
  • Object
show all
Defined in:
app/controllers/wp_version.rb

Overview

Wp Version Controller

Instance Method Summary collapse

Instance Method Details

#cli_optionsObject



5
6
7
8
9
10
11
12
13
14
15
16
# File 'app/controllers/wp_version.rb', line 5

def cli_options
  [
    OptBoolean.new(['--wp-version-all', 'Check all the version locations']),
    OptChoice.new(
      ['--wp-version-detection MODE',
       'Use the supplied mode for the WordPress version detection, ' \
       'instead of the global (--detection-mode) mode.'],
      choices: %w[mixed passive aggressive],
      normalize: :to_sym
    )
  ]
end

#runObject



18
19
20
21
22
23
24
25
26
27
# File 'app/controllers/wp_version.rb', line 18

def run
  output(
    'version',
    version: target.wp_version(
      mode: parsed_options[:wp_version_detection] || parsed_options[:detection_mode],
      confidence_threshold: parsed_options[:wp_version_all] ? 0 : 100,
      show_progression: user_interaction?
    )
  )
end