Class: Rex::Post::MSSQL::Ui::Console::CommandDispatcher::Client

Inherits:
Object
  • Object
show all
Includes:
Rex::Post::MSSQL::Ui::Console::CommandDispatcher, Sql::Ui::Console::CommandDispatcher::Client
Defined in:
lib/rex/post/mssql/ui/console/command_dispatcher/client.rb

Overview

Core MSSQL client commands

Instance Attribute Summary

Attributes included from Ui::Text::DispatcherShell::CommandDispatcher

#shell, #tab_complete_items

Instance Method Summary collapse

Methods included from Rex::Post::MSSQL::Ui::Console::CommandDispatcher

#docs_dir

Methods included from Sql::Ui::Console::CommandDispatcher

#client, #filter_commands, #initialize, #msf_loaded?, #session, #unknown_command

Methods included from Msf::Ui::Console::CommandDispatcher::Session

#cmd_background, #cmd_background_help, #cmd_exit, #cmd_irb, #cmd_irb_help, #cmd_irb_tabs, #cmd_pry, #cmd_pry_help, #cmd_resource, #cmd_resource_help, #cmd_resource_tabs, #cmd_sessions, #cmd_sessions_help, #commands

Methods included from Ui::Text::DispatcherShell::CommandDispatcher

#cmd_help, #cmd_help_help, #cmd_help_tabs, #commands, #deprecated_cmd, #deprecated_commands, #deprecated_help, #docs_dir, #help_to_s, included, #initialize, #print, #print_error, #print_good, #print_line, #print_status, #print_warning, #tab_complete_directory, #tab_complete_filenames, #tab_complete_generic, #tab_complete_source_address, #unknown_command, #update_prompt

Methods included from Sql::Ui::Console::CommandDispatcher::Client

#cmd_query, #cmd_query_interactive, #cmd_query_interactive_help, #commands, #format_result, #handle_error, #help_args?, #initialize, #process_query, #query_interactive_help, #run_query

Instance Method Details

#cmd_query_helpObject

Returns:

  • (Object)


24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/rex/post/mssql/ui/console/command_dispatcher/client.rb', line 24

def cmd_query_help
  print_line 'Usage: query'
  print_line
  print_line 'Run a single SQL query on the target.'
  print_line @@query_opts.usage
  print_line 'Examples:'
  print_line
  print_line '    query select @@version;'
  print_line '    query select user_name();'
  print_line '    query select name from master.dbo.sysdatabases;'
  print_line
end

#nameString

Returns:

  • (String)


19
20
21
# File 'lib/rex/post/mssql/ui/console/command_dispatcher/client.rb', line 19

def name
  'MSSQL Client'
end

#normalise_sql_result(result) ⇒ Hash

Returns Hash containing rows, columns and errors.

Parameters:

  • result (Hash)

    The MSSQL query result

Returns:

  • (Hash)

    Hash containing rows, columns and errors.



39
40
41
# File 'lib/rex/post/mssql/ui/console/command_dispatcher/client.rb', line 39

def normalise_sql_result(result)
  { rows: result[:rows], columns: result[:colnames], errors: result[:errors] }
end