lib/nexpose/vuln.rb
# Retrieve summary details of all vulnerabilities.
#
# @param [Boolean] full Whether or not to gather the full summary.
#   Without the flag, only id, title, and severity are returned.
#   It can take twice a long to retrieve full summary information.
# @return [Array[Vulnerability|VulnerabilitySummary]] Collection of all known vulnerabilities.
#
Retrieve summary details of all vulnerabilities.
Retrieve summary details of all vulnerabilities .
def list_vulns(full = false)
      xml = make_xml('VulnerabilityListingRequest')
      response = execute(xml, '1.2')
      vulns = []
      if response.success
        response.res.elements.each('VulnerabilityListingResponse/VulnerabilitySummary') do |vuln|
          if full
            vulns << VulnerabilitySummary.parse(vuln)
          else
            vulns << Vulnerability.new(vuln.attributes['id'],
                                       vuln.attributes['title'],
                                       vuln.attributes['severity'].to_i)
          end
        end
      end
      vulns
    end
def list_vulns ( full = false ) xml = make_xml ( 'VulnerabilityListingRequest' ) response = execute ( xml , '1.2' ) vulns = [ ] if response . success response . res . elements . each ( 'VulnerabilityListingResponse/VulnerabilitySummary' ) do | vuln | if full vulns << VulnerabilitySummary . parse ( vuln ) else vulns << Vulnerability . new ( vuln . attributes [ 'id' ] , vuln . attributes [ 'title' ] , vuln . attributes [ 'severity' ] . to_i ) end end end vulns end
Retrieve summary details of all vulnerabilities.
Retrieve summary details of all vulnerabilities .
# TODO: Add a flag to do stream parsing of the XML to improve performance.
] Collection of all known vulnerabilities.
] Collection of all known vulnerabilities .
Array[Vulnerability|VulnerabilitySummary
full
<not_specific>
<not_specific>
full Whether or not to gather the full summary. Without the flag, only id, title, and severity are returned. It can take twice a long to retrieve full summary information.
full Whether or not to gather the full summary . Without the flag only id title and severity are returned . It can take twice a long to retrieve full summary information .