class Vulnerability

Attributes

metasploit_modules[RW]
references[RW]
title[RW]
type[RW]

Public Class Methods

load_from_xml_node(xml_node) click to toggle source

Create the Vulnerability from the xml_node

@param [ Nokogiri::XML::Node ] xml_node

@return [ Vulnerability ]

# File lib/common/models/vulnerability.rb, line 37
def self.load_from_xml_node(xml_node)
  new(
    xml_node.search('title').text,
    xml_node.search('type').text,
    xml_node.search('reference').map(&:text),
    xml_node.search('metasploit').map(&:text)
  )
end
new(title, type, references, metasploit_modules = []) click to toggle source

@param [ String ] title The title of the vulnerability @param [ String ] type The type of the vulnerability @param [ Array ] references References urls @param [ Array ] #metasploit_modules Metasploit modules for the vulnerability

@return [ Vulnerability ]

# File lib/common/models/vulnerability.rb, line 16
def initialize(title, type, references, metasploit_modules = [])
  @title              = title
  @type               = type
  @references         = references
  @metasploit_modules = metasploit_modules
end

Public Instance Methods

==(other) click to toggle source

@param [ Vulnerability ] other

@return [ Boolean ] :nocov:

# File lib/common/models/vulnerability.rb, line 27
def ==(other)
  title == other.title && type == other.type && references == other.references
end