fixing the requester

git-svn-id: https://beef.googlecode.com/svn/trunk@572 b87d56ec-f9c0-11de-8c8a-61c5e9addfc9
This commit is contained in:
mosse.benjamin
2010-11-24 03:35:08 +00:00
parent 0c88d3afbb
commit abac4ed3ab
2 changed files with 21 additions and 1 deletions

View File

@@ -12,7 +12,7 @@ module BeEF
raise 'only GET or POST requests are supported for http requests' if not request.request_method.eql? 'GET' or request.request_method.eql? 'POST'
#check uri
raise 'the uri is missing' if not webrick.unparsed_uri
raise 'the uri is missing' if not request.unparsed_uri
#check host
raise 'http host missing' if request.host.nil?

View File

@@ -39,6 +39,20 @@ module Modules
end
#
# Finds the path to js components
#
def find_beefjs_component_path(component)
component_path = '/'+component
component_path.gsub!(/beef./, '')
component_path.gsub!(/\./, '/')
component_path.replace "#{$root_dir}/modules/beefjs/#{component_path}.js"
return false if not File.exists? component_path
component_path
end
#
# Builds missing beefjs components.
#
@@ -48,6 +62,12 @@ module Modules
# verifies that @beef_js_cmps is not nil to avoid bugs
@beef_js_cmps = '' if @beef_js_cmps.nil?
if beefjs_components.is_a? String
beefjs_components_path = find_beefjs_component_path(beefjs_components)
raise "Invalid component: could not build the beefjs file" if not beefjs_components_path
beefjs_components = {beefjs_components => beefjs_components_path}
end
beefjs_components.keys.each {|k|
next if @beef_js_cmps.include? beefjs_components[k]