app/controllers/core.rb in wpscan-3.4.5 vs app/controllers/core.rb in wpscan-3.5.0
- old
+ new
@@ -1,5 +1,7 @@
+# frozen_string_literal: true
+
module WPScan
module Controller
# Specific Core controller to include WordPress checks
class Core < CMSScanner::Controller::Core
# @return [ Array<OptParseValidator::Opt> ]
@@ -23,11 +25,11 @@
end
# @return [ Boolean ]
def update_db_required?
if local_db.missing_files?
- raise MissingDatabaseFile if parsed_options[:update] == false
+ raise Error::MissingDatabaseFile if parsed_options[:update] == false
return true
end
return parsed_options[:update] unless parsed_options[:update].nil?
@@ -60,20 +62,20 @@
end
# Raises errors if the target is hosted on wordpress.com or is not running WordPress
# Also check if the homepage_url is still the install url
def check_wordpress_state
- raise WordPressHostedError if target.wordpress_hosted?
+ raise Error::WordPressHosted if target.wordpress_hosted?
if Addressable::URI.parse(target.homepage_url).path =~ %r{/wp-admin/install.php$}i
output('not_fully_configured', url: target.homepage_url)
exit(WPScan::ExitCode::VULNERABLE)
end
- raise NotWordPressError unless target.wordpress?(parsed_options[:detection_mode]) || parsed_options[:force]
+ raise Error::NotWordPress unless target.wordpress?(parsed_options[:detection_mode]) || parsed_options[:force]
end
# Loads the related server module in the target
# and includes it in the WpItem class which will be needed
# to check if directory listing is enabled etc
@@ -93,10 +95,10 @@
end
mod = CMSScanner::Target::Server.const_get(server)
target.extend mod
- WPScan::WpItem.include mod
+ Model::WpItem.include mod
server
end
end
end