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`.
bug/bundler_fix
Luke Imhoff 2014-11-03 11:06:49 -06:00
parent 0296d1784d
commit 9ea1240cbb
No known key found for this signature in database
GPG Key ID: 5B1FB01FB33356F8
2 changed files with 5 additions and 6 deletions

View File

@ -19,7 +19,6 @@ describe Msf::EncodedPayload do
let(:payload) {
load_and_create_module(
ancestor_reference_names: ancestor_reference_names,
modules_path: modules_path,
module_type: module_type,
reference_name: reference_name
)

View File

@ -5,7 +5,6 @@
#
# let(:encoder) {
# load_and_create_module(
# modules_path: modules_path,
# module_type: 'encoder',
# reference_name: 'x86/shikata_ga_nai'
# )
@ -20,7 +19,6 @@
# stagers/android/reverse_https
# stages/android/meterpreter
# },
# modules_path: modules_path,
# module_type: 'payload',
# reference_name: 'android/meterpreter/reverse_tcp'
# )
@ -127,10 +125,10 @@ shared_context 'Msf::Simple::Framework#modules loading' do
# @option options [String] :modules_path path to the `modules` directory from which to load
# `:ancestor_reference_names`.
# @option options [String] :module_type the type of module
# @option options [String] :modules_path the 'modules' directory from which to load `:ancestor_reference_names`.
# @option options [String] :modules_path (#modules_path) the 'modules' directory from which to load
# `:ancestor_reference_names`.
# @return [Msf::Module]
# @raise [KeyError] if `:ancestor_reference_names` is not given when `:module_type` is `'payload'`.
# @raise [KeyError] unless :modules_path is given.
# @raise [KeyError] unless :module_type is given.
# @raise [KeyError] unless :reference_name is given.
def load_and_create_module(options={})
@ -143,7 +141,9 @@ shared_context 'Msf::Simple::Framework#modules loading' do
options.except(:modules_path)
)
modules_path = options.fetch(:modules_path)
modules_path = options.fetch(:modules_path) {
self.modules_path
}
expect_to_load_module_ancestors(
ancestor_reference_names: ancestor_reference_names,