From 15c6df1482fc3b193f9bc443242c49374b967c21 Mon Sep 17 00:00:00 2001 From: RageLtMan Date: Thu, 18 Apr 2013 00:32:37 -0400 Subject: [PATCH] Check for nil before calling on value --- modules/auxiliary/scanner/winrm/winrm_auth_methods.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/auxiliary/scanner/winrm/winrm_auth_methods.rb b/modules/auxiliary/scanner/winrm/winrm_auth_methods.rb index 7075db1147..9e7c7d9288 100644 --- a/modules/auxiliary/scanner/winrm/winrm_auth_methods.rb +++ b/modules/auxiliary/scanner/winrm/winrm_auth_methods.rb @@ -37,7 +37,7 @@ class Metasploit3 < Msf::Auxiliary def run_host(ip) resp = winrm_poke return nil if resp.nil? - if resp.code == 401 and resp.headers['Server'].include? "Microsoft-HTTPAPI" + if resp.code == 401 and resp.headers['Server'] and resp.headers['Server'].include? "Microsoft-HTTPAPI" methods = parse_auth_methods(resp) desc = resp.headers['Server'] + " Authentication Methods: " + methods.to_s report_service(