File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -142,12 +142,12 @@ def luri
142
142
143
143
if l && l . length > 0
144
144
# strip trailing slashes
145
- while l [ -1 ] == '/'
145
+ while l [ -1 , 1 ] == '/'
146
146
l = l [ 0 ...-1 ]
147
147
end
148
148
149
149
# make sure the luri has the prefix
150
- if l [ 0 ] != '/'
150
+ if l [ 0 , 1 ] != '/'
151
151
l = "/#{ l } "
152
152
end
153
153
@@ -192,7 +192,7 @@ def setup_handler
192
192
self . service . server_name = datastore [ 'MeterpreterServerName' ]
193
193
194
194
# Add the new resource
195
- service . add_resource ( luri + "/" ,
195
+ service . add_resource ( ( luri + "/" ) . gsub ( "//" , "/" ) ,
196
196
'Proc' => Proc . new { |cli , req |
197
197
on_request ( cli , req )
198
198
} ,
@@ -212,7 +212,7 @@ def setup_handler
212
212
#
213
213
def stop_handler
214
214
if self . service
215
- self . service . remove_resource ( luri + "/" )
215
+ self . service . remove_resource ( ( luri + "/" ) . gsub ( "//" , "/" ) )
216
216
if self . service . resources . empty? && self . sessions == 0
217
217
Rex ::ServiceManager . stop_service ( self . service )
218
218
end
You can’t perform that action at this time.
0 commit comments