From c303859c11086481040737fff1e989786faf166b Mon Sep 17 00:00:00 2001 From: scriptjunkie Date: Fri, 6 Apr 2018 11:06:52 -0500 Subject: [PATCH] Fix #9827 --- 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