ensure that module counts are reflected accurately, and add option to specify a module path to msfconsole, fixes #25
git-svn-id: file:///home/svn/framework3/trunk@4462 4d416f70-5f16-0410-b530-b9f4589650daunstable
parent
3a8b138e74
commit
58708378d1
|
@ -610,7 +610,17 @@ class ModuleManager < ModuleSet
|
|||
# We only do this if the caller wanted us to check the cache in the
|
||||
# first place. By default, check_cache will be true. One scenario
|
||||
# where it will be false is from the loadpath command in msfconsole.
|
||||
save_module_cache if (!using_cache and check_cache)
|
||||
if !using_cache and check_cache
|
||||
save_module_cache
|
||||
# If we're by default using the cache and we were told not to
|
||||
# invalidate/use it, then we should update the cached counts to include
|
||||
# what we've just added so that the banner will reflect the changes
|
||||
# correctly.
|
||||
elsif using_cache and !check_cache
|
||||
cached_counts.each_key { |k|
|
||||
cached_counts[k] += counts[k] if counts[k]
|
||||
}
|
||||
end
|
||||
|
||||
return counts
|
||||
end
|
||||
|
|
|
@ -87,6 +87,9 @@ class Driver < Msf::Ui::Driver
|
|||
# Re-enable output
|
||||
self.disable_output = false
|
||||
|
||||
# Load additional modules as necessary
|
||||
self.framework.modules.add_module_path(opts['ModulePath'], false) if opts['ModulePath']
|
||||
|
||||
# Process things before we actually display the prompt and get rocking
|
||||
on_startup
|
||||
|
||||
|
|
|
@ -43,6 +43,10 @@ class OptsConsole
|
|||
options['Config'] = c
|
||||
end
|
||||
|
||||
opts.on("-m", "-m <directory>", "Specifies an additional module search path") do |m|
|
||||
options['ModulePath'] = m
|
||||
end
|
||||
|
||||
# Boolean switch.
|
||||
opts.on("-v", "--version", "Show version") do |v|
|
||||
options['Version'] = true
|
||||
|
|
Loading…
Reference in New Issue