Class: Msf::Nop

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

Overview

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

Instance Attribute Summary

Attributes inherited from Module

#arch, #author, #datastore, #error, #job_id, #license, #module_store, #options, #platform, #privileged, #references, #uuid

Attributes included from Framework::Offspring

#framework

Attributes included from Rex::Ui::Subscriber::Input

#user_input

Attributes included from Rex::Ui::Subscriber::Output

#user_output

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Module

#[], #[]=, #alias, #arch?, #arch_to_s, #author_to_s, #auxiliary?, cached?, #check, #comm, #compat, #compatible?, #debugging?, #description, #disclosure_date, #each_arch, #each_author, #encoder?, #exploit?, #fail_with, #file_path, #framework, #fullname, fullname, #import_defaults, is_usable, #name, #nop?, #orig_cls, #owner, #payload?, #platform?, #platform_to_s, #post?, #print_error, #print_good, #print_line, #print_line_prefix, #print_prefix, #print_status, #print_warning, #privileged?, #rank, rank, #rank_to_h, rank_to_h, #rank_to_s, rank_to_s, #refname, #register_parent, #replicant, #search_filter, #share_datastore, shortname, #shortname, #support_ipv6?, #target_host, #target_port, #validate, #vprint_debug, #vprint_error, #vprint_good, #vprint_line, #vprint_status, #vprint_warning, #workspace

Methods included from Rex::Ui::Subscriber

#copy_ui, #init_ui, #reset_ui

Methods included from Rex::Ui::Subscriber::Input

#gets

Methods included from Rex::Ui::Subscriber::Output

#flush, #print, #print_debug, #print_error, #print_good, #print_line, #print_status, #print_warning

Constructor Details

#initialize(info = {}) ⇒ Nop

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


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

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

Class Method Details

.typeObject

Returns MODULE_NOP to indicate that this is a NOP module.


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

def self.type
  return 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.

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

def generate_sled(length, opts)
  return nil
end

#nop_repeat_thresholdObject

Default repetition threshold when finding nop characters.


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

def nop_repeat_threshold
  return 10000
end

#typeObject

Returns MODULE_NOP to indicate that this is a NOP module.


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

def type
  return MODULE_NOP
end