Class: Rex::Exploitation::OpcodeDb::OsVersion

Inherits:
Object
  • Object
show all
Extended by:
Cachable
Includes:
DbEntry
Defined in:
lib/rex/exploitation/opcodedb.rb

Overview

This class contains information about a platform (operating system) version.

Instance Attribute Summary collapse

Attributes included from DbEntry

#id, #name

Attributes included from OpcodeResult

#hash

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Cachable

create, flush_cache, hash_key

Methods included from DbEntry

#filter_hash

Constructor Details

#initialize(hash) ⇒ OsVersion

Returns a new instance of OsVersion.



307
308
309
310
311
312
313
314
315
316
317
# File 'lib/rex/exploitation/opcodedb.rb', line 307

def initialize(hash)
  super

  @modules = (hash['modules']) ? hash['modules'].to_i : 0
  @desc    = hash['desc']
  @arch    = hash['arch']
  @maj_ver = hash['maj_ver'].to_i
  @min_ver = hash['min_ver'].to_i
  @maj_patch_level = hash['maj_patch_level'].to_i
  @min_patch_level = hash['min_patch_level'].to_i
end

Instance Attribute Details

#archObject (readonly)

The architecture that the operating system version runs on, such as IA32.



331
332
333
# File 'lib/rex/exploitation/opcodedb.rb', line 331

def arch
  @arch
end

#descObject (readonly)

The operating system version description, such as Windows XP 5.2.0.0 (IA32).



327
328
329
# File 'lib/rex/exploitation/opcodedb.rb', line 327

def desc
  @desc
end

#maj_patch_levelObject (readonly)

The major patch level of the operating system version, such as a service pack.



344
345
346
# File 'lib/rex/exploitation/opcodedb.rb', line 344

def maj_patch_level
  @maj_patch_level
end

#maj_verObject (readonly)

The major version of the operating system version.



335
336
337
# File 'lib/rex/exploitation/opcodedb.rb', line 335

def maj_ver
  @maj_ver
end

#min_patch_levelObject (readonly)

The minor patch level of the operating system version.



348
349
350
# File 'lib/rex/exploitation/opcodedb.rb', line 348

def min_patch_level
  @min_patch_level
end

#min_verObject (readonly)

The minor version of the operating system version.



339
340
341
# File 'lib/rex/exploitation/opcodedb.rb', line 339

def min_ver
  @min_ver
end

#modulesObject (readonly)

The number of modules that exist in this operating system version.



322
323
324
# File 'lib/rex/exploitation/opcodedb.rb', line 322

def modules
  @modules
end

Class Method Details

.hash_key(hash) ⇒ Object



302
303
304
# File 'lib/rex/exploitation/opcodedb.rb', line 302

def hash_key(hash)
  hash['id'] + (hash['modules'] || '')
end