From 3fe7e3971c9fb51a61bb25eb4c9abe8e861d02dd Mon Sep 17 00:00:00 2001 From: passbe Date: Wed, 27 Apr 2011 02:26:17 +0000 Subject: [PATCH] Altered mounted /command path reference to filename. This will be fixed with dynamic module loading. (Fixes issue 325) git-svn-id: https://beef.googlecode.com/svn/trunk@933 b87d56ec-f9c0-11de-8c8a-61c5e9addfc9 --- core/main/command.rb | 2 +- core/main/server.rb | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/core/main/command.rb b/core/main/command.rb index 7b5a3634f..7d3458950 100644 --- a/core/main/command.rb +++ b/core/main/command.rb @@ -53,7 +53,7 @@ module Core @target = @info['Target'] || nil @output = '' @path = @info['File'].sub(BeEF::Core::Server.instance.root_dir, '') - @default_command_url = '/command/'+(File.basename @path, '.rb')+'.js' + @default_command_url = '/command/'+@path.split(File::SEPARATOR).reverse[1]+'.js' @id = BeEF::Core::Models::CommandModule.first(:path => @info['File']).object_id @use_template = false @auto_update_zombie = false diff --git a/core/main/server.rb b/core/main/server.rb index 216612e9e..f5fb6d388 100644 --- a/core/main/server.rb +++ b/core/main/server.rb @@ -82,8 +82,7 @@ module Core Dir["#{root_dir}/modules/**/*.rb"].each { |command| #command_class = (File.basename command, '.rb').capitalize command_class = command.split('/').reverse[1] - command_file = (File.basename command, '.rb')+'.js' - mount("/command/#{command_file}", false, BeEF::Core::Handlers::Commands, command_class) + mount("/command/#{command_class}.js", false, BeEF::Core::Handlers::Commands, command_class) } #