Have the the load command also look at the ~/.msf4/plugins folder
parent
34666ef6f7
commit
5acc0c62d2
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue