Skip to content

Commit 67c46fc

Browse files
committed
Merge branch 'WinRM_piecemeal' of git://github.com/dmaloney-r7/metasploit-framework into dmaloney-r7-WinRM_piecemeal
2 parents f71f830 + e19f2d2 commit 67c46fc

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

lib/msf/core/exploit/winrm.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def winrm_poke(timeout = 20)
4949
'method' => 'POST',
5050
'ctype' => ctype,
5151
'data' => opts['data']
52-
}))
52+
}), to)
5353
return resp
5454
end
5555

modules/auxiliary/scanner/winrm/winrm_auth_methods.rb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ def initialize
4141

4242
def run_host(ip)
4343
resp = winrm_poke
44-
if resp.code == 401 and resp.headers['Server'].include? "Microsoft-HTTPAPI"
44+
return nil if resp.nil?
45+
if resp.code == 401 and resp.headers['Server'].include? "Microsoft-HTTPAPI"
4546
methods = parse_auth_methods(resp)
4647
desc = resp.headers['Server'] + " Authentication Methods: " + methods.to_s
4748
report_service(
@@ -53,8 +54,8 @@ def run_host(ip)
5354
)
5455
print_good "Negotiate protocol supported" if methods.include? "Negotiate"
5556
print_good "Kerberos protocol supported" if methods.include? "Kerberos"
56-
print_good "Basic protocol supported" if methods.include? "Basic"
57-
else
57+
print_good "Basic protocol supported" if methods.include? "Basic"
58+
else
5859
print_error "#{ip}:#{rport} Does not appear to be a WinRM server"
5960
end
6061
end

0 commit comments

Comments
 (0)