Skip to content

Commit

Permalink
Removes useless WPScan namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
erwanlr committed Jul 4, 2019
1 parent d7193bc commit d911a16
Show file tree
Hide file tree
Showing 20 changed files with 35 additions and 35 deletions.
12 changes: 6 additions & 6 deletions app/controllers/password_attack.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,15 @@ def attacker_from_cli_options

case ParsedCli.password_attack
when :wp_login
WPScan::Finders::Passwords::WpLogin.new(target)
Finders::Passwords::WpLogin.new(target)
when :xmlrpc
raise Error::XMLRPCNotDetected unless xmlrpc

WPScan::Finders::Passwords::XMLRPC.new(xmlrpc)
Finders::Passwords::XMLRPC.new(xmlrpc)
when :xmlrpc_multicall
raise Error::XMLRPCNotDetected unless xmlrpc

WPScan::Finders::Passwords::XMLRPCMulticall.new(xmlrpc)
Finders::Passwords::XMLRPCMulticall.new(xmlrpc)
end
end

Expand All @@ -96,12 +96,12 @@ def attacker_from_automatic_detection
wp_version = target.wp_version

if wp_version && wp_version < '4.4'
WPScan::Finders::Passwords::XMLRPCMulticall.new(xmlrpc)
Finders::Passwords::XMLRPCMulticall.new(xmlrpc)
else
WPScan::Finders::Passwords::XMLRPC.new(xmlrpc)
Finders::Passwords::XMLRPC.new(xmlrpc)
end
else
WPScan::Finders::Passwords::WpLogin.new(target)
Finders::Passwords::WpLogin.new(target)
end
end

Expand Down
2 changes: 1 addition & 1 deletion app/controllers/wp_version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def cli_options
end

def before_scan
WPScan::DB::DynamicFinders::Wordpress.create_versions_finders
DB::DynamicFinders::Wordpress.create_versions_finders
end

def run
Expand Down
2 changes: 1 addition & 1 deletion app/finders/plugins/body_pattern.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module WPScan
module Finders
module Plugins
# Plugins finder from Dynamic Finder 'BodyPattern'
class BodyPattern < WPScan::Finders::DynamicFinder::WpItems::Finder
class BodyPattern < Finders::DynamicFinder::WpItems::Finder
DEFAULT_CONFIDENCE = 30

# @param [ Hash ] opts The options from the #passive, #aggressive methods
Expand Down
2 changes: 1 addition & 1 deletion app/finders/plugins/comment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module WPScan
module Finders
module Plugins
# Plugins finder from the Dynamic Finder 'Comment'
class Comment < WPScan::Finders::DynamicFinder::WpItems::Finder
class Comment < Finders::DynamicFinder::WpItems::Finder
DEFAULT_CONFIDENCE = 30

# @param [ Hash ] opts The options from the #passive, #aggressive methods
Expand Down
2 changes: 1 addition & 1 deletion app/finders/plugins/config_parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module WPScan
module Finders
module Plugins
# Plugins finder from Dynamic Finder 'ConfigParser'
class ConfigParser < WPScan::Finders::DynamicFinder::WpItems::Finder
class ConfigParser < Finders::DynamicFinder::WpItems::Finder
DEFAULT_CONFIDENCE = 40

# @param [ Hash ] opts The options from the #passive, #aggressive methods
Expand Down
2 changes: 1 addition & 1 deletion app/finders/plugins/header_pattern.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module WPScan
module Finders
module Plugins
# Plugins finder from Dynamic Finder 'HeaderPattern'
class HeaderPattern < WPScan::Finders::DynamicFinder::WpItems::Finder
class HeaderPattern < Finders::DynamicFinder::WpItems::Finder
DEFAULT_CONFIDENCE = 30

# @param [ Hash ] opts
Expand Down
2 changes: 1 addition & 1 deletion app/finders/plugins/javascript_var.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module WPScan
module Finders
module Plugins
# Plugins finder from the Dynamic Finder 'JavascriptVar'
class JavascriptVar < WPScan::Finders::DynamicFinder::WpItems::Finder
class JavascriptVar < Finders::DynamicFinder::WpItems::Finder
DEFAULT_CONFIDENCE = 60

