Skip to content

Commit f6e9b12

Browse files
OJbusterb
authored andcommitted
Make sure stageless is supported
1 parent 656babe commit f6e9b12

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/msf/core/payload/python/meterpreter_loader.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,14 +98,15 @@ def stage_meterpreter(opts={})
9898
# The callback URL can be different to the one that we're receiving from the interface
9999
# so we need to generate it
100100
# TODO: move this to somewhere more common so that it can be used across payload types
101+
uri = "/#{(opts[:uri].to_s == '' ? opts[:url] : opts[:uri].to_s).split('/').reject(&:empty?)[-1]}"
101102
callback_url = [
102103
opts[:url].split(':')[0],
103104
'://',
104105
(ds['OverrideRequestHost'] == true ? ds['OverrideRequestLHOST'] : ds['LHOST']).to_s,
105106
':',
106107
(ds['OverrideRequestHost'] == true ? ds['OverrideRequestLPORT'] : ds['LPORT']).to_s,
107108
ds['LURI'].to_s,
108-
opts[:uri].to_s,
109+
uri,
109110
'/'
110111
].join('')
111112

0 commit comments

Comments
 (0)