Class: WPScan::Controller::CustomDirectories

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

Overview

Controller to ensure that the wp-content and wp-plugins directories are found

Instance Method Summary collapse

Instance Method Details

#before_scanObject



17
18
19
20
21
22
# File 'app/controllers/custom_directories.rb', line 17

def before_scan
  target.content_dir = ParsedCli.wp_content_dir if ParsedCli.wp_content_dir
  target.plugins_dir = ParsedCli.wp_plugins_dir if ParsedCli.wp_plugins_dir

  raise Error::WpContentDirNotDetected unless target.content_dir
end

#cli_optionsObject



8
9
10
11
12
13
14
15
# File 'app/controllers/custom_directories.rb', line 8

def cli_options
  [
    OptString.new(['--wp-content-dir DIR',
                   'The wp-content directory if custom or not detected, such as "wp-content"']),
    OptString.new(['--wp-plugins-dir DIR',
                   'The plugins directory if custom or not detected, such as "wp-content/plugins"'])
  ]
end