# @param [ Hash ] opts The options from the #passive, #aggressive methods
Expand Down
2 changes: 1 addition & 1 deletion app/finders/plugins/query_parameter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module WPScan
module Finders
module Plugins
# Plugins finder from Dynamic Finder 'QueryParameter'
class QueryParameter < WPScan::Finders::DynamicFinder::WpItems::Finder
class QueryParameter < Finders::DynamicFinder::WpItems::Finder
DEFAULT_CONFIDENCE = 10

def passive(_opts = {})
Expand Down
2 changes: 1 addition & 1 deletion app/finders/plugins/xpath.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module WPScan
module Finders
module Plugins
# Plugins finder from the Dynamic Finder 'Xpath'
class Xpath < WPScan::Finders::DynamicFinder::WpItems::Finder
class Xpath < Finders::DynamicFinder::WpItems::Finder
DEFAULT_CONFIDENCE = 40

# @param [ Hash ] opts The options from the #passive, #aggressive methods
Expand Down
2 changes: 1 addition & 1 deletion app/finders/users/rss_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module Users
# Users disclosed from the dc:creator field in the RSS
# The names disclosed are display names, however depending on the configuration of the blog,
# they can be the same than usernames
class RSSGenerator < WPScan::Finders::WpVersion::RSSGenerator
class RSSGenerator < Finders::WpVersion::RSSGenerator
def process_urls(urls, _opts = {})
found = []

Expand Down
2 changes: 1 addition & 1 deletion app/finders/wp_version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class Base
# @param [ WPScan::Target ] target
def initialize(target)
(%w[RSSGenerator AtomGenerator RDFGenerator] +
WPScan::DB::DynamicFinders::Wordpress.versions_finders_configs.keys +
DB::DynamicFinders::Wordpress.versions_finders_configs.keys +
%w[Readme UniqueFingerprinting]
).each do |finder_name|
finders << WpVersion.const_get(finder_name.to_sym).new(target)
Expand Down
2 changes: 1 addition & 1 deletion lib/wpscan/finders/dynamic_finder/version/body_pattern.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module DynamicFinder
module Version
# Version finder using Body Pattern method. Tipically used when the response is not
# an HTML doc and Xpath can't be used
class BodyPattern < WPScan::Finders::DynamicFinder::Version::Finder
class BodyPattern < Finders::DynamicFinder::Version::Finder
# @return [ Hash ]
def self.child_class_constants
@child_class_constants ||= super().merge(PATTERN: nil, CONFIDENCE: 60)
Expand Down
2 changes: 1 addition & 1 deletion lib/wpscan/finders/dynamic_finder/version/comment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module DynamicFinder
module Version
# Version finder in Comment, which is basically an Xpath one with a default
# Xpath of //comment()
class Comment < WPScan::Finders::DynamicFinder::Version::Xpath
class Comment < Finders::DynamicFinder::Version::Xpath
# @return [ Hash ]
def self.child_class_constants
@child_class_constants ||= super().merge(PATTERN: nil, XPATH: '//comment()')
Expand Down
2 changes: 1 addition & 1 deletion lib/wpscan/finders/dynamic_finder/version/config_parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module DynamicFinder
module Version
# Version finder using by parsing config files, such as composer.json
# and so on
class ConfigParser < WPScan::Finders::DynamicFinder::Version::Finder
class ConfigParser < Finders::DynamicFinder::Version::Finder
ALLOWED_PARSERS = [JSON, YAML].freeze

