Skip to content

Commit cd4aa28

Browse files
committed
Transport priority changes
Pass in the "lhost" and "lport" options to the default transport during the native payload. This takes the following LHOST priorities: 1. OverrideLHOST, only if OverrideRequestHost is TRUE 2. The request Host: header. 3. The LHOST datastore.
1 parent 9d98651 commit cd4aa28

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
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)

0 commit comments

Comments
 (0)