Skip to content

Commit 8f65679

Browse files
author
Wiesław Kielas
committed
Heartbleed PostgreSQL TLS support improvements
1 parent fbe392a commit 8f65679

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

modules/auxiliary/scanner/ssl/openssl_heartbleed.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,9 +225,14 @@ def tls_imap
225225
end
226226

227227
def tls_postgres
228+
# postgresql TLS - works with all modern pgsql versions - 8.0 - 9.3
228229
# http://www.postgresql.org/docs/9.3/static/protocol-message-formats.html
229230
sock.get_once
230-
sock.put("\x00\x00\x00\x08\x04\xD2\x16\x2F")
231+
# the postgres SSLRequest packet is a int32(8) followed by a int16(1234),
232+
# int16(5679) in network format
233+
psql_sslrequest = [8].pack('N')
234+
psql_sslrequest << [1234, 5679].pack('n*')
235+
sock.put(psql_sslrequest)
231236
res = sock.get_once
232237
unless res && res =~ /S/
233238
return nil

0 commit comments

Comments
 (0)