Skip to content

Commit b06895b

Browse files
committed
Hide RPORT more intelligently
1 parent e76b53c commit b06895b

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

lib/msf/core/exploit/http/client.rb

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -465,8 +465,15 @@ def target_uri
465465
# Returns the complete URI as string including the scheme, port and host
466466
def full_uri(custom_uri = nil)
467467
uri_scheme = ssl ? 'https' : 'http'
468-
uri_port = rport.to_s == '80' ? '' : ":#{rport}"
468+
469+
if (rport == 80 && !ssl) || (rport == 443 && ssl)
470+
uri_port = ''
471+
else
472+
uri_port = ":#{rport}"
473+
end
474+
469475
uri = normalize_uri(custom_uri || target_uri.to_s)
476+
470477
"#{uri_scheme}://#{rhost}#{uri_port}#{uri}"
471478
end
472479

0 commit comments

Comments
 (0)