OpenSSL Alternative Chains Certificate Forgery MITM Proxy - Metasploit


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

Module Overview


Name: OpenSSL Alternative Chains Certificate Forgery MITM Proxy
Module: auxiliary/server/openssl_altchainsforgery_mitm_proxy
Source code: modules/auxiliary/server/openssl_altchainsforgery_mitm_proxy.rb
Disclosure date: 2015-07-09
Last modification time: 2021-02-19 20:35:33 +0000
Supported architecture(s): -
Supported platform(s): -
Target service / protocol: -
Target network port(s): -
List of CVEs: CVE-2015-1793

This module exploits a logic error in OpenSSL by impersonating the server and sending a specially-crafted chain of certificates, resulting in certain checks on untrusted certificates to be bypassed on the client, allowing it to use a valid leaf certificate as a CA certificate to sign a fake certificate. The SSL/TLS session is then proxied to the server allowing the session to continue normally and application data transmitted between the peers to be saved. The valid leaf certificate must not contain the keyUsage extension or it must have at least the keyCertSign bit set (see X509_check_issued function in crypto/x509v3/v3_purp.c); otherwise; X509_verify_cert fails with X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY. This module requires an active man-in-the-middle attack.

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_altchainsforgery_mitm_proxy
msf auxiliary(openssl_altchainsforgery_mitm_proxy) > show targets
    ... a list of targets ...
msf auxiliary(openssl_altchainsforgery_mitm_proxy) > set TARGET target-id
msf auxiliary(openssl_altchainsforgery_mitm_proxy) > show options
    ... show and set options ...
msf auxiliary(openssl_altchainsforgery_mitm_proxy) > exploit

Required Options


  • CACERT: The leaf certificate's CA certificate

  • CERT: The leaf certificate

  • KEY: The leaf certificate's private key

  • HOST: The server address

Go back to menu.

Msfconsole Usage


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

msf6 > use auxiliary/server/openssl_altchainsforgery_mitm_proxy

msf6 auxiliary(server/openssl_altchainsforgery_mitm_proxy) > show info

       Name: OpenSSL Alternative Chains Certificate Forgery MITM Proxy
     Module: auxiliary/server/openssl_altchainsforgery_mitm_proxy
    License: Metasploit Framework License (BSD)
       Rank: Normal
  Disclosed: 2015-07-09

Provided by:
  David Benjamin
  Adam Langley
  Ramon de C Valle <[email protected]>

Available actions:
  Name     Description
  ----     -----------
  Service  Run MITM proxy

Check supported:
  No

Basic options:
  Name        Current Setting                                                     Required  Description
  ----        ---------------                                                     --------  -----------
  CACERT                                                                          yes       The leaf certificate's CA certificate
  CERT                                                                            yes       The leaf certificate
  HOST                                                                            yes       The server address
  KEY                                                                             yes       The leaf certificate's private key
  PASSPHRASE                                                                      no        The pass phrase for the leaf certificate's private key
  PORT        443                                                                 yes       The server port
  SRVHOST     0.0.0.0                                                             yes       The proxy address
  SRVPORT     443                                                                 yes       The proxy port
  SUBJECT     /C=US/ST=California/L=Mountain View/O=Example Inc/CN=*.example.com  no        The subject field for the fake certificate

Description:
  This module exploits a logic error in OpenSSL by impersonating the 
  server and sending a specially-crafted chain of certificates, 
  resulting in certain checks on untrusted certificates to be bypassed 
  on the client, allowing it to use a valid leaf certificate as a CA 
  certificate to sign a fake certificate. The SSL/TLS session is then 
  proxied to the server allowing the session to continue normally and 
  application data transmitted between the peers to be saved. The 
  valid leaf certificate must not contain the keyUsage extension or it 
  must have at least the keyCertSign bit set (see X509_check_issued 
  function in crypto/x509v3/v3_purp.c); otherwise; X509_verify_cert 
  fails with X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY. This module 
  requires an active man-in-the-middle attack.

References:
  https://nvd.nist.gov/vuln/detail/CVE-2015-1793
  https://cwe.mitre.org/data/definitions/754.html
  http://git.openssl.org/?p=openssl.git;a=commit;h=f404943bcab4898d18f3ac1b36479d1d7bbbb9e6

Module Options


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

msf6 auxiliary(server/openssl_altchainsforgery_mitm_proxy) > show options

Module options (auxiliary/server/openssl_altchainsforgery_mitm_proxy):

   Name        Current Setting                                                     Required  Description
   ----        ---------------                                                     --------  -----------
   CACERT                                                                          yes       The leaf certificate's CA certificate
   CERT                                                                            yes       The leaf certificate
   HOST                                                                            yes       The server address
   KEY                                                                             yes       The leaf certificate's private key
   PASSPHRASE                                                                      no        The pass phrase for the leaf certificate's private key
   PORT        443                                                                 yes       The server port
   SRVHOST     0.0.0.0                                                             yes       The proxy address
   SRVPORT     443                                                                 yes       The proxy port
   SUBJECT     /C=US/ST=California/L=Mountain View/O=Example Inc/CN=*.example.com  no        The subject field for the fake certificate

Auxiliary action:

   Name     Description
   ----     -----------
   Service  Run MITM proxy

Advanced Options


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

msf6 auxiliary(server/openssl_altchainsforgery_mitm_proxy) > show advanced

Module advanced options (auxiliary/server/openssl_altchainsforgery_mitm_proxy):

   Name       Current Setting  Required  Description
   ----       ---------------  --------  -----------
   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_altchainsforgery_mitm_proxy module can do:

msf6 auxiliary(server/openssl_altchainsforgery_mitm_proxy) > show actions

Auxiliary actions:

   Name     Description
   ----     -----------
   Service  Run MITM proxy

Evasion Options


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

msf6 auxiliary(server/openssl_altchainsforgery_mitm_proxy) > show evasion

Module evasion options:

   Name  Current Setting  Required  Description
   ----  ---------------  --------  -----------

Go back to menu.


References


See Also


Check also the following modules related to this module:

Authors


  • David Benjamin
  • Adam Langley
  • Ramon de C Valle

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.