Hide RPORT more intelligently
parent
e76b53c5d1
commit
b06895b604
|
@ -465,8 +465,15 @@ module Exploit::Remote::HttpClient
|
||||||
# Returns the complete URI as string including the scheme, port and host
|
# Returns the complete URI as string including the scheme, port and host
|
||||||
def full_uri(custom_uri = nil)
|
def full_uri(custom_uri = nil)
|
||||||
uri_scheme = ssl ? 'https' : 'http'
|
uri_scheme = ssl ? 'https' : 'http'
|
||||||
uri_port = rport.to_s == '80' ? '' : ":#{rport}"
|
|
||||||
|
if (rport == 80 && !ssl) || (rport == 443 && ssl)
|
||||||
|
uri_port = ''
|
||||||
|
else
|
||||||
|
uri_port = ":#{rport}"
|
||||||
|
end
|
||||||
|
|
||||||
uri = normalize_uri(custom_uri || target_uri.to_s)
|
uri = normalize_uri(custom_uri || target_uri.to_s)
|
||||||
|
|
||||||
"#{uri_scheme}://#{rhost}#{uri_port}#{uri}"
|
"#{uri_scheme}://#{rhost}#{uri_port}#{uri}"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue