From 23399326c2e5414b974a39004abacbe28d773fe6 Mon Sep 17 00:00:00 2001 From: HD Moore Date: Thu, 30 Jun 2016 12:56:29 -0500 Subject: [PATCH 1/2] Fix up double slashes, tweak syntax --- lib/msf/core/handler/reverse_http.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/msf/core/handler/reverse_http.rb b/lib/msf/core/handler/reverse_http.rb index 0c9e368d04..7e836a7091 100644 --- a/lib/msf/core/handler/reverse_http.rb +++ b/lib/msf/core/handler/reverse_http.rb @@ -142,12 +142,12 @@ module ReverseHttp if l && l.length > 0 # strip trailing slashes - while l[-1] == '/' + while l[-1,1] == '/' l = l[0...-1] end # make sure the luri has the prefix - if l[0] != '/' + if l[0,1] != '/' l = "/#{l}" end @@ -192,7 +192,7 @@ module ReverseHttp self.service.server_name = datastore['MeterpreterServerName'] # Add the new resource - service.add_resource(luri + "/", + service.add_resource( (luri + "/").gsub("//", "/"), 'Proc' => Proc.new { |cli, req| on_request(cli, req) }, @@ -212,7 +212,7 @@ module ReverseHttp # def stop_handler if self.service - self.service.remove_resource(luri + "/") + self.service.remove_resource((luri + "/").gsub("//", "/")) if self.service.resources.empty? && self.sessions == 0 Rex::ServiceManager.stop_service(self.service) end From 85dfec0cf5bfd22d882b0abc161674b82738cb55 Mon Sep 17 00:00:00 2001 From: Brent Cook Date: Tue, 5 Jul 2016 01:20:54 -0500 Subject: [PATCH 2/2] minor whitespace --- lib/msf/core/handler/reverse_http.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/msf/core/handler/reverse_http.rb b/lib/msf/core/handler/reverse_http.rb index 7e836a7091..a37a42574b 100644 --- a/lib/msf/core/handler/reverse_http.rb +++ b/lib/msf/core/handler/reverse_http.rb @@ -142,12 +142,12 @@ module ReverseHttp if l && l.length > 0 # strip trailing slashes - while l[-1,1] == '/' + while l[-1, 1] == '/' l = l[0...-1] end # make sure the luri has the prefix - if l[0,1] != '/' + if l[0, 1] != '/' l = "/#{l}" end @@ -192,7 +192,7 @@ module ReverseHttp self.service.server_name = datastore['MeterpreterServerName'] # Add the new resource - service.add_resource( (luri + "/").gsub("//", "/"), + service.add_resource((luri + "/").gsub("//", "/"), 'Proc' => Proc.new { |cli, req| on_request(cli, req) },