Fix proxy config not making it through

bug/bundler_fix
OJ 2015-05-11 17:24:02 +10:00
parent 79753f719f
commit 29649ff881
2 changed files with 13 additions and 3 deletions

View File

@ -59,7 +59,12 @@ module Msf::TransportConfig
:uri => uri,
:comm_timeout => datastore['SessionCommunicationTimeout'].to_i,
:retry_total => datastore['SessionRetryTotal'].to_i,
:retry_wait => datastore['SessionRetryWait'].to_i
:retry_wait => datastore['SessionRetryWait'].to_i,
:proxy_host => datastore['PayloadProxyHost'],
:proxy_port => datastore['PayloadProxyPort'],
:proxy_type => datastore['PayloadProxyType'],
:proxy_user => datastore['PayloadProxyUser'],
:proxy_pass => datastore['PayloadProxyPass']
}
end

View File

@ -88,7 +88,13 @@ private
]
if url.start_with?('http')
proxy_host = to_str(opts[:proxy_host] || '', PROXY_HOST_SIZE)
proxy_host = ''
if opts[:proxy_host] && opts[:proxy_port]
prefix = 'http://'
prefix = 'socks=' if opts[:proxy_type].downcase == 'socks'
proxy_host = "#{prefix}#{opts[:proxy_host]}:#{opts[:proxy_port]}"
end
proxy_host = to_str(proxy_host || '', PROXY_HOST_SIZE)
proxy_user = to_str(opts[:proxy_user] || '', PROXY_USER_SIZE)
proxy_pass = to_str(opts[:proxy_pass] || '', PROXY_PASS_SIZE)
ua = to_str(opts[:ua] || '', UA_SIZE)
@ -120,7 +126,6 @@ private
end
def config_block
# start with the session information
config = session_block(@opts)