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)



1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
# File 'lib/nexpose.rb', line 1718

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



1710
1711
1712
# File 'lib/nexpose.rb', line 1710

def connection
  @connection
end

#errorObject (readonly)

true if an error condition exists; false otherwise



1702
1703
1704
# File 'lib/nexpose.rb', line 1702

def error
  @error
end

#error_msgObject (readonly)

Error message string



1704
1705
1706
# File 'lib/nexpose.rb', line 1704

def error_msg
  @error_msg
end

#request_xmlObject (readonly)

The last XML request sent by this object



1706
1707
1708
# File 'lib/nexpose.rb', line 1706

def request_xml
  @request_xml
end

#response_xmlObject (readonly)

The last XML response received by this object



1708
1709
1710
# File 'lib/nexpose.rb', line 1708

def response_xml
  @response_xml
end

#vulnerability_countObject (readonly)

The number of vulnerability definitions



1714
1715
1716
# File 'lib/nexpose.rb', line 1714

def vulnerability_count
  @vulnerability_count
end

#vulnerability_summariesObject (readonly)

Array containing (VulnerabilitySummary*)



1712
1713
1714
# File 'lib/nexpose.rb', line 1712

def vulnerability_summaries
  @vulnerability_summaries
end