Skip to content

Commit 5fb268b

Browse files
author
Tod Beardsley
committed
Updates to better OWA fix
1 parent 714fd0b commit 5fb268b

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

modules/auxiliary/scanner/http/owa_login.rb

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ def try_user_pass(opts)
221221
cookies = res.get_cookies
222222
cookie_header = 'PBack=0'
223223
%w(sessionid cadata).each do |necessary_cookie|
224-
if cookies =~ /#{necessary_cookie}=([^;]+)/
224+
if cookies =~ /#{necessary_cookie}=([^;]*)/
225225
cookie_header << "; #{Regexp.last_match(1)}"
226226
else
227227
print_error("#{msg} Missing #{necessary_cookie} cookie. This is not OWA 2010, aborting")
@@ -247,11 +247,6 @@ def try_user_pass(opts)
247247
return :abort
248248
end
249249

250-
if res.redirect?
251-
vprint_error("#{msg} FAILED LOGIN. '#{user}' : '#{pass}' (response was a #{res.code} redirect)")
252-
return :skip_pass
253-
end
254-
255250
if res.body =~ login_check
256251
print_good("#{msg} SUCCESSFUL LOGIN. '#{user}' : '#{pass}'")
257252

@@ -266,6 +261,12 @@ def try_user_pass(opts)
266261

267262
report_auth_info(report_hash)
268263
return :next_user
264+
265+
if res.redirect?
266+
vprint_error("#{msg} FAILED LOGIN. '#{user}' : '#{pass}' (response was a #{res.code} redirect)")
267+
return :skip_pass
268+
end
269+
269270
else
270271
vprint_error("#{msg} FAILED LOGIN. '#{user}' : '#{pass}' (response body did not match)")
271272
return :skip_pass

0 commit comments

Comments
 (0)