Class: Nexpose::VulnerabilityDetail

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

Overview

Description

Object that represents the details for an entry in the vulnerability database

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(connection, id) ⇒ VulnerabilityDetail

Constructor VulnerabilityListing(connection,id)



2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
# File 'lib/nexpose.rb', line 2292

def initialize(connection, id)

	@error = false
	@connection = connection
	@id = id
	@references = []

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

	if (r.success)
		r.res.elements.each('VulnerabilityDetailsResponse/Vulnerability') do |v|
			@id = v.attributes['id']
			@title = v.attributes["title"]
			@severity = v.attributes["severity"]
			@pciSeverity = v.attributes['pciSeverity']
			@cvssScore = v.attributes['cvssScore']
			@cvssVector = v.attributes['cvssVector']
			@published = v.attributes['published']
			@added = v.attributes['added']
			@modified = v.attributes['modified']

			v.elements.each('description') do |d|
				@description = d.to_s.gsub(/\<\/?description\>/i, '')
			end

			v.elements.each('solution') do |s|
				@solution = s.to_s.gsub(/\<\/?solution\>/i, '')
			end

			v.elements.each('references/reference') do |r|
				@references.push(Reference.new(r.attributes['source'],r.text))
			end
		end
	else
		@error = true
		@error_msg = 'VulnerabilitySummaryRequest Parse Error'
	end

end

Instance Attribute Details

#addedObject (readonly)

The date this vulnerability was added to NeXpose



2279
2280
2281
# File 'lib/nexpose.rb', line 2279

def added
  @added
end

#connectionObject (readonly)

The NSC Connection associated with this object



2263
2264
2265
# File 'lib/nexpose.rb', line 2263

def connection
  @connection
end

#cvssScoreObject (readonly)

The CVSS score of this vulnerability



2273
2274
2275
# File 'lib/nexpose.rb', line 2273

def cvssScore
  @cvssScore
end

#cvssVectorObject (readonly)

The CVSS vector of this vulnerability



2275
2276
2277
# File 'lib/nexpose.rb', line 2275

def cvssVector
  @cvssVector
end

#descriptionObject (readonly)

The HTML Description of this vulnerability



2283
2284
2285
# File 'lib/nexpose.rb', line 2283

def description
  @description
end

#errorObject (readonly)

true if an error condition exists; false otherwise



2255
2256
2257
# File 'lib/nexpose.rb', line 2255

def error
  @error
end

#error_msgObject (readonly)

Error message string



2257
2258
2259
# File 'lib/nexpose.rb', line 2257

def error_msg
  @error_msg
end

#idObject (readonly)

The unique ID string for this vulnerability



2265
2266
2267
# File 'lib/nexpose.rb', line 2265

def id
  @id
end

#modifiedObject (readonly)

The last date this vulnerability was modified



2281
2282
2283
# File 'lib/nexpose.rb', line 2281

def modified
  @modified
end

#pciSeverityObject (readonly)

The pciSeverity of this vulnerability



2271
2272
2273
# File 'lib/nexpose.rb', line 2271

def pciSeverity
  @pciSeverity
end

#publishedObject (readonly)

The date this vulnerability was published



2277
2278
2279
# File 'lib/nexpose.rb', line 2277

def published
  @published
end

#referencesObject (readonly)

Array containing (Reference)



2286
2287
2288
# File 'lib/nexpose.rb', line 2286

def references
  @references
end

#request_xmlObject (readonly)

The last XML request sent by this object



2259
2260
2261
# File 'lib/nexpose.rb', line 2259

def request_xml
  @request_xml
end

#response_xmlObject (readonly)

The last XML response received by this object



2261
2262
2263
# File 'lib/nexpose.rb', line 2261

def response_xml
  @response_xml
end

#severityObject (readonly)

The severity of this vulnerability (1 – 10)



2269
2270
2271
# File 'lib/nexpose.rb', line 2269

def severity
  @severity
end

#solutionObject (readonly)

The HTML Solution for this vulnerability



2288
2289
2290
# File 'lib/nexpose.rb', line 2288

def solution
  @solution
end

#titleObject (readonly)

The title of this vulnerability



2267
2268
2269
# File 'lib/nexpose.rb', line 2267

def title
  @title
end