Completely fixed issue with Dynamic module loading (MSF). Now MSF exploits can be launched again with no errors.
git-svn-id: https://beef.googlecode.com/svn/trunk@920 b87d56ec-f9c0-11de-8c8a-61c5e9addfc9
This commit is contained in:
@@ -20,10 +20,14 @@ module Modules
|
||||
raise WEBrick::HTTPStatus::BadRequest, "command_module is nil" if command_module.nil?
|
||||
raise WEBrick::HTTPStatus::BadRequest, "command_module.path is nil" if command_module.path.nil?
|
||||
|
||||
#klass = File.basename command_module.path, '.rb'
|
||||
klass = command_module.path.split('/').reverse[1]
|
||||
if(command_module.path.match(/^Dynamic/))
|
||||
klass = command_module.path.split('/').last
|
||||
command_module = BeEF::Modules::Commands.const_get(klass.capitalize).new
|
||||
else
|
||||
klass = command_module.path.split('/').reverse[1]
|
||||
command_module = BeEF::Core::Command.const_get(klass.capitalize).new
|
||||
end
|
||||
|
||||
command_module = BeEF::Core::Command.const_get(klass.capitalize).new
|
||||
command_module.command_id = command.id
|
||||
command_module.session_id = hooked_browser.session
|
||||
command_module.build_datastore(command.data)
|
||||
|
||||
@@ -191,13 +191,14 @@ class Modules < BeEF::Extension::AdminUI::HttpController
|
||||
if(command_module_db_details.path.match(/^Dynamic/))
|
||||
command_module_name = command_module_db_details.path.split('/').last
|
||||
print_debug ("Loading Dynamic command module [#{command_module_name.capitalize.to_s}]")
|
||||
command_module = BeEF::Modules::Commands.const_get(command_module_name.capitalize).new
|
||||
else
|
||||
command_module_name = command_module_db_details.path.split('/').reverse[1]
|
||||
print_debug ("Loading command module [#{command_module_name.capitalize.to_s}]")
|
||||
command_module = BeEF::Core::Command.const_get(command_module_name.capitalize).new
|
||||
end
|
||||
|
||||
command_module = BeEF::Core::Command.const_get(command_module_name.capitalize).new
|
||||
command_module.session_id = hook_session_id
|
||||
command_module.session_id = hook_session_id
|
||||
command_module.update_info(command_module_db_details.id) if(command_module_db_details.path.match(/^Dynamic/))
|
||||
|
||||
|
||||
@@ -447,7 +448,7 @@ class Modules < BeEF::Extension::AdminUI::HttpController
|
||||
|
||||
# the path will equal Dynamic/<type> and this will get just the type
|
||||
dynamic_type = mod.path.split("/").last
|
||||
e = BeEF::Core::Command.const_get(dynamic_type.capitalize).new
|
||||
e = BeEF::Modules::Commands.const_get(dynamic_type.capitalize).new
|
||||
e.update_info(command_module_id)
|
||||
e.update_data()
|
||||
ret = e.launch_exploit(definition)
|
||||
@@ -558,7 +559,7 @@ class Modules < BeEF::Extension::AdminUI::HttpController
|
||||
# the path will equal Dynamic/<type> and this will get just the type
|
||||
dynamic_type = mod.path.split("/").last
|
||||
|
||||
e = BeEF::Core::Command.const_get(dynamic_type.capitalize).new
|
||||
e = BeEF::Modules::Commands.const_get(dynamic_type.capitalize).new
|
||||
e.update_info(mod.id)
|
||||
e.update_data()
|
||||
command_modules_json[1] = JSON.parse(e.to_json)
|
||||
@@ -579,7 +580,7 @@ class Modules < BeEF::Extension::AdminUI::HttpController
|
||||
dynamic_type = dynamic_command_module.path.split("/").last
|
||||
|
||||
# get payload options in JSON
|
||||
e = BeEF::Core::Command.const_get(dynamic_type.capitalize).new
|
||||
e = BeEF::Modules::Commands.const_get(dynamic_type.capitalize).new
|
||||
payload_options_json = []
|
||||
payload_options_json[1] = e.get_payload_options(payload_name)
|
||||
raise WEBrick::HTTPStatus::BadRequest, "Payload JSON generation error" if payload_options_json.empty?
|
||||
|
||||
Reference in New Issue
Block a user