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

#before_scanObject



19
20
21
# File 'app/controllers/wp_version.rb', line 19

def before_scan
  DB::DynamicFinders::Wordpress.create_versions_finders
end

#cli_optionsObject



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

def cli_options
  [
    OptBoolean.new(['--wp-version-all', 'Check all the version locations'], advanced: true),
    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, advanced: true
    )
  ]
end

#runObject



23
24
25
26
27
28
29
30
31
32
# File 'app/controllers/wp_version.rb', line 23

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