Handle IPv6 properly (host header parsing)
This commit is contained in:
parent
8ccb68c9df
commit
cd4d7d3c47
|
@ -162,14 +162,20 @@ class Metasploit3 < Msf::Auxiliary
|
|||
os_name ||= 'Unknown'
|
||||
|
||||
mysrc = Rex::Socket.source_address(cli.peerhost)
|
||||
hhead = (req['Host'] || @myhost).split(':', 2)[0]
|
||||
hhead = (req['Host'] || @myhost)
|
||||
|
||||
if (req.resource =~ /^http\:\/+([^\/]+)(\/*.*)/)
|
||||
if req.resource =~ /^http\:\/+([^\/]+)(\/*.*)/
|
||||
hhead = $1
|
||||
req.resource = $2
|
||||
hhead, nport = $1.split(":", 2)[0]
|
||||
@myport = nport || 80
|
||||
end
|
||||
|
||||
if hhead =~ /^(.*):(\d+)\s*$/
|
||||
hhead = $1
|
||||
nport = $2.to_i
|
||||
end
|
||||
|
||||
@myport = nport || 80
|
||||
|
||||
|
||||
cookies = req['Cookie'] || ''
|
||||
|
||||
|
|
Loading…
Reference in New Issue