Class: WPScan::Plugin

Inherits:
WpItem
  • Object
show all
Defined in:
app/models/plugin.rb

Overview

WordPress Plugin

Constant Summary

Constants inherited from WpItem

WpItem::CHANGELOGS, WpItem::READMES

Instance Attribute Summary

Attributes inherited from WpItem

#detection_opts, #name, #target, #uri

Instance Method Summary collapse

Methods inherited from WpItem

#==, #changelog_url, #classify_name, #directory_listing?, #error_log?, #last_updated, #latest_version, #outdated?, #popular?, #readme_url, #to_s, #url, #vulnerabilities, #vulnerable_to?

Methods included from Vulnerable

#vulnerable?

Constructor Details

#initialize(name, target, opts = {}) ⇒ Plugin

See WpItem



5
6
7
8
9
# File 'app/models/plugin.rb', line 5

def initialize(name, target, opts = {})
  super(name, target, opts)

  @uri = Addressable::URI.parse(target.url("wp-content/plugins/#{name}/"))
end

Instance Method Details

#db_dataJSON

Returns:

  • (JSON)


12
13
14
# File 'app/models/plugin.rb', line 12

def db_data
  DB::Plugin.db_data(name)
end

#version(opts = {}) ⇒ WPScan::Version, false

Parameters:

  • opts (Hash) (defaults to: {})

Returns:

  • (WPScan::Version, false)


19
20
21
22
23
# File 'app/models/plugin.rb', line 19

def version(opts = {})
  @version = Finders::PluginVersion::Base.find(self, detection_opts.merge(opts)) if @version.nil?

  @version
end