Fix issue 673 (command module friendly name in WebSocket fork)

This commit is contained in:
antisnatchor
2012-05-11 11:12:12 +01:00
parent fdad068ee5
commit 256ef0f2e8

View File

@@ -95,9 +95,7 @@ module BeEF
BeEF::Core::Handlers::Commands
#call the handler for websocket cmd response
#@param [Hash] data contains the answer of a command
#@todo ve this stuff in an Handler and resolve the Module friendly name
def execute (data)
command_results=Hash.new
command_results["data"]=Base64.decode64(data["result"])
command_results["data"].force_encoding('UTF-8')
@@ -105,8 +103,8 @@ module BeEF
(print_error "command_id is invalid"; return) if not BeEF::Filters.is_valid_command_id?(data["cid"])
(print_error "command name is empty"; return) if data["handler"].empty?
(print_error "command results are empty"; return) if command_results.empty?
BeEF::Core::Models::Command.save_result(data["bh"], data["cid"], data["handler"], command_results)
BeEF::Core::Models::Command.save_result(data["bh"], data["cid"],
@@config.get("beef.module.#{data["handler"].gsub("/command/","").gsub(".js","")}.name"), command_results)
end