Commit eb73a691 authored by David Maloney's avatar David Maloney

replace old rex::ui::text::table refs

everywhere we called the class we have now rewritten it
to use the new namespace

MS-1875
parent 3f530f18
......@@ -46,7 +46,7 @@ class ReadableText
# @param h [String] the string to display as the table heading.
# @return [String] the string form of the table.
def self.dump_exploit_targets(mod, indent = '', h = nil)
tbl = Rex::Ui::Text::Table.new(
tbl = Rex::Text::Table.new(
'Indent' => indent.length,
'Header' => h,
'Columns' =>
......@@ -70,7 +70,7 @@ class ReadableText
# @param h [String] the string to display as the table heading.
# @return [String] the string form of the table.
def self.dump_exploit_target(mod, indent = '', h = nil)
tbl = Rex::Ui::Text::Table.new(
tbl = Rex::Text::Table.new(
'Indent' => indent.length,
'Header' => h,
'Columns' =>
......@@ -92,7 +92,7 @@ class ReadableText
# @param h [String] the string to display as the table heading.
# @return [String] the string form of the table.
def self.dump_module_actions(mod, indent = '', h = nil)
tbl = Rex::Ui::Text::Table.new(
tbl = Rex::Text::Table.new(
'Indent' => indent.length,
'Header' => h,
'Columns' =>
......@@ -116,7 +116,7 @@ class ReadableText
# @param h [String] the string to display as the table heading.
# @return [String] the string form of the table.
def self.dump_module_action(mod, indent = '', h = nil)
tbl = Rex::Ui::Text::Table.new(
tbl = Rex::Text::Table.new(
'Indent' => indent.length,
'Header' => h,
'Columns' =>
......@@ -139,7 +139,7 @@ class ReadableText
# @param h [String] the string to display as the table heading.
# @return [String] the string form of the table.
def self.dump_compatible_payloads(exploit, indent = '', h = nil)
tbl = Rex::Ui::Text::Table.new(
tbl = Rex::Text::Table.new(
'Indent' => indent.length,
'Header' => h,
'Columns' =>
......@@ -390,7 +390,7 @@ class ReadableText
# @param missing [Boolean] dump only empty required options.
# @return [String] the string form of the information.
def self.dump_options(mod, indent = '', missing = false)
tbl = Rex::Ui::Text::Table.new(
tbl = Rex::Text::Table.new(
'Indent' => indent.length,
'Columns' =>
[
......@@ -419,7 +419,7 @@ class ReadableText
# @param indent [String] the indentation to use.
# @return [String] the string form of the information.
def self.dump_advanced_options(mod, indent = '')
tbl = Rex::Ui::Text::Table.new(
tbl = Rex::Text::Table.new(
'Indent' => indent.length,
'Columns' =>
[
......@@ -444,7 +444,7 @@ class ReadableText
# @param indent [String] the indentation to use.
# @return [String] the string form of the information.
def self.dump_evasion_options(mod, indent = '')
tbl = Rex::Ui::Text::Table.new(
tbl = Rex::Text::Table.new(
'Indent' => indent.length,
'Columns' =>
[
......@@ -490,7 +490,7 @@ class ReadableText
# @param col [Integer] the column width.
# @return [String] the formatted DataStore contents.
def self.dump_datastore(name, ds, indent = DefaultIndent, col = DefaultColumnWrap)
tbl = Rex::Ui::Text::Table.new(
tbl = Rex::Text::Table.new(
'Indent' => indent,
'Header' => name,
'Columns' =>
......@@ -529,7 +529,7 @@ class ReadableText
columns << 'Information'
columns << 'Connection'
tbl = Rex::Ui::Text::Table.new(
tbl = Rex::Text::Table.new(
'Indent' => indent,
'Header' => "Active sessions",
'Columns' => columns)
......@@ -653,7 +653,7 @@ class ReadableText
columns += [ "URIPATH", "Start Time", "Handler opts" ]
end
tbl = Rex::Ui::Text::Table.new(
tbl = Rex::Text::Table.new(
'Indent' => indent,
'Header' => "Jobs",
'Columns' => columns
......
......@@ -517,7 +517,7 @@ module Msf
# As an user, you shouldn't be using any of these paths anyway.
columns.delete('Path') if !datastore['VERBOSE']
table = Rex::Ui::Text::Table.new(
table = Rex::Text::Table.new(
'Header' => 'Exploits',
'Indent' => 1,
'Columns' => columns
......@@ -625,7 +625,7 @@ module Msf
# @return [void]
def show_exploit_list(ip, tag, current_exploit_list)
order = 1
table = Rex::Ui::Text::Table.new(
table = Rex::Text::Table.new(
'Header' => '',
'Indent' => 1,
'Columns' => ['Order', 'IP', 'Exploit']
......
......@@ -702,7 +702,7 @@ module Exploit::Remote::MSSQL
if(info[:rows] and not info[:rows].empty?)
tbl = Rex::Ui::Text::Table.new(
tbl = Rex::Text::Table.new(
'Indent' => 1,
'Header' => "",
'Columns' => info[:colnames],
......
......@@ -184,7 +184,7 @@ module Exploit::Remote::Postgres
# If resp is not actually a Connection::Result object, then return
# :error (but not an actual Exception, that's up to the caller.
# Otherwise, create a rowset using Rex::Ui::Text::Table (if there's
# Otherwise, create a rowset using Rex::Text::Table (if there's
# more than 0 rows) and return :complete.
def postgres_print_reply(resp=nil,sql=nil)
ip = datastore['RHOST']
......@@ -194,7 +194,7 @@ module Exploit::Remote::Postgres
if resp.rows and resp.fields
print_status "#{ip}:#{port} Rows Returned: #{resp.rows.size}" if verbose
if resp.rows.size > 0
tbl = Rex::Ui::Text::Table.new(
tbl = Rex::Text::Table.new(
'Indent' => 4,
'Header' => "Query Text: '#{sql}'",
'Columns' => resp.fields.map {|x| x.name}
......
......@@ -164,7 +164,7 @@ module Exploit::Remote::WinRM
rows << row_data
end
columns.uniq!
response_data = Rex::Ui::Text::Table.new(
response_data = Rex::Text::Table.new(
'Header' => "#{datastore['WQL']} (#{rhost})",
'Indent' => 1,
'Columns' => columns
......
......@@ -423,7 +423,7 @@ class Db
end
# If we got here, we're searching. Delete implies search
tbl = Rex::Ui::Text::Table.new(
tbl = Rex::Text::Table.new(
{
'Header' => "Hosts",
'Columns' => col_names,
......@@ -650,7 +650,7 @@ class Db
if col_search
col_names = col_search
end
tbl = Rex::Ui::Text::Table.new({
tbl = Rex::Text::Table.new({
'Header' => "Services",
'Columns' => ['host'] + col_names,
})
......@@ -1029,7 +1029,7 @@ class Db
'Columns' => cred_table_columns
}
tbl = Rex::Ui::Text::Table.new(tbl_opts)
tbl = Rex::Text::Table.new(tbl_opts)
::ActiveRecord::Base.connection_pool.with_connection {
query = Metasploit::Credential::Core.where( workspace_id: framework.db.workspace )
......@@ -1341,7 +1341,7 @@ class Db
end
# Now display them
csv_table = Rex::Ui::Text::Table.new(
csv_table = Rex::Text::Table.new(
'Header' => 'Notes',
'Indent' => 1,
'Columns' => ['Time', 'Host', 'Service', 'Port', 'Protocol', 'Type', 'Data']
......@@ -1501,7 +1501,7 @@ class Db
end
end
tbl = Rex::Ui::Text::Table.new({
tbl = Rex::Text::Table.new({
'Header' => "Loot",
'Columns' => [ 'host', 'service', 'type', 'name', 'content', 'info', 'path' ],
})
......
......@@ -9,7 +9,7 @@ module Console
# Console table display wrapper that allows for stylized tables
#
###
class Table < Rex::Ui::Text::Table
class Table < Rex::Text::Table
#
# Default table styles.
......
......@@ -88,7 +88,7 @@ class GPP
def self.create_tables(results, filetype, domain=nil, dc=nil)
tables = []
results.each do |result|
table = Rex::Ui::Text::Table.new(
table = Rex::Text::Table.new(
'Header' => 'Group Policy Credential Info',
'Indent' => 1,
'SortIndex' => -1,
......
......@@ -146,7 +146,7 @@ class Unattend
def self.create_table(results)
return nil if results.nil? or results.empty?
table = Rex::Ui::Text::Table.new({
table = Rex::Text::Table.new({
'Header' => 'Unattend Credentials',
'Indent' => 1,
'Columns' => ['Type', 'Domain', 'Username', 'Password', 'Groups']
......
......@@ -263,7 +263,7 @@ module Analyze
end
def table(name, cols)
Rex::Ui::Text::Table.new(
Rex::Text::Table.new(
'Header' => name,
'Columns' => cols
)
......
......@@ -379,15 +379,15 @@ end
class ProcessList < Array
#
# Create a Rex::Ui::Text::Table out of the processes stored in this list
# Create a Rex::Text::Table out of the processes stored in this list
#
# +opts+ is passed on to Rex::Ui::Text::Table.new, mostly unmolested
# +opts+ is passed on to Rex::Text::Table.new, mostly unmolested
#
# Note that this output is affected by Rex::Post::Meterpreter::Client#unicode_filter_encode
#
def to_table(opts={})
if empty?
return Rex::Ui::Text::Table.new(opts)
return Rex::Text::Table.new(opts)
end
cols = [ "PID", "PPID", "Name", "Arch", "Session", "User", "Path" ]
......@@ -403,7 +403,7 @@ class ProcessList < Array
'Columns' => cols
}.merge(opts)
tbl = Rex::Ui::Text::Table.new(opts)
tbl = Rex::Text::Table.new(opts)
each { |process|
tbl << cols.map { |c|
col = c.downcase
......
......@@ -111,7 +111,7 @@ class Console::CommandDispatcher::Android
header << " at #{time.strftime('%Y-%m-%d %H:%M:%S')}"
end
table = Rex::Ui::Text::Table.new(
table = Rex::Text::Table.new(
'Header' => header,
'SortIndex' => 0,
'Columns' => result[:headers],
......@@ -616,7 +616,7 @@ class Console::CommandDispatcher::Android
result = client.android.sqlite_query(database, query, writeable)
unless writeable
header = "#{query} on database file #{database}"
table = Rex::Ui::Text::Table.new(
table = Rex::Text::Table.new(
'Header' => header,
'Columns' => result[:columns],
'Indent' => 0
......
......@@ -182,7 +182,7 @@ class Console::CommandDispatcher::Core
case mode
when :list
tbl = Rex::Ui::Text::Table.new(
tbl = Rex::Text::Table.new(
'Indent' => 4,
'Columns' =>
[
......@@ -732,7 +732,7 @@ class Console::CommandDispatcher::Core
end
# next draw up a table of transport entries
tbl = Rex::Ui::Text::Table.new(
tbl = Rex::Text::Table.new(
'SortIndex' => 0, # sort by ID
'Indent' => 4,
'Columns' => columns)
......
......@@ -294,7 +294,7 @@ class Console::CommandDispatcher::Extapi::Adsi
objects = client.extapi.adsi.domain_query(domain, filter, max_results, page_size, args)
table = Rex::Ui::Text::Table.new(
table = Rex::Text::Table.new(
'Header' => "#{domain} Objects",
'Indent' => 0,
'SortIndex' => 0,
......
......@@ -86,7 +86,7 @@ class Console::CommandDispatcher::Extapi::Service
services = client.extapi.service.enumerate
table = Rex::Ui::Text::Table.new(
table = Rex::Text::Table.new(
'Header' => 'Service List',
'Indent' => 0,
'SortIndex' => 3,
......
......@@ -82,7 +82,7 @@ class Console::CommandDispatcher::Extapi::Window
header = parent_window ? "Child windows of #{parent_window}" : "Top-level windows"
table = Rex::Ui::Text::Table.new(
table = Rex::Text::Table.new(
'Header' => header,
'Indent' => 0,
'SortIndex' => 0,
......
......@@ -75,7 +75,7 @@ class Console::CommandDispatcher::Extapi::Wmi
objects = client.extapi.wmi.query(query, root)
if objects
table = Rex::Ui::Text::Table.new(
table = Rex::Text::Table.new(
'Header' => query,
'Indent' => 0,
'SortIndex' => 0,
......
......@@ -259,7 +259,7 @@ class Console::CommandDispatcher::Kiwi
fields = ['Server', 'Client', 'Start', 'End', 'Max Renew', 'Flags']
fields << 'Export Path' if export
table = Rex::Ui::Text::Table.new(
table = Rex::Text::Table.new(
'Header' => 'Kerberos Tickets',
'Indent' => 0,
'SortIndex' => 0,
......@@ -335,7 +335,7 @@ class Console::CommandDispatcher::Kiwi
if results.length > 0
results.each do |r|
table = Rex::Ui::Text::Table.new(
table = Rex::Text::Table.new(
'Header' => "#{r[:desc]} - #{r[:guid]}",
'Indent' => 0,
'SortIndex' => 0,
......@@ -471,7 +471,7 @@ protected
print_status("Retrieving #{provider} credentials")
accounts = method.call
table = Rex::Ui::Text::Table.new(
table = Rex::Text::Table.new(
'Header' => "#{provider} credentials",
'Indent' => 0,
'SortIndex' => 0,
......
......@@ -228,7 +228,7 @@ class Console::CommandDispatcher::Lanattacks::Dhcp
log = client.lanattacks.dhcp.log
table = Rex::Ui::Text::Table.new(
table = Rex::Text::Table.new(
'Header' => 'DHCP Server Log',
'Indent' => 0,
'SortIndex' => 0,
......
......@@ -95,7 +95,7 @@ class Console::CommandDispatcher::Mimikatz
print_status("Retrieving #{provider} credentials")
accounts = method.call
table = Rex::Ui::Text::Table.new(
table = Rex::Text::Table.new(
'Header' => "#{provider} credentials",
'Indent' => 0,
'SortIndex' => 4,
......
......@@ -184,7 +184,7 @@ class Console::CommandDispatcher::Stdapi::Fs
mounts = client.fs.mount.show_mount
table = Rex::Ui::Text::Table.new(
table = Rex::Text::Table.new(
'Header' => 'Mounts / Drives',
'Indent' => 0,
'SortIndex' => 0,
......@@ -482,7 +482,7 @@ class Console::CommandDispatcher::Stdapi::Fs
return
end
tbl = Rex::Ui::Text::Table.new(
tbl = Rex::Text::Table.new(
'Header' => "Listing: #{path}",
'SortIndex' => columns.index(sort),
'SortOrder' => order,
......
......@@ -155,7 +155,7 @@ class Console::CommandDispatcher::Stdapi::Net
end
}
tbl = Rex::Ui::Text::Table.new(
tbl = Rex::Text::Table.new(
'Header' => 'Connection list',
'Indent' => 4,
'Columns' => [
......@@ -206,7 +206,7 @@ class Console::CommandDispatcher::Stdapi::Net
end
}
tbl = Rex::Ui::Text::Table.new(
tbl = Rex::Text::Table.new(
'Header' => 'ARP cache',
'Indent' => 4,
'Columns' => [
......@@ -280,7 +280,7 @@ class Console::CommandDispatcher::Stdapi::Net
routes = client.net.config.routes
# IPv4
tbl = Rex::Ui::Text::Table.new(
tbl = Rex::Text::Table.new(
'Header' => 'IPv4 network routes',
'Indent' => 4,
'Columns' => [
......@@ -304,7 +304,7 @@ class Console::CommandDispatcher::Stdapi::Net
end
# IPv6
tbl = Rex::Ui::Text::Table.new(
tbl = Rex::Text::Table.new(
'Header' => 'IPv6 network routes',
'Indent' => 4,
'Columns' => [
......@@ -412,7 +412,7 @@ class Console::CommandDispatcher::Stdapi::Net
case args.shift
when 'list'
table = Rex::Ui::Text::Table.new(
table = Rex::Text::Table.new(
'Header' => 'Active Port Forwards',
'Indent' => 3,
'SortIndex' => -1,
......@@ -616,7 +616,7 @@ class Console::CommandDispatcher::Stdapi::Net
response = client.net.resolve.resolve_hosts(hostnames, family)
table = Rex::Ui::Text::Table.new(
table = Rex::Text::Table.new(
'Header' => 'Host resolutions',
'Indent' => 4,
'SortIndex' => 0,
......
......@@ -297,7 +297,7 @@ class Console::CommandDispatcher::Stdapi::Sys
if vars.length == 0
print_error("None of the specified environment variables were found/set.")
else
table = Rex::Ui::Text::Table.new(
table = Rex::Text::Table.new(
'Header' => 'Environment Variables',
'Indent' => 0,
'SortIndex' => 1,
......
......@@ -187,7 +187,7 @@ class Console::CommandDispatcher::Stdapi::Ui
desktops = client.ui.enum_desktops
desktopstable = Rex::Ui::Text::Table.new(
desktopstable = Rex::Text::Table.new(
'Header' => "Desktops",
'Indent' => 4,
'Columns' => [ "Session",
......
......@@ -25,7 +25,7 @@ class RopBase
@gadgets = gadgets
end
table = Rex::Ui::Text::Table.new(
table = Rex::Text::Table.new(
'Header' => "#{@file} ROP Gadgets",
'Indent' => 1,
'Columns' =>
......
......@@ -161,7 +161,7 @@ class Result
unless supports_ssl?
return "Server does not appear to support SSL on this port!"
end
table = Rex::Ui::Text::Table.new(
table = Rex::Text::Table.new(
'Header' => 'SSL Ciphers',
'Indent' => 1,
'Columns' => ['Status', 'Weak', 'SSL Version', 'Key Length', 'Cipher'],
......
......@@ -80,7 +80,7 @@ Windows and Linux.
end
if res && res.code == 200 && !res.body.empty?
cred_table = Rex::Ui::Text::Table.new(
cred_table = Rex::Text::Table.new(
'Header' => 'WebNMS Login Credentials',
'Indent' => 1,
'Columns' =>
......
......@@ -97,7 +97,7 @@ class MetasploitModule < Msf::Auxiliary
end
# Create table for report
windows_domain_login_table = Rex::Ui::Text::Table.new(
windows_domain_login_table = Rex::Text::Table.new(
'Header' => 'Windows Domain Accounts',
'Ident' => 1,
'Columns' => ['name']
......
......@@ -84,7 +84,7 @@ class MetasploitModule < Msf::Auxiliary
print_good("#{domain_users.length} user accounts, groups, and computer accounts were found.")
# Create table for report
windows_domain_login_table = Rex::Ui::Text::Table.new(
windows_domain_login_table = Rex::Text::Table.new(
'Header' => 'Windows Domain Accounts',
'Ident' => 1,
'Columns' => ['name']
......
......@@ -356,7 +356,7 @@ class MetasploitModule < Msf::Auxiliary
end
# CREATE TABLE TO STORE SQL SERVER DATA LOOT
sql_data_tbl = Rex::Ui::Text::Table.new(
sql_data_tbl = Rex::Text::Table.new(
'Header' => 'SQL Server Data',
'Indent' => 1,
'Columns' => ['Server', 'Database', 'Schema', 'Table', 'Column', 'Data Type', 'Sample Data', 'Row Count']
......
......@@ -151,7 +151,7 @@ class MetasploitModule < Msf::Auxiliary
print_good("#{@users.length} users found!")
end
users_table = Rex::Ui::Text::Table.new(
users_table = Rex::Text::Table.new(
'Header' => 'Advantech WebAccess Users',
'Indent' => 1,
'Columns' => ['Username', 'Encrypted Password', 'Key', 'Recovered password', 'Origin']
......
......@@ -150,7 +150,7 @@ class MetasploitModule < Msf::Auxiliary
end
def grab
logins = Rex::Ui::Text::Table.new(
logins = Rex::Text::Table.new(
'Header' => "Schneider Modicon Quantum services, usernames, and passwords",
'Indent' => 1,
'Columns' => ["Service", "User Name", "Password"]
......
......@@ -66,7 +66,7 @@ class MetasploitModule < Msf::Auxiliary
print_status("Listing \\\\#{datastore['RHOST']}\\#{datastore['SMBSHARE']}\\#{datastore['RPATH']}'...")
end
listing = self.simple.client.find_first("\\#{datastore['RPATH']}\\*")
directory = Rex::Ui::Text::Table.new(
directory = Rex::Text::Table.new(
'Header' => "Directory Listing of \\\\#{datastore['RHOST']}\\#{datastore['SMBSHARE']}\\#{datastore['RPATH']}",
'Indent' => 2,
'SortIndex' => 2,
......
......@@ -32,7 +32,7 @@ class MetasploitModule < Msf::Auxiliary
return unless res && res.code == 200
waps = Rex::Ui::Text::Table.new(
waps = Rex::Text::Table.new(
'Header' => 'Wireless Access Points',
'Columns' => [
'BSSID',
......
......@@ -222,7 +222,7 @@ class MetasploitModule < Msf::Auxiliary
headerlen = makeword(f.read(2))
f.seek(userentryptr + 40) # sorry decimal
entrylen = makeword(f.read(2)) # sorry this is decimal
logins = Rex::Ui::Text::Table.new(
logins = Rex::Text::Table.new(
'Header' => "D20 usernames, passwords, and account levels\n(use for TELNET authentication)",
'Indent' => 1,
'Columns' => ["Type", "User Name", "Password"])
......
......@@ -192,7 +192,7 @@ class MetasploitModule < Msf::Auxiliary
print_warning("No credentials collected.")
return
end
cred_table = Rex::Ui::Text::Table.new(
cred_table = Rex::Text::Table.new(
'Header' => 'Dolibarr User Credentials',
'Indent' => 1,
'Columns' => ['Username', 'Password', 'Admin', 'E-mail']
......
......@@ -98,7 +98,7 @@ class MetasploitModule < Msf::Auxiliary
return
end
cred_table = Rex::Ui::Text::Table.new(
cred_table = Rex::Text::Table.new(
'Header' => 'Network Shutdown Module Credentials',
'Indent' => 1,
'Columns' => ['Username', 'Password']
......
......@@ -90,7 +90,7 @@ class MetasploitModule < Msf::Auxiliary
end
end
cred_table = Rex::Ui::Text::Table.new(
cred_table = Rex::Text::Table.new(
'Header' => 'ManageEngine EventLog Analyzer Managed Devices Credentials',
'Indent' => 1,
'Columns' =>
......
......@@ -142,7 +142,7 @@ class MetasploitModule < Msf::Auxiliary
return
end
cred_table = Rex::Ui::Text::Table.new(
cred_table = Rex::Text::Table.new(
'Header' => 'Domain Controllers Credentials',
'Indent' => 1,
'Columns' => ['Domain Controller', 'Username', 'Password']
......
......@@ -134,7 +134,7 @@ class MetasploitModule < Msf::Auxiliary
return if keys.size == 0
data = data_for_keys(keys)
result_table = Rex::Ui::Text::Table.new(
result_table = Rex::Text::Table.new(
'Header' => "Keys/Values Found for #{peer}",
'Indent' => 1,
'Columns' => [ 'Key', 'Value' ]
......
......@@ -144,7 +144,7 @@ class MetasploitModule < Msf::Auxiliary
end