List all (listable) modules from a rsync daemon

bug/bundler_fix
ikkini 2014-07-24 23:26:41 +02:00
parent f12b97e8c0
commit ccb26637e7
1 changed files with 7 additions and 6 deletions

View File

@ -14,8 +14,8 @@ class Metasploit3 < Msf::Auxiliary
def initialize def initialize
super( super(
'Name' => 'Rsync Unauthenticated List Command', 'Name' => 'Rsync Unauthenticated List Command',
'Description' => 'List rsync available modules', 'Description' => 'List all (listable) modules from a rsync daemon',
'Author' => 'avuko', 'Author' => 'ikkini',
'License' => MSF_LICENSE 'License' => MSF_LICENSE
) )
register_options( register_options(
@ -36,16 +36,17 @@ class Metasploit3 < Msf::Auxiliary
connect() connect()
version = sock.recv(1024) version = sock.recv(1024)
# making sure we match the version of the server # making sure we match the version of the server
sock.puts("#{version}" ) sock.puts("#{version}")
# the listing command
sock.puts("\n") sock.puts("\n")
listing = sock.get() listing = sock.get()
# not interested in EXIT message # not interested in EXIT message
listing = listing.to_s.gsub('@RSYNCD: EXIT', '') listing = listing.to_s.gsub('@RSYNCD: EXIT', '')
disconnect() disconnect()
listing_santized = Rex::Text.to_hex_ascii(listing.to_s.strip) listing_sanitized = Rex::Text.to_hex_ascii(listing.to_s.strip)
print_status("#{ip}:#{rport} #{version.rstrip.to_s} #{listing_santized}") print_status("#{ip}:#{rport} #{version.rstrip} #{listing_sanitized}")
report_service(:host => rhost, :port => rport, :name => "rsync", :info => listing_santized) report_service(:host => rhost, :port => rport, :name => 'rsync', :info => listing_sanitized)
end end
rescue ::Rex::ConnectionError rescue ::Rex::ConnectionError
rescue Timeout::Error rescue Timeout::Error