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