From 9a229dfcff1e3431f11a00af3f10cc40bd7b4b12 Mon Sep 17 00:00:00 2001 From: sinn3r Date: Sat, 7 Apr 2012 19:43:19 -0500 Subject: [PATCH] Make target_uri default to "/" in case the TARGETURI option is nil or empty --- lib/msf/core/exploit/http/client.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/msf/core/exploit/http/client.rb b/lib/msf/core/exploit/http/client.rb index 16009d39c2..271d670cdb 100644 --- a/lib/msf/core/exploit/http/client.rb +++ b/lib/msf/core/exploit/http/client.rb @@ -524,7 +524,10 @@ module Exploit::Remote::HttpClient # def target_uri begin - URI(datastore['TARGETURI']) + # In case TARGETURI is empty, at least we default to '/' + u = datastore['TARGETURI'] + u = "/" if u.nil? or u.empty? + URI(u) rescue ::URI::InvalidURIError print_error "Invalid URI: #{datastore['TARGETURI'].inspect}" raise Msf::OptionValidateError.new(['TARGETURI'])