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:
@@ -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
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
#
|
||||
|
||||
Reference in New Issue
Block a user