Skip to content

Commit

Permalink
replace old rex::ui::text::table refs
Browse files Browse the repository at this point in the history
everywhere we called the class we have now rewritten it
to use the new namespace

MS-1875
  • Loading branch information
David Maloney authored and David Maloney committed Aug 10, 2016
1 parent 3f530f1 commit eb73a69
Show file tree
Hide file tree
Showing 140 changed files with 248 additions and 248 deletions.
22 changes: 11 additions & 11 deletions lib/msf/base/serializer/readable_text.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def self.dump_module(mod, indent = " ")
# @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' =>
Expand All @@ -70,7 +70,7 @@ def self.dump_exploit_targets(mod, indent = '', h = nil)
# @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' =>
Expand All @@ -92,7 +92,7 @@ def self.dump_exploit_target(mod, indent = '', h = nil)
# @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' =>
Expand All @@ -116,7 +116,7 @@ def self.dump_module_actions(mod, indent = '', h = nil)
# @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' =>
Expand All @@ -139,7 +139,7 @@ def self.dump_module_action(mod, indent = '', h = nil)
# @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' =>
Expand Down Expand Up @@ -390,7 +390,7 @@ def self.dump_generic_module(mod, indent = '')
# @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' =>
[
Expand Down Expand Up @@ -419,7 +419,7 @@ def self.dump_options(mod, indent = '', missing = false)
# @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' =>
[
Expand All @@ -444,7 +444,7 @@ def self.dump_advanced_options(mod, indent = '')
# @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' =>
[
Expand Down Expand Up @@ -490,7 +490,7 @@ def self.dump_references(mod, indent = '')
# @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' =>
Expand Down Expand Up @@ -529,7 +529,7 @@ def self.dump_sessions(framework, opts={})
columns << 'Information'
columns << 'Connection'

tbl = Rex::Ui::Text::Table.new(
tbl = Rex::Text::Table.new(
'Indent' => indent,
'Header' => "Active sessions",
'Columns' => columns)
Expand Down Expand Up @@ -653,7 +653,7 @@ def self.dump_jobs(framework, verbose = false, indent = DefaultIndent, col = Def
columns += [ "URIPATH", "Start Time", "Handler opts" ]
end

tbl = Rex::Ui::Text::Table.new(
tbl = Rex::Text::Table.new(
'Indent' => indent,
'Header' => "Jobs",
'Columns' => columns
Expand Down
4 changes: 2 additions & 2 deletions lib/msf/core/exploit/browser_autopwn2.rb
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ def show_ready_exploits
# 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
Expand Down Expand Up @@ -625,7 +625,7 @@ def log_click(ip, data='')
# @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']
Expand Down
2 changes: 1 addition & 1 deletion lib/msf/core/exploit/mssql.rb
Original file line number Diff line number Diff line change
Expand Up @@ -702,7 +702,7 @@ def mssql_print_reply(info)

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],
Expand Down
4 changes: 2 additions & 2 deletions lib/msf/core/exploit/postgres.rb
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ def postgres_query(sql=nil,doprint=false)

# 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']
Expand All @@ -194,7 +194,7 @@ def postgres_print_reply(resp=nil,sql=nil)
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}
Expand Down
2 changes: 1 addition & 1 deletion lib/msf/core/exploit/winrm.rb
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ def parse_wql_response(response)
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
Expand Down
10 changes: 5 additions & 5 deletions lib/msf/ui/console/command_dispatcher/db.rb
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ def cmd_hosts(*args)
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,
Expand Down Expand Up @@ -650,7 +650,7 @@ def cmd_services(*args)
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,
})
Expand Down Expand Up @@ -1029,7 +1029,7 @@ def creds_search(*args)
'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 )
Expand Down Expand Up @@ -1341,7 +1341,7 @@ def cmd_notes(*args)
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']
Expand Down Expand Up @@ -1501,7 +1501,7 @@ def cmd_loot(*args)
end
end

tbl = Rex::Ui::Text::Table.new({
tbl = Rex::Text::Table.new({
'Header' => "Loot",
'Columns' => [ 'host', 'service', 'type', 'name', 'content', 'info', 'path' ],
})
Expand Down
2 changes: 1 addition & 1 deletion lib/msf/ui/console/table.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion lib/rex/parser/group_policy_preferences.rb
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def self.parse(data)
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,
Expand Down
2 changes: 1 addition & 1 deletion lib/rex/parser/unattend.rb
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ def self.extract_useraccounts(user_accounts)

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']
Expand Down
2 changes: 1 addition & 1 deletion lib/rex/pescan/analyze.rb
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ def scan(param)
end

def table(name, cols)
Rex::Ui::Text::Table.new(
Rex::Text::Table.new(
'Header' => name,
'Columns' => cols
)
Expand Down
8 changes: 4 additions & 4 deletions lib/rex/post/meterpreter/extensions/stdapi/sys/process.rb
Original file line number Diff line number Diff line change
Expand Up @@ -379,15 +379,15 @@ def get_info
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" ]
Expand All @@ -403,7 +403,7 @@ def to_table(opts={})
'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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def cmd_interval_collect(*args)
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],
Expand Down Expand Up @@ -616,7 +616,7 @@ def cmd_sqlite_query(*args)
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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ def cmd_channel(*args)

case mode
when :list
tbl = Rex::Ui::Text::Table.new(
tbl = Rex::Text::Table.new(
'Indent' => 4,
'Columns' =>
[
Expand Down Expand Up @@ -732,7 +732,7 @@ def cmd_transport(*args)
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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ def cmd_adsi_domain_query(*args)

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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def cmd_service_enum(*args)

services = client.extapi.service.enumerate

table = Rex::Ui::Text::Table.new(
table = Rex::Text::Table.new(
'Header' => 'Service List',
'Indent' => 0,
'SortIndex' => 3,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def cmd_window_enum(*args)

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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def cmd_wmi_query(*args)
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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ def cmd_kerberos_ticket_list(*args)
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,
Expand Down Expand Up @@ -335,7 +335,7 @@ def cmd_wifi_list(*args)

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,
Expand Down Expand Up @@ -471,7 +471,7 @@ def scrape_passwords(provider, method, args)
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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ def cmd_dhcp_log(*args)

log = client.lanattacks.dhcp.log

table = Rex::Ui::Text::Table.new(
table = Rex::Text::Table.new(
'Header' => 'DHCP Server Log',
'Indent' => 0,
'SortIndex' => 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def mimikatz_request(provider, method)
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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ def cmd_show_mount(*args)

mounts = client.fs.mount.show_mount

table = Rex::Ui::Text::Table.new(
table = Rex::Text::Table.new(
'Header' => 'Mounts / Drives',
'Indent' => 0,
'SortIndex' => 0,
Expand Down Expand Up @@ -482,7 +482,7 @@ def list_path(path, columns, sort, order, short, recursive = false, depth = 0, s
return
end

tbl = Rex::Ui::Text::Table.new(
tbl = Rex::Text::Table.new(
'Header' => "Listing: #{path}",
'SortIndex' => columns.index(sort),
'SortOrder' => order,
Expand Down
Loading

0 comments on commit eb73a69

Please sign in to comment.