Skip to content

Commit a5d8835

Browse files
committed
Abort if 2013 desired but redirect didn't happen
1 parent 7ca4ba2 commit a5d8835

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

modules/auxiliary/scanner/http/owa_login.rb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,11 @@ def try_user_pass(opts)
204204
end
205205

206206
#No password change required moving on.
207-
reason = res.headers['location'].split('reason=')[1]
207+
unless location = res.headers['location']
208+
print_error("#{msg} No HTTP redirect. This is not OWA 2013, aborting.")
209+
return :abort
210+
end
211+
reason = location.split('reason=')[1]
208212
if reason == nil
209213
headers['Cookie'] = 'PBack=0;' << res.get_cookies
210214
else
@@ -220,7 +224,7 @@ def try_user_pass(opts)
220224
if cookies =~ /#{necessary_cookie}=([^;]+)/
221225
cookie_header << "; #{Regexp.last_match(1)}"
222226
else
223-
print_error("#{msg} Missing #{necessary_cookie} cookie. This is not OWA 2010")
227+
print_error("#{msg} Missing #{necessary_cookie} cookie. This is not OWA 2010, aborting")
224228
return :abort
225229
end
226230
end

0 commit comments

Comments
 (0)