class WPScan::Target

Includes the WordPress Platform

Public Instance Methods

config_backups(opts = {}) click to toggle source

@param [ Hash ] opts

@return [ Array<ConfigBackup> ]

# File lib/wpscan/target.rb, line 80
def config_backups(opts = {})
  @config_backups ||= Finders::ConfigBackups::Base.find(self, opts)
end
db_exports(opts = {}) click to toggle source

@param [ Hash ] opts

@return [ Array<DBExport> ]

# File lib/wpscan/target.rb, line 87
def db_exports(opts = {})
  @db_exports ||= Finders::DbExports::Base.find(self, opts)
end
head_or_get_request_params() click to toggle source

@return [ Hash ]

# File lib/wpscan/target.rb, line 11
def head_or_get_request_params
  @head_or_get_request_params ||= if Browser.head(url).code == 405
                                    { method: :get, maxfilesize: 1 }
                                  else
                                    { method: :head }
                                  end
end
main_theme(opts = {}) click to toggle source

@param [ Hash ] opts

@return [ Theme ]

# File lib/wpscan/target.rb, line 50
def main_theme(opts = {})
  @main_theme = Finders::MainTheme::Base.find(self, opts) if @main_theme.nil?

  @main_theme
end
medias(opts = {}) click to toggle source

@param [ Hash ] opts

@return [ Array<Media> ]

# File lib/wpscan/target.rb, line 94
def medias(opts = {})
  @medias ||= Finders::Medias::Base.find(self, opts)
end
plugins(opts = {}) click to toggle source

@param [ Hash ] opts

@return [ Array<Plugin> ]

# File lib/wpscan/target.rb, line 59
def plugins(opts = {})
  @plugins ||= Finders::Plugins::Base.find(self, opts)
end
themes(opts = {}) click to toggle source

@param [ Hash ] opts

@return [ Array<Theme> ]

# File lib/wpscan/target.rb, line 66
def themes(opts = {})
  @themes ||= Finders::Themes::Base.find(self, opts)
end
timthumbs(opts = {}) click to toggle source

@param [ Hash ] opts

@return [ Array<Timthumb> ]

# File lib/wpscan/target.rb, line 73
def timthumbs(opts = {})
  @timthumbs ||= Finders::Timthumbs::Base.find(self, opts)
end
users(opts = {}) click to toggle source

@param [ Hash ] opts

@return [ Array<User> ]

# File lib/wpscan/target.rb, line 101
def users(opts = {})
  @users ||= Finders::Users::Base.find(self, opts)
end
vulnerable?() click to toggle source

@return [ Boolean ]

# File lib/wpscan/target.rb, line 20
def vulnerable?
  [@wp_version, @main_theme, @plugins, @themes, @timthumbs].each do |e|
    Array(e).each { |ae| return true if ae && ae.vulnerable? } # rubocop:disable Style/SafeNavigation
  end

  return true unless Array(@config_backups).empty?
  return true unless Array(@db_exports).empty?

  Array(@users).each { |u| return true if u.password }

  false
end
wp_version(opts = {}) click to toggle source

@param [ Hash ] opts

@return [ WpVersion, false ] The WpVersion found or false if not detected

# File lib/wpscan/target.rb, line 41
def wp_version(opts = {})
  @wp_version = Finders::WpVersion::Base.find(self, opts) if @wp_version.nil?

  @wp_version
end
xmlrpc() click to toggle source

@return [ XMLRPC, nil ]

# File lib/wpscan/target.rb, line 34
def xmlrpc
  @xmlrpc ||= interesting_findings&.select { |f| f.is_a?(Model::XMLRPC) }&.first
end