Fix displayed host name for IPv6 targets

This commit is contained in:
HD Moore 2011-12-10 08:17:24 -06:00
parent a9db05e53b
commit 9c887eb457
1 changed files with 3 additions and 0 deletions

View File

@ -78,6 +78,9 @@ module Auxiliary::HttpCrawler
def to_url def to_url
proto = self[:ssl] ? "https" : "http" proto = self[:ssl] ? "https" : "http"
host = self[:vhost] ? self[:vhost] : self[:host] host = self[:vhost] ? self[:vhost] : self[:host]
if Rex::Socket.is_ipv6?(host)
host = "[#{host}]"
end
"#{proto}://#{host}:#{self[:port]}#{self[:path]}" "#{proto}://#{host}:#{self[:port]}#{self[:path]}"
end end
end end