Module: Msf::ModuleManager::ModuleSets

Extended by:
ActiveSupport::Concern
Included in:
Msf::ModuleManager
Defined in:
lib/msf/core/module_manager/module_sets.rb

Overview

Concerns the various type-specific module sets in a Msf::ModuleManager

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#enablement_by_typeObject (protected)

:nodoc:


106
107
108
# File 'lib/msf/core/module_manager/module_sets.rb', line 106

def enablement_by_type
  @enablement_by_type
end

#module_set_by_typeObject (protected)

:nodoc:


107
108
109
# File 'lib/msf/core/module_manager/module_sets.rb', line 107

def module_set_by_type
  @module_set_by_type
end

Instance Method Details

#auxiliaryObject

Returns the set of loaded auxiliary module classes.


21
22
23
# File 'lib/msf/core/module_manager/module_sets.rb', line 21

def auxiliary
  module_set(Msf::MODULE_AUX)
end

#encodersObject

Returns the set of loaded encoder module classes.


28
29
30
# File 'lib/msf/core/module_manager/module_sets.rb', line 28

def encoders
  module_set(Msf::MODULE_ENCODER)
end

#evasionObject


96
97
98
# File 'lib/msf/core/module_manager/module_sets.rb', line 96

def evasion
  module_set(Msf::MODULE_EVASION)
end

#exploitsObject

Returns the set of loaded exploit module classes.


35
36
37
# File 'lib/msf/core/module_manager/module_sets.rb', line 35

def exploits
  module_set(Msf::MODULE_EXPLOIT)
end

#init_module_set(type) ⇒ Object


39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/msf/core/module_manager/module_sets.rb', line 39

def init_module_set(type)
  self.enablement_by_type[type] = true
  case type
    when Msf::MODULE_PAYLOAD
      instance = Msf::PayloadSet.new
    else
      instance = Msf::ModuleSet.new(type)
  end

  self.module_set_by_type[type] = instance

  # Set the module set's framework reference
  instance.framework = self.framework
end

#module_names(set) ⇒ Object

Provide a list of module names of a specific type


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

def module_names(set)
  module_set_by_type[set] ? module_set_by_type[set].keys.dup : []
end

#module_set(type) ⇒ Object

Returns all of the modules of the specified type


64
65
66
# File 'lib/msf/core/module_manager/module_sets.rb', line 64

def module_set(type)
  module_set_by_type[type]
end

#module_typesObject

Provide a list of the types of modules in the set


71
72
73
# File 'lib/msf/core/module_manager/module_sets.rb', line 71

def module_types
  module_set_by_type.keys.dup
end

#nopsObject

Returns the set of loaded nop module classes.


78
79
80
# File 'lib/msf/core/module_manager/module_sets.rb', line 78

def nops
  module_set(Msf::MODULE_NOP)
end

#payloadsObject

Returns the set of loaded payload module classes.


85
86
87
# File 'lib/msf/core/module_manager/module_sets.rb', line 85

def payloads
  module_set(Msf::MODULE_PAYLOAD)
end

#postObject

Returns the set of loaded auxiliary module classes.


92
93
94
# File 'lib/msf/core/module_manager/module_sets.rb', line 92

def post
  module_set(Msf::MODULE_POST)
end

#type_enabled?(type) ⇒ Boolean

Returns:

  • (Boolean)

100
101
102
# File 'lib/msf/core/module_manager/module_sets.rb', line 100

def type_enabled?(type)
  enablement_by_type[type] || false
end