Fix displayed host name for IPv6 targets
This commit is contained in:
parent
a9db05e53b
commit
9c887eb457
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue