From 1bc37a2ed1adf6d339df8f70a66bff180bc562bd Mon Sep 17 00:00:00 2001 From: antisnatchor Date: Thu, 5 May 2011 14:50:51 +0000 Subject: [PATCH] Issue 335: fixed another issue with Dynamic command modules when selecting the command results git-svn-id: https://beef.googlecode.com/svn/trunk@956 b87d56ec-f9c0-11de-8c8a-61c5e9addfc9 --- .../admin_ui/controllers/modules/modules.rb | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/extensions/admin_ui/controllers/modules/modules.rb b/extensions/admin_ui/controllers/modules/modules.rb index 80743b640..3730e9bb7 100644 --- a/extensions/admin_ui/controllers/modules/modules.rb +++ b/extensions/admin_ui/controllers/modules/modules.rb @@ -534,16 +534,19 @@ class Modules < BeEF::Extension::AdminUI::HttpController raise WEBrick::HTTPStatus::BadRequest, "Command is nil" if command.nil? command_module = BeEF::Core::Models::CommandModule.get(command.command_module_id) - if(command_module.path.split('/').first.match(/^Dynamic/)) - command_module = command_module.path.split('/').last - end raise WEBrick::HTTPStatus::BadRequest, "command_module is nil" if command_module.nil? - - e = BeEF::Core::Command.const_get(command_module.name.capitalize).new + + if(command_module.path.split('/').first.match(/^Dynamic/)) + dyn_mod_name = command_module.path.split('/').last + e = BeEF::Modules::Commands.const_get(dyn_mod_name.capitalize).new + else + command_module_name = command_module.name + e = BeEF::Core::Command.const_get(command_module_name.capitalize).new + end @body = { 'success' => 'true', - 'command_module_name' => command_module.name, + 'command_module_name' => command_module_name, 'command_module_id' => command_module.id, 'data' => JSON.parse(command.data), 'definition' => JSON.parse(e.to_json)