Class: Nexpose::VulnerabilityListing

Inherits:
Object
  • Object
show all
Defined in:
lib/nexpose.rb

Overview

Description

Object that represents a listing of all of the vulnerabilities in the vulnerability database

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(connection) ⇒ VulnerabilityListing

Constructor VulnerabilityListing(connection)



2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
# File 'lib/nexpose.rb', line 2066

def initialize(connection)
	@error = false
	@vulnerability_summaries = []
	@connection = connection

	r = @connection.execute('<VulnerabilityListingRequest session-id="' + @connection.session_id + '"/>')

	if (r.success)
		r.res.elements.each('VulnerabilityListingResponse/VulnerabilitySummary') do |v|
			@vulnerability_summaries.push(VulnerabilitySummary.new(v.attributes['id'],v.attributes["title"],v.attributes["severity"]))
		end
	else
		@error = true
		@error_msg = 'VulnerabilitySummaryRequest Parse Error'
	end
	@vulnerability_count = @vulnerability_summaries.length
end

Instance Attribute Details

#connectionObject (readonly)

The NSC Connection associated with this object



2058
2059
2060
# File 'lib/nexpose.rb', line 2058

def connection
  @connection
end

#errorObject (readonly)

true if an error condition exists; false otherwise



2050
2051
2052
# File 'lib/nexpose.rb', line 2050

def error
  @error
end

#error_msgObject (readonly)

Error message string



2052
2053
2054
# File 'lib/nexpose.rb', line 2052

def error_msg
  @error_msg
end

#request_xmlObject (readonly)

The last XML request sent by this object



2054
2055
2056
# File 'lib/nexpose.rb', line 2054

def request_xml
  @request_xml
end

#response_xmlObject (readonly)

The last XML response received by this object



2056
2057
2058
# File 'lib/nexpose.rb', line 2056

def response_xml
  @response_xml
end

#vulnerability_countObject (readonly)

The number of vulnerability definitions



2062
2063
2064
# File 'lib/nexpose.rb', line 2062

def vulnerability_count
  @vulnerability_count
end

#vulnerability_summariesObject (readonly)

Array containing (VulnerabilitySummary*)



2060
2061
2062
# File 'lib/nexpose.rb', line 2060

def vulnerability_summaries
  @vulnerability_summaries
end