diff --git a/lib/msf/core/transport_config.rb b/lib/msf/core/transport_config.rb index c1996c3ac7..281f9686df 100644 --- a/lib/msf/core/transport_config.rb +++ b/lib/msf/core/transport_config.rb @@ -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 diff --git a/lib/rex/payloads/meterpreter/config.rb b/lib/rex/payloads/meterpreter/config.rb index 4ef973dad4..49292b5331 100644 --- a/lib/rex/payloads/meterpreter/config.rb +++ b/lib/rex/payloads/meterpreter/config.rb @@ -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)