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)



2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
# File 'lib/nexpose.rb', line 2195

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



2187
2188
2189
# File 'lib/nexpose.rb', line 2187

def connection
  @connection
end

#errorObject (readonly)

true if an error condition exists; false otherwise



2179
2180
2181
# File 'lib/nexpose.rb', line 2179

def error
  @error
end

#error_msgObject (readonly)

Error message string



2181
2182
2183
# File 'lib/nexpose.rb', line 2181

def error_msg
  @error_msg
end

#request_xmlObject (readonly)

The last XML request sent by this object



2183
2184
2185
# File 'lib/nexpose.rb', line 2183

def request_xml
  @request_xml
end

#response_xmlObject (readonly)

The last XML response received by this object



2185
2186
2187
# File 'lib/nexpose.rb', line 2185

def response_xml
  @response_xml
end

#vulnerability_countObject (readonly)

The number of vulnerability definitions



2191
2192
2193
# File 'lib/nexpose.rb', line 2191

def vulnerability_count
  @vulnerability_count
end

#vulnerability_summariesObject (readonly)

Array containing (VulnerabilitySummary*)



2189
2190
2191
# File 'lib/nexpose.rb', line 2189

def vulnerability_summaries
  @vulnerability_summaries
end