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:



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

def enablement_by_type
  @enablement_by_type
end

#module_set_by_typeObject (protected)

:nodoc:



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

def module_set_by_type
  @module_set_by_type
end

Instance Method Details

#auxiliaryObject

Returns the set of loaded auxiliary module classes.



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

def auxiliary
  module_set(Msf::MODULE_AUX)
end

#encodersObject

Returns the set of loaded encoder module classes.



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

def encoders
  module_set(Msf::MODULE_ENCODER)
end

#evasionObject



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

def evasion
  module_set(Msf::MODULE_EVASION)
end

#exploitsObject

Returns the set of loaded exploit module classes.



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

def exploits
  module_set(Msf::MODULE_EXPLOIT)
end

#init_module_set(type) ⇒ Object



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

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



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

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



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

def module_set(type)
  module_set_by_type[type]
end

#module_typesObject

Provide a list of the types of modules in the set



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

def module_types
  module_set_by_type.keys.dup
end

#nopsObject

Returns the set of loaded nop module classes.



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

def nops
  module_set(Msf::MODULE_NOP)
end

#payloadsObject

Returns the set of loaded payload module classes.



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

def payloads
  module_set(Msf::MODULE_PAYLOAD)
end

#postObject

Returns the set of loaded auxiliary module classes.



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

def post
  module_set(Msf::MODULE_POST)
end

#type_enabled?(type) ⇒ Boolean

Returns:

  • (Boolean)


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

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