class MetasploitModule < Msf::Auxiliary
include Msf::Auxiliary::Report
include Msf::Exploit::Capture
include Msf::Auxiliary::UDPScanner
def initialize
super(
'Name' => 'Memcached UDP Version Scanner',
'Description' => %q(
This module can be used to discover Memcached servers which expose the
unrestricted UDP port 11211. A basic "version" request is executed to obtain
the version of memcached.
),
'Author' =>
[
'Jon Hart <[email protected]>'
],
'License' => MSF_LICENSE,
'DisclosureDate' => 'Jul 23 2003',
'References' =>
[
['URL', 'https://github.com/memcached/memcached/blob/master/doc/protocol.txt']
]
)
register_options(
[
Opt::RPORT(11211)
]
)
end
def build_probe
@memcached_probe ||= [
rand(2**16),
0,
1,
0,
"version\r\n"
].pack("nnnna*")
end
def scanner_process(data, shost, sport)
if /VERSION (?<version>[\d\.]+)\r\n/ =~ data
print_good("#{shost}:#{sport}/udp memcached version #{version}")
report_service(
host: shost,
proto: 'udp',
port: rport,
info: version,
name: 'memcached'
)
end
end
end