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
use auxiliary/scanner/db2/discovery
set RHOSTS [target address range/cidr]
set THREDS [number of threads]
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 IDSQL7029
.
- Example: DB2 9.07.2 outputs the product ID
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.
Related Pull Requests
- #11523 Merged Pull Request: MSF5: Remove unneeded RHOST deregister in scanners
- #8716 Merged Pull Request: Print_Status -> Print_Good (And OCD bits 'n bobs)
- #8338 Merged Pull Request: Fix msf/core and self.class msftidy warnings
- #6655 Merged Pull Request: use MetasploitModule as a class name
- #6648 Merged Pull Request: Change metasploit class names
- #6243 Merged Pull Request: Fix #6242, Check nil for sock.read
- #5059 Merged Pull Request: Yard doc corrections
- #2525 Merged Pull Request: Change module boilerplate
- #1228 Merged Pull Request: MSFTIDY cleanup #1 - auxiliary
Go back to menu.
See Also
Check also the following modules related to this module:
- auxiliary/scanner/http/ms09_020_webdav_unicode_bypass
- auxiliary/scanner/http/webdav_internal_ip
- auxiliary/scanner/http/webdav_scanner
- auxiliary/scanner/http/webdav_website_content
- exploit/windows/browser/webdav_dll_hijacker
- exploit/windows/http/xampp_webdav_upload_php
- exploit/windows/iis/iis_webdav_scstoragepathfromurl
- exploit/windows/iis/iis_webdav_upload_asp
- exploit/windows/iis/ms03_007_ntdll_webdav
- exploit/windows/local/ms16_016_webdav
- exploit/windows/misc/vmhgfs_webdav_dll_sideload
- exploit/windows/misc/webdav_delivery
- encoder/x86/unicode_mixed
- encoder/x86/unicode_upper
- auxiliary/scanner/db2/db2_auth
- auxiliary/scanner/db2/db2_version
- exploit/windows/brightstor/discovery_tcp
- exploit/windows/brightstor/discovery_udp
- auxiliary/scanner/discovery/arp_sweep
- auxiliary/scanner/discovery/empty_udp
- auxiliary/scanner/discovery/ipv6_multicast_ping
- auxiliary/scanner/discovery/ipv6_neighbor
- auxiliary/scanner/discovery/ipv6_neighbor_router_advertisement
- auxiliary/scanner/discovery/udp_probe
- auxiliary/scanner/discovery/udp_sweep
- auxiliary/scanner/sap/sap_service_discovery
- exploit/linux/misc/hid_discoveryd_command_blink_on_unauth_rce
- exploit/multi/http/trendmicro_threat_discovery_admin_sys_time_cmdi
- post/windows/recon/computer_browser_discovery
- exploit/linux/http/eyesofnetwork_autodiscovery_rce
- auxiliary/admin/db2/db2rcmd
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.