2016-01-05 05:14:40 +00:00
|
|
|
##
|
|
|
|
# This module requires Metasploit: http://metasploit.com/download
|
|
|
|
# Current source: https://github.com/rapid7/metasploit-framework
|
|
|
|
##
|
|
|
|
|
|
|
|
require 'msf/core'
|
|
|
|
|
|
|
|
class Metasploit3 < Msf::Auxiliary
|
|
|
|
include Msf::Auxiliary::Redis
|
|
|
|
include Msf::Auxiliary::Report
|
|
|
|
include Msf::Auxiliary::Scanner
|
|
|
|
|
|
|
|
def initialize(info = {})
|
|
|
|
super(update_info(info,
|
|
|
|
'Name' => 'Redis-server Scanner',
|
|
|
|
'Description' => %q{
|
|
|
|
This module scans for Redis server. By default Redis has no auth. If auth
|
|
|
|
(password only) is used, it is then possible to execute a brute force attack on
|
|
|
|
the server. This scanner will find open or password protected Redis servers and
|
|
|
|
report back the server information
|
|
|
|
},
|
|
|
|
'Author' => [ 'iallison <ian[at]team-allison.com>', 'Nixawk' ],
|
|
|
|
'License' => MSF_LICENSE))
|
|
|
|
|
2016-01-05 16:54:54 +00:00
|
|
|
register_options([Opt::RPORT(6379)])
|
2016-01-05 05:14:40 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def run_host(_ip)
|
2016-01-05 16:54:53 +00:00
|
|
|
vprint_status("Scanning IP: #{peer}")
|
2016-01-05 05:14:40 +00:00
|
|
|
begin
|
|
|
|
connect
|
|
|
|
data = redis_command('PING')
|
2016-01-05 16:33:21 +00:00
|
|
|
report_service(host: rhost, port: rport, name: "redis server", info: data)
|
2016-01-05 16:54:53 +00:00
|
|
|
print_good("#{peer} -- found redis")
|
2016-01-05 16:54:22 +00:00
|
|
|
rescue Rex::AddressInUse, Rex::HostUnreachable, Rex::ConnectionTimeout,
|
|
|
|
Rex::ConnectionRefused, ::Timeout::Error, ::EOFError, ::Errno::ETIMEDOUT => e
|
2016-01-05 17:51:23 +00:00
|
|
|
vprint_error("Unable to connect: #{peer} - #{e}")
|
2016-01-05 16:54:54 +00:00
|
|
|
ensure
|
2016-01-05 05:14:40 +00:00
|
|
|
disconnect
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|