Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
wpscanteam
GitHub Repository: wpscanteam/wpscan
Path: blob/master/app/controllers/custom_directories.rb
485 views
1
# frozen_string_literal: true
2
3
module WPScan
4
module Controller
5
# Controller to ensure that the wp-content and wp-plugins
6
# directories are found
7
class CustomDirectories < CMSScanner::Controller::Base
8
def cli_options
9
[
10
OptString.new(['--wp-content-dir DIR',
11
'The wp-content directory if custom or not detected, such as "wp-content"']),
12
OptString.new(['--wp-plugins-dir DIR',
13
'The plugins directory if custom or not detected, such as "wp-content/plugins"'])
14
]
15
end
16
17
def before_scan
18
target.content_dir = ParsedCli.wp_content_dir if ParsedCli.wp_content_dir
19
target.plugins_dir = ParsedCli.wp_plugins_dir if ParsedCli.wp_plugins_dir
20
21
raise Error::WpContentDirNotDetected unless target.content_dir
22
end
23
end
24
end
25
end
26
27