Module: Metasploit::Model::Authority

Extended by:
ActiveModel::Naming, ActiveSupport::Concern
Includes:
Translation
Defined in:
lib/metasploit/model/authority.rb

Overview

Code shared between Mdm::Authority and Metasploit::Framework::Authority.

Defined Under Namespace

Modules: Bid, Cve, Msb, Osvdb, Pmasa, Secunia, UsCertVu, Waraxe, Zdi

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#abbreviationString

Abbreviation or initialism for authority, such as CVE for 'Common Vulnerability and Exposures'.

Returns:

  • (String)


# File 'lib/metasploit/model/authority.rb', line 62


#module_instancesArray<Metasploit::Model::Module::Instance> (readonly)

Modules that have a reference with this authority.



# File 'lib/metasploit/model/authority.rb', line 48


#obsoletefalse, true

Whether this authority is obsolete and no longer exists on the internet.

Returns:

  • (false)
  • (true)

    #url may be nil because authory no longer has a web site.



# File 'lib/metasploit/model/authority.rb', line 67


#referencesArray<Metasploit::Model::Reference>

References that use this authority's scheme for their Reference#authority.

Returns:



# File 'lib/metasploit/model/authority.rb', line 42


#summaryString?

An expansion of the #abbreviation.

Returns:

  • (String, nil)


# File 'lib/metasploit/model/authority.rb', line 73


#urlString?

URL to the authority's home page or root URL for their #references database.

Returns:

  • (String, nil)


# File 'lib/metasploit/model/authority.rb', line 78


#vulnsArray<Metasploit::Model::Vuln> (readonly)

Vulnerabilities that have a reference under this authority.

Returns:

  • (Array<Metasploit::Model::Vuln>)


# File 'lib/metasploit/model/authority.rb', line 53


Instance Method Details

#designation_url(designation) ⇒ String?

Returns the URL for a designation.

Parameters:

Returns:



93
94
95
96
97
98
99
100
101
# File 'lib/metasploit/model/authority.rb', line 93

def designation_url(designation)
  url = nil

  if extension
    url = extension.designation_url(designation)
  end

  url
end

#extensionModule?

Returns module that include authority specific methods.

Returns:

  • (Module)

    if #abbreviation has a corresponding module under the Metasploit::Model::Authority namespace.

  • (nil)

    otherwise.



107
108
109
110
111
112
113
# File 'lib/metasploit/model/authority.rb', line 107

def extension
  begin
    extension_name.constantize
  rescue NameError
    nil
  end
end

#extension_nameString?

Returns name of module that includes authority specific methods.

Returns:



119
120
121
122
123
124
125
126
127
128
129
130
131
# File 'lib/metasploit/model/authority.rb', line 119

def extension_name
  extension_name = nil

  unless abbreviation.blank?
    # underscore before camelize to eliminate -'s
    relative_model_name = abbreviation.underscore.camelize
    # don't scope to self.class.name so that authority extension are always resolved the same in Mdm and
    # Metasploit::Framework.
    extension_name = "Metasploit::Model::Authority::#{relative_model_name}"
  end

  extension_name
end