Class: Msf::Nop

Inherits:
Module
  • Object
show all
Defined in:
lib/msf/core/nop.rb

Overview

This class acts as the base class for all nop generators.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(info = {}) ⇒ Nop

Initializes the NOP generator, defaulting it to being usable on all platforms.



30
31
32
33
34
# File 'lib/msf/core/nop.rb', line 30

def initialize(info = {})
  super({
      'Platform' => '' # All platforms by default
    }.update(info))
end

Class Method Details

.type ⇒ Object

Returns MODULE_NOP to indicate that this is a NOP module.



15
16
17
# File 'lib/msf/core/nop.rb', line 15

def self.type
  return Msf::MODULE_NOP
end

Instance Method Details

#generate_sled(length, opts) ⇒ Object

Stub method for generating a sled with the provided arguments. Derived Nop implementations must supply a length and can supply one or more of the following options:

- Random (true/false)
Indicates that the caller desires random NOPs (if supported).
- SaveRegisters (array)
The list of registers that should not be clobbered by the NOP
generator.
- BadChars (string)
The list of characters that should be avoided by the NOP
generator.


50
51
52
# File 'lib/msf/core/nop.rb', line 50

def generate_sled(length, opts)
  return nil
end

#nop_repeat_threshold ⇒ Object

Default repetition threshold when finding nop characters.



57
58
59
# File 'lib/msf/core/nop.rb', line 57

def nop_repeat_threshold
  return 10000
end

#type ⇒ Object

Returns MODULE_NOP to indicate that this is a NOP module.



22
23
24
# File 'lib/msf/core/nop.rb', line 22

def type
  return Msf::MODULE_NOP
end