Skip to content

Commit b83853d

Browse files
committed
Land rapid7#8433, Fix proxy_type references to handle nil case
2 parents ec2ce6e + 86aad6b commit b83853d

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/rex/payloads/meterpreter/config.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def transport_block(opts)
8686
proxy_host = ''
8787
if opts[:proxy_host] && opts[:proxy_port]
8888
prefix = 'http://'
89-
prefix = 'socks=' if opts[:proxy_type].downcase == 'socks'
89+
prefix = 'socks=' if opts[:proxy_type].to_s.downcase == 'socks'
9090
proxy_host = "#{prefix}#{opts[:proxy_host]}:#{opts[:proxy_port]}"
9191
end
9292
proxy_host = to_str(proxy_host || '', PROXY_HOST_SIZE)

lib/rex/post/meterpreter/client_core.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -730,7 +730,7 @@ def transport_prepare_request(method, opts={})
730730

731731
if opts[:proxy_host] && opts[:proxy_port]
732732
prefix = 'http://'
733-
prefix = 'socks=' if opts[:proxy_type] == 'socks'
733+
prefix = 'socks=' if opts[:proxy_type].to_s.downcase == 'socks'
734734
proxy = "#{prefix}#{opts[:proxy_host]}:#{opts[:proxy_port]}"
735735
request.add_tlv(TLV_TYPE_TRANS_PROXY_HOST, proxy)
736736

0 commit comments

Comments
 (0)