From fcafc54db120d4e6f6c6db2c879346482b8d75be Mon Sep 17 00:00:00 2001 From: Brent Cook Date: Fri, 6 Apr 2018 16:06:51 -0500 Subject: [PATCH] Land #9828, fix reverse HTTP/S listeners for the wildcard address --- lib/msf/core/payload/transport_config.rb | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/lib/msf/core/payload/transport_config.rb b/lib/msf/core/payload/transport_config.rb index cfa665a39c..8b261c02af 100644 --- a/lib/msf/core/payload/transport_config.rb +++ b/lib/msf/core/payload/transport_config.rb @@ -51,9 +51,16 @@ module Msf::Payload::TransportConfig def transport_uri_components(opts={}) ds = opts[:datastore] || datastore - scheme = opts[:scheme] - lhost = ds['LHOST'] - lport = ds['LPORT'] + if opts[:url] + u = URI(opts[:url]) + scheme = u.scheme + lhost = u.host + lport = u.port + else + scheme = opts[:scheme] + lhost = ds['LHOST'] + lport = ds['LPORT'] + end if ds['OverrideRequestHost'] scheme = ds['OverrideScheme'] || scheme lhost = ds['OverrideLHOST'] || lhost