Skip to content

Commit 2565ad6

Browse files
committed
Handle IPv6 addresses in full_uri (add brackets)
1 parent 0a0d24d commit 2565ad6

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,13 @@ def full_uri(custom_uri = nil)
474474

475475
uri = normalize_uri(custom_uri || target_uri.to_s)
476476

477-
"#{uri_scheme}://#{rhost}#{uri_port}#{uri}"
477+
if Rex::Socket.is_ipv6?(rhost)
478+
uri_host = "[#{rhost}]"
479+
else
480+
uri_host = rhost
481+
end
482+
483+
"#{uri_scheme}://#{uri_host}#{uri_port}#{uri}"
478484
end
479485

480486
#

0 commit comments

Comments
 (0)