Skip to content

Commit 06a5b5b

Browse files
committed
Land rapid7#6234, Host header transport
2 parents d0c9280 + cd4aa28 commit 06a5b5b

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

lib/msf/core/handler/reverse_http.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,9 @@ def on_request(cli, req, obj)
351351
# we don't get new ones generated.
352352
blob = obj.stage_payload(
353353
uuid: uuid,
354-
uri: conn_id
354+
uri: conn_id,
355+
lhost: datastore['OverrideRequestHost'] ? datastore['OverrideLHOST'] : (req && req.headers && req.headers['Host']) ? req.headers['Host'] : datastore['LHOST'],
356+
lport: datastore['OverrideRequestHost'] ? datastore['OverrideLPORT'] : datastore['LPORT']
355357
)
356358

357359
resp.body = encode_stage(blob)

lib/msf/core/payload/transport_config.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ def transport_config_reverse_http(opts={})
5555

5656
{
5757
:scheme => 'http',
58-
:lhost => datastore['LHOST'],
59-
:lport => datastore['LPORT'].to_i,
58+
:lhost => opts[:lhost],
59+
:lport => opts[:lport].to_i,
6060
:uri => uri,
6161
:comm_timeout => datastore['SessionCommunicationTimeout'].to_i,
6262
:retry_total => datastore['SessionRetryTotal'].to_i,

0 commit comments

Comments
 (0)