Have the the load command also look at the ~/.msf4/plugins folder

unstable
Carlos Perez 2012-01-29 15:03:18 -04:00
parent 34666ef6f7
commit 5acc0c62d2
1 changed files with 20 additions and 10 deletions

View File

@ -973,17 +973,27 @@ class Core
# Tab completion for the load command
#
def cmd_load_tabs(str, words)
return [] if words.length > 1
begin
return Dir.new(Msf::Config.plugin_directory).find_all { |e|
path = Msf::Config.plugin_directory + File::SEPARATOR + e
File.file?(path) and File.readable?(path)
}.map { |e|
e.sub!(/\.rb$/, '')
}
rescue Exception
tabs = []
if (not words[1] or not words[1].match(/^\//))
# then let's start tab completion in the scripts/resource directories
begin
[
Msf::Config.user_plugin_directory,
Msf::Config.plugin_directory
].each do |dir|
next if not ::File.exist? dir
tabs += ::Dir.new(dir).find_all { |e|
path = dir + File::SEPARATOR + e
::File.file?(path) and File.readable?(path)
}
end
rescue Exception
end
else
tabs += tab_complete_filenames(str,words)
end
return tabs.map{|e| e.sub(/.rb/, '')}
end
def cmd_route_help