Skip to content

Commit

Permalink
Land #9285, Handle IPv6 addresses in full_uri
Browse files Browse the repository at this point in the history
  • Loading branch information
acammack-r7 committed Dec 7, 2017
2 parents 0a0d24d + 2565ad6 commit 5b5ac87
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/msf/core/exploit/http/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,13 @@ def full_uri(custom_uri = nil)

uri = normalize_uri(custom_uri || target_uri.to_s)

"#{uri_scheme}://#{rhost}#{uri_port}#{uri}"
if Rex::Socket.is_ipv6?(rhost)
uri_host = "[#{rhost}]"
else
uri_host = rhost
end

"#{uri_scheme}://#{uri_host}#{uri_port}#{uri}"
end

#
Expand Down

0 comments on commit 5b5ac87

Please sign in to comment.