Skip to content

Commit fbe392a

Browse files
author
Wiesław Kielas
committed
Add PostgreSQL TLS support to the Heartbleed scanner
1 parent 284b474 commit fbe392a

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

modules/auxiliary/scanner/ssl/openssl_heartbleed.rb

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@ class Metasploit3 < Msf::Auxiliary
8080
'IMAP' => :tls_imap,
8181
'JABBER' => :tls_jabber,
8282
'POP3' => :tls_pop3,
83-
'FTP' => :tls_ftp
83+
'FTP' => :tls_ftp,
84+
'POSTGRES' => :tls_postgres
8485
}
8586

8687
# See the discussion at https://github.com/rapid7/metasploit-framework/pull/3252
@@ -111,7 +112,8 @@ def initialize
111112
'Sebastiano Di Paola', # Msf module
112113
'Tom Sellers', # Msf module
113114
'jjarmoc', #Msf module; keydump, refactoring..
114-
'Ben Buchanan' #Msf module
115+
'Ben Buchanan', #Msf module
116+
'herself' #Msf module
115117
],
116118
'References' =>
117119
[
@@ -137,7 +139,7 @@ def initialize
137139
register_options(
138140
[
139141
Opt::RPORT(443),
140-
OptEnum.new('TLS_CALLBACK', [true, 'Protocol to use, "None" to use raw TLS sockets', 'None', [ 'None', 'SMTP', 'IMAP', 'JABBER', 'POP3', 'FTP' ]]),
142+
OptEnum.new('TLS_CALLBACK', [true, 'Protocol to use, "None" to use raw TLS sockets', 'None', [ 'None', 'SMTP', 'IMAP', 'JABBER', 'POP3', 'FTP', 'POSTGRES' ]]),
141143
OptEnum.new('TLS_VERSION', [true, 'TLS/SSL version to use', '1.0', ['SSLv3','1.0', '1.1', '1.2']]),
142144
OptInt.new('MAX_KEYTRIES', [true, 'Max tries to dump key', 10]),
143145
OptInt.new('STATUS_EVERY', [true, 'How many retries until status', 5]),
@@ -222,6 +224,17 @@ def tls_imap
222224
sock.get_once(-1, response_timeout)
223225
end
224226

227+
def tls_postgres
228+
# http://www.postgresql.org/docs/9.3/static/protocol-message-formats.html
229+
sock.get_once
230+
sock.put("\x00\x00\x00\x08\x04\xD2\x16\x2F")
231+
res = sock.get_once
232+
unless res && res =~ /S/
233+
return nil
234+
end
235+
res
236+
end
237+
225238
def tls_pop3
226239
# http://tools.ietf.org/html/rfc2595
227240
sock.get_once(-1, response_timeout)

0 commit comments

Comments
 (0)