File tree Expand file tree Collapse file tree 1 file changed +22
-1
lines changed
modules/auxiliary/scanner/ssl Expand file tree Collapse file tree 1 file changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -83,6 +83,9 @@ class Metasploit3 < Msf::Auxiliary
83
83
'FTP' => :tls_ftp
84
84
}
85
85
86
+ # See the discussion at https://github.com/rapid7/metasploit-framework/pull/3252
87
+ SAFE_CHECK_MAX_RECORD_LENGTH = ( 1 << 14 )
88
+
86
89
def initialize
87
90
super (
88
91
'Name' => 'OpenSSL Heartbeat (Heartbleed) Information Leak' ,
@@ -148,6 +151,16 @@ def initialize
148
151
149
152
end
150
153
154
+ def check_host ( ip )
155
+ @check_only = true
156
+ vprint_status "#{ peer } - Checking for Heartbleed exposure"
157
+ if bleed
158
+ Exploit ::CheckCode ::Appears
159
+ else
160
+ Exploit ::CheckCode ::Safe
161
+ end
162
+ end
163
+
151
164
def run
152
165
if heartbeat_length > 65535 || heartbeat_length < 0
153
166
print_error ( "HEARTBEAT_LENGTH should be a natural number less than 65536" )
@@ -157,8 +170,16 @@ def run
157
170
super
158
171
end
159
172
173
+ # If this is merely a check, set to the RFC-defined
174
+ # maximum padding length of 2^14. See:
175
+ # https://tools.ietf.org/html/rfc6520#section-4
176
+ # https://github.com/rapid7/metasploit-framework/pull/3252
160
177
def heartbeat_length
161
- datastore [ "HEARTBEAT_LENGTH" ]
178
+ if @check_only
179
+ SAFE_CHECK_MAX_RECORD_LENGTH
180
+ else
181
+ datastore [ "HEARTBEAT_LENGTH" ]
182
+ end
162
183
end
163
184
164
185
def peer
You can’t perform that action at this time.
0 commit comments