From e9ef2092b7bc88a83ff5351ae527a39c2699c670 Mon Sep 17 00:00:00 2001 From: sjanusz-r7 Date: Thu, 4 Jan 2024 11:53:05 +0000 Subject: [PATCH] Add missing tables command to PostgreSQL session --- .../ui/console/command_dispatcher/client.rb | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/lib/rex/post/postgresql/ui/console/command_dispatcher/client.rb b/lib/rex/post/postgresql/ui/console/command_dispatcher/client.rb index 5c7d2e7ad2e89..a06ea9b20f614 100644 --- a/lib/rex/post/postgresql/ui/console/command_dispatcher/client.rb +++ b/lib/rex/post/postgresql/ui/console/command_dispatcher/client.rb @@ -174,13 +174,6 @@ def cmd_query(*args) alias cmd_sql cmd_query alias cmd_sql_help cmd_query_help - def cmd_db_help - print_line 'Usage: db' - print_line - print_line 'View the databases available on the remote target.' - print_line - end - # # Open the Pry debugger on the current session # @@ -229,6 +222,11 @@ def cmd_db_help print_line end + def cmd_tables + tables = self.client.query('SELECT * FROM information_schema.tables;') + print_line format_result(tables).to_s + end + protected def print_no_db_selected