@@ -60,7 +60,11 @@ def check
60
60
end
61
61
62
62
match = /#{ left_marker } (.*)#{ right_marker } / . match ( res . body )
63
-
63
+
64
+ unless match
65
+ fail_with ( Failure ::Unknown , 'Server did not respond in an expected way' )
66
+ end
67
+
64
68
if match [ 1 ] == flag
65
69
return Msf ::Exploit ::CheckCode ::Vulnerable
66
70
end
@@ -87,6 +91,10 @@ def run
87
91
88
92
match = /#{ left_marker } (.*)#{ right_marker } / . match ( res . body )
89
93
94
+ unless match
95
+ fail_with ( Failure ::Unknown , 'Server did not respond in an expected way' )
96
+ end
97
+
90
98
count = match [ 1 ] . to_i
91
99
92
100
dbs = [ ]
@@ -104,7 +112,11 @@ def run
104
112
end
105
113
106
114
match = /#{ left_marker } (.*)#{ right_marker } / . match ( res . body )
107
-
115
+
116
+ unless match
117
+ fail_with ( Failure ::Unknown , 'Server did not respond in an expected way' )
118
+ end
119
+
108
120
dbs << match [ 1 ]
109
121
end
110
122
@@ -129,6 +141,10 @@ def run
129
141
130
142
match = /#{ left_marker } (.*)#{ right_marker } / . match ( res . body )
131
143
144
+ unless match
145
+ fail_with ( Failure ::Unknown , 'Server did not respond in an expected way' )
146
+ end
147
+
132
148
count = match [ 1 ] . to_i
133
149
134
150
0 . upto ( count -1 ) do |cur |
@@ -146,6 +162,11 @@ def run
146
162
end
147
163
148
164
match = /#{ left_marker } (.*)#{ right_marker } / . match ( res . body )
165
+
166
+ unless match
167
+ fail_with ( Failure ::Unknown , 'Server did not respond in an expected way' )
168
+ end
169
+
149
170
user [ col ] = match [ 1 ]
150
171
end
151
172
users << user
@@ -169,8 +190,13 @@ def authenticate
169
190
170
191
cookies = res . get_cookies
171
192
172
- res . body =~ /name="sid" value="(.*?)">/
173
- sid = $1
193
+ match = /name="sid" value="(.*?)">/ . match ( res . body )
194
+
195
+ unless match
196
+ fail_with ( Failure ::Unknown , 'Server did not respond in an expected way' )
197
+ end
198
+
199
+ sid = match [ 1 ]
174
200
175
201
if datastore [ 'REQUIREAUTH' ]
176
202
@@ -208,8 +234,13 @@ def authenticate
208
234
end
209
235
210
236
cookies = res . get_cookies
211
- res . body =~ /name="sid" value="(.*?)">/
212
- sid = $1
237
+ match = /name="sid" value="(.*?)">/ . match ( res . body )
238
+
239
+ unless match
240
+ fail_with ( Failure ::Unknown , 'Server did not respond in an expected way' )
241
+ end
242
+
243
+ sid = match [ 1 ]
213
244
elsif
214
245
fail_with ( Failure ::Unknown , 'Server did not respond in an expected way' )
215
246
end
0 commit comments