Added BeEF::Core::Configuration.clear(). Swaped module 'target_new' back to 'target'.

git-svn-id: https://beef.googlecode.com/svn/trunk@1116 b87d56ec-f9c0-11de-8c8a-61c5e9addfc9
This commit is contained in:
passbe
2011-07-27 00:22:58 +00:00
parent 72ded4afba
commit ebf8694f52
2 changed files with 17 additions and 2 deletions

View File

@@ -78,6 +78,20 @@ module Core
return true
end
#
# Clears the given key hash
#
def clear(key)
subkeys = key.split('.')
return false if subkeys.length == 0
lastkey = subkeys.pop
hash = @config
subkeys.each{|v|
hash = hash[v]
}
return (hash.delete(lastkey) == nil) ? false : true
end
#
# load extensions configurations
#

View File

@@ -90,7 +90,7 @@ module Module
# 4+ = As above but with extra parameters.
# Please note this rating system has no correlation to the return constant value BeEF::Core::Constants::CommandModule::*
def self.support(mod, opts)
target_config = BeEF::Core::Configuration.instance.get('beef.module.'+mod+'.target_new')
target_config = BeEF::Core::Configuration.instance.get('beef.module.'+mod+'.target')
if target_config and opts.kind_of? Hash
if opts.key?('browser')
results = []
@@ -217,7 +217,8 @@ module Module
print_error "Module \"#{mod}\" configuration has invalid target status defined \"#{k}\""
end
}
BeEF::Core::Configuration.instance.set("beef.module.#{mod}.target_new", targets)
BeEF::Core::Configuration.instance.clear("beef.module.#{mod}.target")
BeEF::Core::Configuration.instance.set("beef.module.#{mod}.target", targets)
end
end