Skip to content

Commit 7fdf84a

Browse files
committed
Landing rapid7#1744 - Checks nil before using resp.headers['Server']
[Closes rapid7#1744]
2 parents 7f21239 + 15c6df1 commit 7fdf84a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

modules/auxiliary/scanner/winrm/winrm_auth_methods.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def initialize
3737
def run_host(ip)
3838
resp = winrm_poke
3939
return nil if resp.nil?
40-
if resp.code == 401 and resp.headers['Server'].include? "Microsoft-HTTPAPI"
40+
if resp.code == 401 and resp.headers['Server'] and resp.headers['Server'].include? "Microsoft-HTTPAPI"
4141
methods = parse_auth_methods(resp)
4242
desc = resp.headers['Server'] + " Authentication Methods: " + methods.to_s
4343
report_service(

0 commit comments

Comments
 (0)