Correct table

bug/bundler_fix
Jon Hart 2015-11-04 09:01:07 -08:00
parent 8f4f187c70
commit 9bcdd19e0a
No known key found for this signature in database
GPG Key ID: 2FA9F0A3AFA8E9D3
1 changed files with 11 additions and 11 deletions

View File

@ -56,17 +56,17 @@ class Metasploit3 < Msf::Auxiliary
def rsync_list
sock.puts("#list\n")
list = []
listing_metadata = []
# the module listing is the module name and comment separated by a tab, each module
# on its own line, lines separated with a newline
sock.get(read_timeout).split(/\n/).map(&:strip).map do |module_line|
next if module_line =~ /^#{RSYNC_HEADER} EXIT$/
name, comment = module_line.split(/\t/).map(&:strip)
next unless name
list << { name: name, comment: comment }
listing_metadata << { name: name, comment: comment }
end
list
listing_metadata
end
# Attempts to negotiate the rsync protocol with the endpoint.
@ -141,21 +141,21 @@ class Metasploit3 < Msf::Auxiliary
)
vprint_good("#{ip}:#{rport} - rsync MOTD: #{motd}") if motd
listing = rsync_list
listing_metadata = rsync_list
disconnect
if listing.empty?
if listing_metadata.empty?
print_status("#{ip}:#{rport} - rsync #{version}: no modules found")
else
print_good("#{ip}:#{rport} - rsync #{version}: #{listing.size} modules found: " \
"#{listing.map(&:first).join(', ')}")
modules = listing_metadata.map { |m| m[:name] }
print_good("#{ip}:#{rport} - rsync #{version}: #{modules.size} modules found: #{modules.join(', ')}")
table_columns = %w(Name Comment)
if datastore['TEST_AUTHENTICATION']
table_columns << 'Authentication?'
listing.each do |listing_metadata|
listing_metadata.each do |module_metadata|
connect
rsync_negotiate(false)
listing_metadata[:authentication?] = rsync_requires_auth?(listing_metadata[:name])
module_metadata[:authentication?] = rsync_requires_auth?(module_metadata[:name])
disconnect
end
end
@ -165,7 +165,7 @@ class Metasploit3 < Msf::Auxiliary
Msf::Ui::Console::Table::Style::Default,
'Header' => "rsync modules for #{ip}:#{rport}",
'Columns' => table_columns,
'Rows' => listing
'Rows' => listing_metadata.map(&:values)
)
vprint_line(listing_table.to_s)
@ -174,7 +174,7 @@ class Metasploit3 < Msf::Auxiliary
proto: 'tcp',
port: rport,
type: 'rsync_modules',
data: { modules: listing },
data: { modules: listing_metadata }
)
end
end