Make target_uri default to "/" in case the TARGETURI option is nil or empty
parent
05eba0ab4c
commit
9a229dfcff
|
@ -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'])
|
||||
|
|
Loading…
Reference in New Issue