Class: Nexpose::VulnFinding

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

Overview

Vulnerability finding information pulled from AJAX requests. Data uses a numeric, console-specific vuln ID, which may need to be cross-referenced to the String ID to be used elsewhere.

Direct Known Subclasses

VulnSynopsis

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ VulnFinding

Returns a new instance of VulnFinding.



255
256
257
258
259
260
261
262
263
264
265
266
267
268
# File 'lib/nexpose/vuln.rb', line 255

def initialize(json)
  @id          = json['nexVulnID']
  @console_id  = json['vulnID']
  @title       = json['title']
  @cvss_vector = json['cvssBase']
  @cvss_score  = json['cvssScore']
  @risk        = json['riskScore']
  @published   = Time.at(json['publishedDate'] / 1000)
  @severity    = json['severity']
  @instances   = json['vulnInstanceCount']
  @exploit     = json['mainExploit']
  @malware     = json['malwareCount']
  @verified    = DateTime.iso8601(json['verifiedDate'].slice(0, 15)).to_time if json['verifiedDate']
end

Instance Attribute Details

#console_idObject (readonly)

Unique, console-specific identifier of the vulnerability.



237
238
239
# File 'lib/nexpose/vuln.rb', line 237

def console_id
  @console_id
end

#cvss_scoreObject (readonly)

Returns the value of attribute cvss_score.



240
241
242
# File 'lib/nexpose/vuln.rb', line 240

def cvss_score
  @cvss_score
end

#cvss_vectorObject (readonly)

Returns the value of attribute cvss_vector.



241
242
243
# File 'lib/nexpose/vuln.rb', line 241

def cvss_vector
  @cvss_vector
end

#exploitObject (readonly)

Main published exploit module against this vulnerability, if any.



249
250
251
# File 'lib/nexpose/vuln.rb', line 249

def exploit
  @exploit
end

#idObject (readonly)

Unique identifier of the vulnerability.



235
236
237
# File 'lib/nexpose/vuln.rb', line 235

def id
  @id
end

#instancesObject (readonly)

Number of instances of this vulnerabilty finding on an asset.



247
248
249
# File 'lib/nexpose/vuln.rb', line 247

def instances
  @instances
end

#malwareObject (readonly)

Whether known malware kits exploit this vulnerability.



251
252
253
# File 'lib/nexpose/vuln.rb', line 251

def malware
  @malware
end

#publishedObject (readonly)

Date this vulnerability was published.



244
245
246
# File 'lib/nexpose/vuln.rb', line 244

def published
  @published
end

#riskObject (readonly)

Returns the value of attribute risk.



242
243
244
# File 'lib/nexpose/vuln.rb', line 242

def risk
  @risk
end

#severityObject (readonly)

Returns the value of attribute severity.



245
246
247
# File 'lib/nexpose/vuln.rb', line 245

def severity
  @severity
end

#titleObject (readonly)

Vulnerability title.



239
240
241
# File 'lib/nexpose/vuln.rb', line 239

def title
  @title
end

#verifiedObject (readonly)

Date that a vuln was verified, if validation has been carried out.



253
254
255
# File 'lib/nexpose/vuln.rb', line 253

def verified
  @verified
end