Handle ipv6 addresses, choose more obvious 'bad' password for

fingerprinting
unstable
HD Moore 2012-01-31 00:32:54 -06:00
parent 25fbe1c7d0
commit 32f2d6754c
1 changed files with 6 additions and 1 deletions

View File

@ -52,6 +52,11 @@ module Exploit::Remote::Postgres
ip = args[:server] || datastore['RHOST']
port = args[:port] || datastore['RPORT']
uri = "tcp://#{ip}:#{port}"
if Rex::Socket.is_ipv6?(ip)
uri = "tcp://[#{ip}]:#{port}"
end
verbose = args[:verbose] || datastore['VERBOSE']
begin
self.postgres_conn = Connection.new(db,username,password,uri)
@ -234,7 +239,7 @@ module Exploit::Remote::Postgres
if datastore['PASSWORD'].to_s.size > 0
datastore['PASSWORD'].to_s
else
Rex::Text.rand_text_english(rand(6)+2)
'INVALID_' + Rex::Text.rand_text_alpha(rand(6))
end
end