OpenSSL Server-Side ChangeCipherSpec Injection Scanner - Metasploit


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

Module Overview


Name: OpenSSL Server-Side ChangeCipherSpec Injection Scanner
Module: auxiliary/scanner/ssl/openssl_ccs
Source code: modules/auxiliary/scanner/ssl/openssl_ccs.rb
Disclosure date: 2014-06-05
Last modification time: 2017-07-24 06:26:21 +0000
Supported architecture(s): -
Supported platform(s): -
Target service / protocol: -
Target network port(s): 443
List of CVEs: CVE-2014-0224

This module checks for the OpenSSL ChangeCipherSpec (CCS) Injection vulnerability. The problem exists in the handling of early CCS messages during session negotiation. Vulnerable installations of OpenSSL accepts them, while later implementations do not. If successful, an attacker can leverage this vulnerability to perform a man-in-the-middle (MITM) attack by downgrading the cipher spec between a client and server. This issue was first reported in early June, 2014.

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


This module is a scanner module, and is capable of testing against multiple hosts.

msf > use auxiliary/scanner/ssl/openssl_ccs
msf auxiliary(openssl_ccs) > show options
    ... show and set options ...
msf auxiliary(openssl_ccs) > set RHOSTS ip-range
msf auxiliary(openssl_ccs) > exploit

Other examples of setting the RHOSTS option:

Example 1:

msf auxiliary(openssl_ccs) > set RHOSTS 192.168.1.3-192.168.1.200 

Example 2:

msf auxiliary(openssl_ccs) > set RHOSTS 192.168.1.1/24

Example 3:

msf auxiliary(openssl_ccs) > set RHOSTS file:/tmp/ip_list.txt

Required Options


  • RHOSTS: The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>'

Go back to menu.

Msfconsole Usage


Here is how the scanner/ssl/openssl_ccs auxiliary module looks in the msfconsole:

msf6 > use auxiliary/scanner/ssl/openssl_ccs

msf6 auxiliary(scanner/ssl/openssl_ccs) > show info

       Name: OpenSSL Server-Side ChangeCipherSpec Injection Scanner
     Module: auxiliary/scanner/ssl/openssl_ccs
    License: Metasploit Framework License (BSD)
       Rank: Normal
  Disclosed: 2014-06-05

Provided by:
  Masashi Kikuchi
  Craig Young <[email protected]>
  juan vazquez <[email protected]>

Check supported:
  No

Basic options:
  Name              Current Setting  Required  Description
  ----              ---------------  --------  -----------
  RESPONSE_TIMEOUT  10               yes       Number of seconds to wait for a server response
  RHOSTS                             yes       The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>'
  RPORT             443              yes       The target port (TCP)
  THREADS           1                yes       The number of concurrent threads (max one per host)
  TLS_VERSION       1.0              yes       TLS/SSL version to use (Accepted: SSLv3, 1.0, 1.1, 1.2)

Description:
  This module checks for the OpenSSL ChangeCipherSpec (CCS) Injection 
  vulnerability. The problem exists in the handling of early CCS 
  messages during session negotiation. Vulnerable installations of 
  OpenSSL accepts them, while later implementations do not. If 
  successful, an attacker can leverage this vulnerability to perform a 
  man-in-the-middle (MITM) attack by downgrading the cipher spec 
  between a client and server. This issue was first reported in early 
  June, 2014.

References:
  https://nvd.nist.gov/vuln/detail/CVE-2014-0224
  http://ccsinjection.lepidum.co.jp/
  http://ccsinjection.lepidum.co.jp/blog/2014-06-05/CCS-Injection-en/index.html
  http://www.tripwire.com/state-of-security/incident-detection/detection-script-for-cve-2014-0224-openssl-cipher-change-spec-injection/
  https://www.imperialviolet.org/2014/06/05/earlyccs.html

Module Options


This is a complete list of options available in the scanner/ssl/openssl_ccs auxiliary module:

msf6 auxiliary(scanner/ssl/openssl_ccs) > show options

Module options (auxiliary/scanner/ssl/openssl_ccs):

   Name              Current Setting  Required  Description
   ----              ---------------  --------  -----------
   RESPONSE_TIMEOUT  10               yes       Number of seconds to wait for a server response
   RHOSTS                             yes       The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>'
   RPORT             443              yes       The target port (TCP)
   THREADS           1                yes       The number of concurrent threads (max one per host)
   TLS_VERSION       1.0              yes       TLS/SSL version to use (Accepted: SSLv3, 1.0, 1.1, 1.2)

