Sha256: 58791a1dda31ea79cb71ec38edaf177af819c587568242bbb23c3cef931268ab

Contents?: true

Size: 899 Bytes

Versions: 10

Compression:

Stored size: 899 Bytes

Contents

# frozen_string_literal: true

module WPScan
  module Controller
    # Controller to ensure that the wp-content and wp-plugins
    # directories are found
    class CustomDirectories < CMSScanner::Controller::Base
      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

      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

        return if target.content_dir(ParsedCli.detection_mode)

        raise Error::WpContentDirNotDetected
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
wpscan-3.7.2 app/controllers/custom_directories.rb
wpscan-3.7.1 app/controllers/custom_directories.rb
wpscan-3.7.0 app/controllers/custom_directories.rb
wpscan-3.6.3 app/controllers/custom_directories.rb
wpscan-3.6.2 app/controllers/custom_directories.rb
wpscan-3.6.1 app/controllers/custom_directories.rb
wpscan-3.6.0 app/controllers/custom_directories.rb
wpscan-3.5.5 app/controllers/custom_directories.rb
wpscan-3.5.4 app/controllers/custom_directories.rb
wpscan-3.5.3 app/controllers/custom_directories.rb