Code review comments
This commit is contained in:
parent
f761743f0f
commit
a47e4d42b5
|
@ -247,7 +247,11 @@ module Metasploit
|
|||
cli.connect
|
||||
req = cli.request_cgi(opts)
|
||||
# Authenticate by default
|
||||
res = opts['authenticate'].nil? || opts['authenticate'] ? cli.send_recv(req) : cli._send_recv(req)
|
||||
res = if opts['authenticate'].nil? || opts['authenticate']
|
||||
cli.send_recv(req)
|
||||
else
|
||||
cli._send_recv(req)
|
||||
end
|
||||
rescue ::EOFError, Errno::ETIMEDOUT ,Errno::ECONNRESET, Rex::ConnectionError, OpenSSL::SSL::SSLError, ::Timeout::Error => e
|
||||
raise Rex::ConnectionError, e.message
|
||||
ensure
|
||||
|
|
|
@ -51,9 +51,7 @@ module Metasploit
|
|||
|
||||
# send an HTTP request that WinRM would consider as valid (SOAP XML in the message matching the XML schema definition)
|
||||
def send_request(opts)
|
||||
opts['authenticate'] = false
|
||||
allowed_auth_methods = parse_auth_methods(super(opts))
|
||||
opts['authenticate'] = true
|
||||
allowed_auth_methods = parse_auth_methods(super(opts.merge({ 'authenticate' => true })))
|
||||
|
||||
if allowed_auth_methods.include? 'Negotiate'
|
||||
opts['preferred_auth'] = 'Negotiate'
|
||||
|
|
Loading…
Reference in New Issue