def self.child_class_constants
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module Finders
module DynamicFinder
module Version
# Version finder using Header Pattern method
class HeaderPattern < WPScan::Finders::DynamicFinder::Version::Finder
class HeaderPattern < Finders::DynamicFinder::Version::Finder
# @return [ Hash ]
def self.child_class_constants
@child_class_constants ||= super().merge(HEADER: nil, PATTERN: nil, CONFIDENCE: 60)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module Finders
module DynamicFinder
module Version
# Version finder using JavaScript Variable method
class JavascriptVar < WPScan::Finders::DynamicFinder::Version::Finder
class JavascriptVar < Finders::DynamicFinder::Version::Finder
# @return [ Hash ]
def self.child_class_constants
@child_class_constants ||= super().merge(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module Finders
module DynamicFinder
module Version
# Version finder using QueryParameter method
class QueryParameter < WPScan::Finders::DynamicFinder::Version::Finder
class QueryParameter < Finders::DynamicFinder::Version::Finder
# @return [ Hash ]
def self.child_class_constants
@child_class_constants ||= super().merge(
Expand Down
2 changes: 1 addition & 1 deletion lib/wpscan/finders/dynamic_finder/version/xpath.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module Finders
module DynamicFinder
module Version
# Version finder using Xpath method
class Xpath < WPScan::Finders::DynamicFinder::Version::Finder
class Xpath < Finders::DynamicFinder::Version::Finder
# @return [ Hash ]
def self.child_class_constants
@child_class_constants ||= super().merge(
Expand Down
14 changes: 7 additions & 7 deletions lib/wpscan/finders/dynamic_finder/wp_item_version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,22 @@ module WPScan
module Finders
module DynamicFinder
module WpItemVersion
class BodyPattern < WPScan::Finders::DynamicFinder::Version::BodyPattern
class BodyPattern < Finders::DynamicFinder::Version::BodyPattern
end

class Comment < WPScan::Finders::DynamicFinder::Version::Comment
class Comment < Finders::DynamicFinder::Version::Comment
end

class ConfigParser < WPScan::Finders::DynamicFinder::Version::ConfigParser
class ConfigParser < Finders::DynamicFinder::Version::ConfigParser
end

class HeaderPattern < WPScan::Finders::DynamicFinder::Version::HeaderPattern
class HeaderPattern < Finders::DynamicFinder::Version::HeaderPattern
end

class JavascriptVar < WPScan::Finders::DynamicFinder::Version::JavascriptVar
class JavascriptVar < Finders::DynamicFinder::Version::JavascriptVar
end

class QueryParameter < WPScan::Finders::DynamicFinder::Version::QueryParameter
class QueryParameter < Finders::DynamicFinder::Version::QueryParameter
# @return [ Regexp ]
def path_pattern
# TODO: consider the target.blog.themes_dir if the target is a Theme (maybe implement a WpItem#item_dir ?)
Expand All @@ -37,7 +37,7 @@ def xpath
end
end

class Xpath < WPScan::Finders::DynamicFinder::Version::Xpath
class Xpath < Finders::DynamicFinder::Version::Xpath
end
end
end
Expand Down
10 changes: 5 additions & 5 deletions lib/wpscan/finders/dynamic_finder/wp_version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,23 @@ def create_version(number, finding_opts)
end
end

class BodyPattern < WPScan::Finders::DynamicFinder::Version::BodyPattern
class BodyPattern < Finders::DynamicFinder::Version::BodyPattern
include Finder
end

class Comment < WPScan::Finders::DynamicFinder::Version::Comment
class Comment < Finders::DynamicFinder::Version::Comment
include Finder
end

class HeaderPattern < WPScan::Finders::DynamicFinder::Version::HeaderPattern
class HeaderPattern < Finders::DynamicFinder::Version::HeaderPattern
include Finder
end

class JavascriptVar < WPScan::Finders::DynamicFinder::Version::JavascriptVar
class JavascriptVar < Finders::DynamicFinder::Version::JavascriptVar
include Finder
end

class QueryParameter < WPScan::Finders::DynamicFinder::Version::QueryParameter
class QueryParameter < Finders::DynamicFinder::Version::QueryParameter
include Finder

# @return [ Hash ]
Expand Down

0 comments on commit d911a16

Please sign in to comment.