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
This commit is contained in:
passbe
2011-04-27 02:26:17 +00:00
parent e8046ac355
commit 3fe7e3971c
2 changed files with 2 additions and 3 deletions

View File

@@ -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

View File

@@ -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)
}
#