Enable word wrapped rex tables by default

This commit is contained in:
Alan Foster 2021-01-28 10:24:01 +00:00
parent 7b7f1a2637
commit f3ce9082b6
No known key found for this signature in database
GPG Key ID: 3BD4FA3818818F04
5 changed files with 29 additions and 15 deletions

View File

@ -16,9 +16,9 @@ module Msf
WRAPPED_TABLES = 'wrapped_tables'
DEFAULTS = [
{
name: 'wrapped_tables',
name: WRAPPED_TABLES,
description: 'When enabled Metasploit will wordwrap all tables to fit into the available terminal width',
default_value: false
default_value: true
}.freeze,
{
name: 'RHOST_HTTP_URL',
@ -32,6 +32,14 @@ module Msf
#
def initialize
@flag_lookup = DEFAULTS.each_with_object({}) do |feature, acc|
if feature[:name] == WRAPPED_TABLES
if feature[:default_value] == true
Rex::Text::Table.wrap_tables!
else
Rex::Text::Table.unwrap_tables!
end
end
key = feature[:name]
acc[key] = feature.dup
end

View File

@ -432,6 +432,9 @@ class Creds
svcs.flatten!
tbl_opts = {
'Header' => "Credentials",
# For now, don't perform any word wrapping on the cred table as it breaks the workflow of
# copying credentials and pasting them into applications
'Width' => ::BigDecimal::INFINITY,
'Columns' => cred_table_columns,
'SearchTerm' => search_term
}

View File

@ -1301,6 +1301,9 @@ module Msf
'Prefix' => "\n",
'Postfix' => "\n",
'SearchTerm' => row_filter,
# For now, don't perform any word wrapping on the search table as it breaks the workflow of
# copying module names in conjunction with the `use <paste-buffer>` command
'Width' => ::BigDecimal::INFINITY,
'Columns' => [
'#',
'Name',