Uses the frozen_string_literal magic comment (will be the default in Ruby 3)
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
# Gems
|
||||
# Believe it or not, active_support MUST be the first one,
|
||||
# otherwise encoding issues can happen when using JSON format.
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module WPScan
|
||||
# Custom Browser
|
||||
class Browser < CMSScanner::Browser
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module WPScan
|
||||
# Needed to load at least the Core controller
|
||||
# Otherwise, the following error will be raised:
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module WPScan
|
||||
# Override to set the OptParser's summary width to 45 (instead of 40 from the CMSScanner)
|
||||
class Controllers < CMSScanner::Controllers
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require_relative 'db/wp_item'
|
||||
require_relative 'db/updater'
|
||||
require_relative 'db/wp_items'
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module WPScan
|
||||
module DB
|
||||
module DynamicFinders
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module WPScan
|
||||
module DB
|
||||
module DynamicFinders
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module WPScan
|
||||
module DB
|
||||
module DynamicFinders
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module WPScan
|
||||
module DB
|
||||
module DynamicFinders
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module WPScan
|
||||
module DB
|
||||
# Fingerprints class
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module WPScan
|
||||
module DB
|
||||
# Plugin DB
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module WPScan
|
||||
module DB
|
||||
# WP Plugins
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module WPScan
|
||||
module DB
|
||||
# Theme DB
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module WPScan
|
||||
module DB
|
||||
# WP Themes
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module WPScan
|
||||
module DB
|
||||
# Class used to perform DB updates
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module WPScan
|
||||
module DB
|
||||
# WpItem - super DB class for Plugin, Theme and Version
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module WPScan
|
||||
module DB
|
||||
# WP Items
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module WPScan
|
||||
module DB
|
||||
# WP Version
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module WPScan
|
||||
module Error
|
||||
include CMSScanner::Error
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module WPScan
|
||||
module Error
|
||||
# HTTP Error
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module WPScan
|
||||
module Error
|
||||
# Error raised when there is a missing DB file and --no-update supplied
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module WPScan
|
||||
module Error
|
||||
# WordPress hosted (*.wordpress.com)
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module WPScan
|
||||
module Error
|
||||
# XML-RPC Not Detected
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'wpscan/finders/finder/wp_version/smart_url_checker'
|
||||
|
||||
require 'wpscan/finders/dynamic_finder/finder'
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module WPScan
|
||||
module Finders
|
||||
module DynamicFinder
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module WPScan
|
||||
module Finders
|
||||
module DynamicFinder
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module WPScan
|
||||
module Finders
|
||||
module DynamicFinder
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module WPScan
|
||||
module Finders
|
||||
module DynamicFinder
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module WPScan
|
||||
module Finders
|
||||
module DynamicFinder
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module WPScan
|
||||
module Finders
|
||||
module DynamicFinder
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module WPScan
|
||||
module Finders
|
||||
module DynamicFinder
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module WPScan
|
||||
module Finders
|
||||
module DynamicFinder
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module WPScan
|
||||
module Finders
|
||||
module DynamicFinder
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module WPScan
|
||||
module Finders
|
||||
module DynamicFinder
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module WPScan
|
||||
module Finders
|
||||
module DynamicFinder
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module WPScan
|
||||
module Finders
|
||||
module DynamicFinder
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module WPScan
|
||||
module Finders
|
||||
class Finder
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
def read_json_file(file)
|
||||
JSON.parse(File.read(file))
|
||||
rescue StandardError => e
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module WPScan
|
||||
# References module (which should be included along with the CMSScanner::References)
|
||||
# to allow the use of the wpvulndb reference
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'wpscan/target/platform/wordpress'
|
||||
|
||||
module WPScan
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
%w[custom_directories].each do |required|
|
||||
require "wpscan/target/platform/wordpress/#{required}"
|
||||
end
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module WPScan
|
||||
class Target < CMSScanner::Target
|
||||
module Platform
|
||||
@@ -111,9 +113,9 @@ module WPScan
|
||||
return @uri.to_s unless path
|
||||
|
||||
if path =~ %r{wp\-content/plugins}i
|
||||
path.gsub!('wp-content/plugins', plugins_dir)
|
||||
path = +path.gsub('wp-content/plugins', plugins_dir)
|
||||
elsif path =~ /wp\-content/i
|
||||
path.gsub!('wp-content', content_dir)
|
||||
path = +path.gsub('wp-content', content_dir)
|
||||
elsif path[0] != '/' && sub_dir
|
||||
path = "#{sub_dir}/#{path}"
|
||||
end
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
# Version
|
||||
module WPScan
|
||||
VERSION = '3.4.5'.freeze
|
||||
VERSION = '3.4.5'
|
||||
end
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module WPScan
|
||||
# Specific implementation
|
||||
class Vulnerability < CMSScanner::Vulnerability
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module WPScan
|
||||
# Module to include in vulnerable WP item such as WpVersion.
|
||||
# the vulnerabilities method should be implemented
|
||||
|
||||
Reference in New Issue
Block a user