From 524739fb85f5066b44dd15ef3cde4c181d81f5cd Mon Sep 17 00:00:00 2001 From: RageLtMan Date: Wed, 29 Aug 2018 20:41:20 -0400 Subject: [PATCH] HTTP Proxy - Fix port extraction & whitespace --- lib/rex/proto/http/proxy.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/rex/proto/http/proxy.rb b/lib/rex/proto/http/proxy.rb index 4fe9e3d4730e1..b497d34c7cb12 100644 --- a/lib/rex/proto/http/proxy.rb +++ b/lib/rex/proto/http/proxy.rb @@ -94,8 +94,8 @@ def initialize(listen_port = 80, listen_host = '0.0.0.0', ssl = false, context = self.ssl_cert = ssl_cert self.proxies = proxies self.rewrite_proxy_headers = rewrite_proxy_headers - self.connect_host = connect_host - self.connect_port = connect_port + self.connect_host = connect_host + self.connect_port = connect_port self.clients = [] self.listener = nil @@ -130,8 +130,8 @@ def start 'LocalHost' => self.listen_host, 'LocalPort' => self.listen_port, 'Context' => self.context, - 'SSL' => self.ssl, - 'SSLCert' => self.ssl_cert, + 'SSL' => self.ssl, + 'SSLCert' => self.ssl_cert, 'Comm' => self.comm ) @@ -243,7 +243,7 @@ def proxy_header_rewrite(request) def normalize_request_target(request) # Extract host port and URI, map as appropriate, account for emtpy - target = request.uri[/\/([\w\d\.]+)/, 1] + target = request.uri[/\/([\w\d\.:]+)/, 1] host,port = target.split(':') targ_uri = request.uri[/\/[\w\d\.]+(\/.*)/,1]