File tree Expand file tree Collapse file tree 1 file changed +18
-4
lines changed Expand file tree Collapse file tree 1 file changed +18
-4
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,8 @@ class ModuleManager
36
36
include Msf ::ModuleManager ::ModuleSets
37
37
include Msf ::ModuleManager ::Reloading
38
38
39
+ include Enumerable
40
+
39
41
#
40
42
# CONSTANTS
41
43
#
@@ -96,10 +98,21 @@ def create(name)
96
98
end
97
99
98
100
99
- # @param framework [Msf::Framework] The framework for which this
100
- # instance is managing the modules.
101
- # @param types [Array<String>] List of module types to load.
102
- # Defaults to all module types in {Msf::MODULE_TYPES}.
101
+ # Iterate over all modules in all sets
102
+ #
103
+ # @yieldparam name [String] The module's reference name
104
+ # @yieldparam mod_class [Msf::Module] A module class
105
+ def each
106
+ module_set_by_type . each do |type , set |
107
+ set . each do |name , mod_class |
108
+ yield name , mod_class
109
+ end
110
+ end
111
+ end
112
+
113
+
114
+ # @param [Msf::Framework] framework The framework for which this instance is managing the modules.
115
+ # @param [Array<String>] types List of module types to load. Defaults to all module types in {Msf::MODULE_TYPES}.
103
116
def initialize ( framework , types = Msf ::MODULE_TYPES )
104
117
#
105
118
# defaults
@@ -158,5 +171,6 @@ def auto_subscribe_module(mod)
158
171
framework . events . add_session_subscriber ( ( inst ) ? inst : ( inst = mod . new ) )
159
172
end
160
173
end
174
+
161
175
end
162
176
end
You can’t perform that action at this time.
0 commit comments