From 0321000ea72e33b0b29d352c441b9028261b4760 Mon Sep 17 00:00:00 2001 From: William Vu Date: Thu, 29 Dec 2016 18:20:25 -0600 Subject: [PATCH] Update Http mixin for opts[:ssl] 1. Add opts[:ssl] 2. Remove opts[:busybox] 3. Refactor logic 4. Remove resource_uri --- lib/msf/core/exploit/cmdstager/http.rb | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/lib/msf/core/exploit/cmdstager/http.rb b/lib/msf/core/exploit/cmdstager/http.rb index 9fbc1c0938..3135193235 100644 --- a/lib/msf/core/exploit/cmdstager/http.rb +++ b/lib/msf/core/exploit/cmdstager/http.rb @@ -15,28 +15,17 @@ module Http end def start_service(opts = {}) - if opts[:busybox] && (ssl = datastore['SSL']) - datastore['SSL'] = false - end + datastore_ssl = datastore['SSL'] + datastore['SSL'] = !!opts[:ssl] super - payload_uri = get_uri - if ssl - datastore['SSL'] = true - end + payload_uri = get_uri + datastore['SSL'] = datastore_ssl payload_uri end - def resource_uri - if (datastore['URIPATH'] || '').end_with?(?/) - random_uri - else - super - end - end - def on_request_uri(cli, request) if request['User-Agent'] =~ /^(?:Wget|curl)/ send_response(cli, exe)