Skip to content

Commit ba5035c

Browse files
committed
Prevent calling match when there is no WWW-auth header
1 parent a5d8835 commit ba5035c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

modules/auxiliary/scanner/http/owa_login.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ def get_ad_domain
302302
next
303303
end
304304

305-
if res and res.code == 401 and res['WWW-Authenticate'].match(/^NTLM/i)
305+
if res && res.code == 401 && res.headers.has_key?('WWW-Authenticate') && res.headers['WWW-Authenticate'].match(/^NTLM/i)
306306
hash = res['WWW-Authenticate'].split('NTLM ')[1]
307307
domain = Rex::Proto::NTLM::Message.parse(Rex::Text.decode_base64(hash))[:target_name].value().gsub(/\0/,'')
308308
print_good("Found target domain: " + domain)

0 commit comments

Comments
 (0)