diff --git a/lib/rex/post/meterpreter/ui/console/command_dispatcher/core.rb b/lib/rex/post/meterpreter/ui/console/command_dispatcher/core.rb index 4e928d809c..7fba04bb2a 100644 --- a/lib/rex/post/meterpreter/ui/console/command_dispatcher/core.rb +++ b/lib/rex/post/meterpreter/ui/console/command_dispatcher/core.rb @@ -260,6 +260,10 @@ class Console::CommandDispatcher::Core return true end + def cmd_use_tabs(str, words) + return [] + end + # # Reads data from a channel. # @@ -314,6 +318,21 @@ class Console::CommandDispatcher::Core end end + def cmd_run_tabs(str, words) + if(not words[1] or not words[1].match(/^\//)) + begin + my_directory = Msf::Config.script_directory + ::File::SEPARATOR + "meterpreter" + return ::Dir.new(my_directory).find_all { |e| + path = my_directory + ::File::SEPARATOR + e + ::File.file?(path) and ::File.readable?(path) + }.map { |e| + e.sub!(/\.rb$/, '') + } + rescue Exception + end + end + end + # # Writes data to a channel. # @@ -396,6 +415,29 @@ class Console::CommandDispatcher::Core return true end + # + # Provide command-specific tab completion + # Stolen directly from msf/ui/console/command_dispatcher/core.rb + # perhaps this should be moved into rex/ui/text/dispatcher_shell.rb ? + # + def tab_complete_helper(str, words) + items = [] + + # Is the user trying to tab complete one of our commands? + if (commands.include?(words[0])) + if (self.respond_to?('cmd_'+words[0]+'_tabs')) + res = self.send('cmd_'+words[0]+'_tabs', str, words) + return nil if res.nil? + items.concat(res) + else + # Avoid the default completion list for known commands + return nil + end + end + + return items + end + protected attr_accessor :extensions # :nodoc: diff --git a/modules/payloads/singles/php/bind_php.rb b/modules/payloads/singles/php/bind_php.rb index 6b812bc357..03a36366b0 100644 --- a/modules/payloads/singles/php/bind_php.rb +++ b/modules/payloads/singles/php/bind_php.rb @@ -1,5 +1,5 @@ ## -# $Id:$ +# $Id$ ## ## diff --git a/plugins/db_mysql.rb b/plugins/db_mysql.rb index 932058677c..68ca7e2623 100644 --- a/plugins/db_mysql.rb +++ b/plugins/db_mysql.rb @@ -15,9 +15,9 @@ class Plugin::DBMySQL < Msf::Plugin # - # Command dispatcher for configuring Postgres + # Command dispatcher for configuring Mysql # - class PostgresCommandDispatcher + class MysqlCommandDispatcher include Msf::Ui::Console::CommandDispatcher # @@ -207,7 +207,7 @@ class Plugin::DBMySQL < Msf::Plugin def initialize(framework, opts) super - add_console_dispatcher(PostgresCommandDispatcher) + add_console_dispatcher(MysqlCommandDispatcher) end