Skip to content

Commit 9ea1240

Browse files
committed
Default modules_path
MSP-11130 Default `:modules_path` to use the `#modules_path` left for 'Msf::Simple::Framework#modules#loading''s `#load_and_create_module`.
1 parent 0296d17 commit 9ea1240

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

spec/lib/msf/core/encoded_payload_spec.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
let(:payload) {
2020
load_and_create_module(
2121
ancestor_reference_names: ancestor_reference_names,
22-
modules_path: modules_path,
2322
module_type: module_type,
2423
reference_name: reference_name
2524
)

spec/support/shared/contexts/msf/simple/framework/modules/loading.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
#
66
# let(:encoder) {
77
# load_and_create_module(
8-
# modules_path: modules_path,
98
# module_type: 'encoder',
109
# reference_name: 'x86/shikata_ga_nai'
1110
# )
@@ -20,7 +19,6 @@
2019
# stagers/android/reverse_https
2120
# stages/android/meterpreter
2221
# },
23-
# modules_path: modules_path,
2422
# module_type: 'payload',
2523
# reference_name: 'android/meterpreter/reverse_tcp'
2624
# )
@@ -127,10 +125,10 @@ def expect_to_load_module_ancestors(options={})
127125
# @option options [String] :modules_path path to the `modules` directory from which to load
128126
# `:ancestor_reference_names`.
129127
# @option options [String] :module_type the type of module
130-
# @option options [String] :modules_path the 'modules' directory from which to load `:ancestor_reference_names`.
128+
# @option options [String] :modules_path (#modules_path) the 'modules' directory from which to load
129+
# `:ancestor_reference_names`.
131130
# @return [Msf::Module]
132131
# @raise [KeyError] if `:ancestor_reference_names` is not given when `:module_type` is `'payload'`.
133-
# @raise [KeyError] unless :modules_path is given.
134132
# @raise [KeyError] unless :module_type is given.
135133
# @raise [KeyError] unless :reference_name is given.
136134
def load_and_create_module(options={})
@@ -143,7 +141,9 @@ def load_and_create_module(options={})
143141
options.except(:modules_path)
144142
)
145143

146-
modules_path = options.fetch(:modules_path)
144+
modules_path = options.fetch(:modules_path) {
145+
self.modules_path
146+
}
147147

148148
expect_to_load_module_ancestors(
149149
ancestor_reference_names: ancestor_reference_names,

0 commit comments

Comments
 (0)