DB2 Discovery Service Detection - Metasploit


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

Module Overview


Name: DB2 Discovery Service Detection
Module: auxiliary/scanner/db2/discovery
Source code: modules/auxiliary/scanner/db2/discovery.rb
Disclosure date: -
Last modification time: 2019-03-05 03:38:51 +0000
Supported architecture(s): -
Supported platform(s): -
Target service / protocol: -
Target network port(s): 523
List of CVEs: -

This module simply queries the DB2 discovery service for information.

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

Other examples of setting the RHOSTS option:

Example 1:

msf auxiliary(discovery) > set RHOSTS 192.168.1.3-192.168.1.200 

Example 2:

msf auxiliary(discovery) > set RHOSTS 192.168.1.1/24

Example 3:

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

Required Options


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

Knowledge Base


Description


This module simply queries the DB2 discovery service for information. The discovery service is integrated with the Configuration Assistant and the DB2® administration server. Using the discovery method, catalog information for a remote server can be automatically generated in the local database and node directory.

Verification Steps


  1. use auxiliary/scanner/db2/discovery
  2. set RHOSTS [target address range/cidr]
  3. set THREDS [number of threads]
  4. run

Scenarios


DB2 9.07.2 on RHEL 6.9

msf auxiliary(scanner/db2/discovery) > set RHOSTS 192.168.1.25
msf auxiliary(scanner/db2/discovery) > run

[+] Host 192.168.1.25 node name is SERVER02 with a product id of SQL09072
[*] Scanned 1 of 1 hosts (100% complete)
[*] Auxiliary module execution completed

msf auxiliary(scanner/db2/discovery) > 
  • The same output is expected on other versions of DB2, with the correspondent DB2 version at the product ID.
    • Example: DB2 9.07.2 outputs the product ID SQL9072, while DB2 7.02.9 outputs the product ID SQL7029.

Go back to menu.

Msfconsole Usage


Here is how the scanner/db2/discovery auxiliary module looks in the msfconsole:

msf6 > use auxiliary/scanner/db2/discovery

msf6 auxiliary(scanner/db2/discovery) > show info

       Name: DB2 Discovery Service Detection
     Module: auxiliary/scanner/db2/discovery
    License: Metasploit Framework License (BSD)
       Rank: Normal

Provided by:
  MC <[email protected]>

Check supported:
  No

Basic options:
  Name     Current Setting  Required  Description
  ----     ---------------  --------  -----------
  RHOSTS                    yes       The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>'
  RPORT    523              yes       The target port (UDP)
  THREADS  1                yes       The number of concurrent threads (max one per host)

Description:
  This module simply queries the DB2 discovery service for 
  information.

Module Options


This is a complete list of options available in the scanner/db2/discovery auxiliary module:

msf6 auxiliary(scanner/db2/discovery) > show options

Module options (auxiliary/scanner/db2/discovery):

   Name     Current Setting  Required  Description
   ----     ---------------  --------  -----------
   RHOSTS                    yes       The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>'
   RPORT    523              yes       The target port (UDP)
   THREADS  1                yes       The number of concurrent threads (max one per host)

Advanced Options


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

msf6 auxiliary(scanner/db2/discovery) > show advanced

Module advanced options (auxiliary/scanner/db2/discovery):

   Name                 Current Setting  Required  Description
   ----                 ---------------  --------  -----------
   CHOST                                 no        The local client address
   CPORT                                 no        The local client port
   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/db2/discovery module can do:

msf6 auxiliary(scanner/db2/discovery) > show actions

Auxiliary actions:

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

Evasion Options


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

msf6 auxiliary(scanner/db2/discovery) > show evasion

Module evasion options:

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

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.

Unable to determine version info for <IP>


Here is a relevant code snippet related to the "Unable to determine version info for <IP>" error message:

28:	      connect_udp
29:	      udp_sock.put(pkt)
30:	      res = udp_sock.read(1024)
31:	
32:	      unless res
33:	        print_error("Unable to determine version info for #{ip}")
34:	        return
35:	      end
36:	
37:	      res = res.split(/\x00/)
38:	

Go back to menu.


Go back to menu.

See Also


Check also the following modules related to this module:

Authors


  • MC

Version


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

Go back to menu.