Advanced Options


Here is a complete list of advanced options supported by the scanner/ssl/openssl_ccs auxiliary module:

msf6 auxiliary(scanner/ssl/openssl_ccs) > show advanced

Module advanced options (auxiliary/scanner/ssl/openssl_ccs):

   Name                 Current Setting  Required  Description
   ----                 ---------------  --------  -----------
   CHOST                                 no        The local client address
   CPORT                                 no        The local client port
   ConnectTimeout       10               yes       Maximum number of seconds to establish a TCP connection
   Proxies                               no        A proxy chain of format type:host:port[,type:host:port][...]
   SSL                  false            no        Negotiate SSL/TLS for outgoing connections
   SSLCipher                             no        String for SSL cipher - "DHE-RSA-AES256-SHA" or "ADH"
   SSLVerifyMode        PEER             no        SSL verification method (Accepted: CLIENT_ONCE, FAIL_IF_NO_PEER_CERT, NONE, PEER)
   SSLVersion           Auto             yes       Specify the version of SSL/TLS to be used (Auto, TLS and SSL23 are auto-negotiate) (Accepted: Auto, TLS, SSL23, SSL3, TLS1, TLS1.1, TLS1.2)
   ShowProgress         true             yes       Display progress messages during a scan
   ShowProgressPercent  10               yes       The interval in percent that progress should be shown
   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 scanner/ssl/openssl_ccs module can do:

msf6 auxiliary(scanner/ssl/openssl_ccs) > show actions

Auxiliary actions:

   Name  Description
   ----  -----------

Evasion Options


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

msf6 auxiliary(scanner/ssl/openssl_ccs) > show evasion

Module evasion options:

   Name                Current Setting  Required  Description
   ----                ---------------  --------  -----------
   TCP::max_send_size  0                no        Maxiumum 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.

Alert record as response to the invalid CCS Message, probably not vulnerable


Here is a relevant code snippet related to the "Alert record as response to the invalid CCS Message, probably not vulnerable" error message:

125:	    alert = sock.get_once(-1, response_timeout)
126:	    if alert.blank?
127:	      print_good("No alert after invalid CCS message, probably vulnerable")
128:	      report
129:	    elsif alert.unpack("C").first == ALERT_RECORD_TYPE
130:	      vprint_error("Alert record as response to the invalid CCS Message, probably not vulnerable")
131:	    elsif alert
132:	      vprint_warning("Unexpected response.")
133:	    end
134:	  end
135:	

Unexpected response.


Here is a relevant code snippet related to the "Unexpected response." error message:

127:	      print_good("No alert after invalid CCS message, probably vulnerable")
128:	      report
129:	    elsif alert.unpack("C").first == ALERT_RECORD_TYPE
130:	      vprint_error("Alert record as response to the invalid CCS Message, probably not vulnerable")
131:	    elsif alert
132:	      vprint_warning("Unexpected response.")
133:	    end
134:	  end
135:	
136:	  def report
137:	    report_vuln({

No Server Hello after <RESPONSE_TIMEOUT> seconds...


Here is a relevant code snippet related to the "No Server Hello after <RESPONSE_TIMEOUT> seconds..." error message:

181:	    vprint_status("Sending Client Hello...")
182:	    sock.put(client_hello)
183:	    server_hello = sock.get_once(-1, response_timeout)
184:	
185:	    unless server_hello
186:	      vprint_error("No Server Hello after #{response_timeout} seconds...")
187:	      disconnect
188:	      return nil
189:	    end
190:	
191:	    unless server_hello.unpack("C").first == HANDSHAKE_RECORD_TYPE

Server Hello Not Found


Here is a relevant code snippet related to the "Server Hello Not Found" error message:

187:	      disconnect
188:	      return nil
189:	    end
190:	
191:	    unless server_hello.unpack("C").first == HANDSHAKE_RECORD_TYPE
192:	      vprint_error("Server Hello Not Found")
193:	      return nil
194:	    end
195:	
196:	    true
197:	  end

Go back to menu.


References


See Also


Check also the following modules related to this module:

Authors


  • Masashi Kikuchi
  • Craig Young <CYoung[at]tripwire.com>
  • juan vazquez

Version


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

Go back to menu.