Path: blob/master/app/controllers/custom_directories.rb
485 views
# frozen_string_literal: true12module WPScan3module Controller4# Controller to ensure that the wp-content and wp-plugins5# directories are found6class CustomDirectories < CMSScanner::Controller::Base7def cli_options8[9OptString.new(['--wp-content-dir DIR',10'The wp-content directory if custom or not detected, such as "wp-content"']),11OptString.new(['--wp-plugins-dir DIR',12'The plugins directory if custom or not detected, such as "wp-content/plugins"'])13]14end1516def before_scan17target.content_dir = ParsedCli.wp_content_dir if ParsedCli.wp_content_dir18target.plugins_dir = ParsedCli.wp_plugins_dir if ParsedCli.wp_plugins_dir1920raise Error::WpContentDirNotDetected unless target.content_dir21end22end23end24end252627