Added post_soft_load timed API call. Corrected BeEF::Module.exist function to use Class specification in configuration

git-svn-id: https://beef.googlecode.com/svn/trunk@1233 b87d56ec-f9c0-11de-8c8a-61c5e9addfc9
This commit is contained in:
passbe
2011-08-23 10:24:48 +00:00
parent 12a7c7f134
commit 211ec00683
4 changed files with 34 additions and 2 deletions

View File

@@ -54,6 +54,7 @@ end
end
require 'core/api/module'
require 'core/api/modules'
require 'core/api/extension'
require 'core/api/extensions'
require 'core/api/main/migration'

30
core/api/modules.rb Normal file
View File

@@ -0,0 +1,30 @@
#
# Copyright 2011 Wade Alcorn wade@bindshell.net
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
module BeEF
module API
module Modules
API_PATHS = {
'post_soft_load' => :post_soft_load
}
def post_soft_load; end
end
end
end

View File

@@ -79,8 +79,8 @@ module Module
config = BeEF::Core::Configuration.instance
if self.is_enabled(mod)
begin
require config.get("beef.module.#{mod}.path")+'/module.rb'
if self.exists?(mod)
require config.get("beef.module.#{mod}.path")+'module.rb'
if self.exists?(config.get("beef.module.#{mod}.class"))
# start server mount point
BeEF::Core::Server.instance.mount("/command/#{mod}.js", false, BeEF::Core::Handlers::Commands, mod)
BeEF::Core::Configuration.instance.set("beef.module.#{mod}.mount", "/command/#{mod}.js")

View File

@@ -47,6 +47,7 @@ module Modules
self.get_enabled.each { |k,v|
BeEF::Module.soft_load(k)
}
BeEF::API.fire(BeEF::API::Modules, 'post_soft_load')
end
end
end