IBM WebSphere MQ Channel Name Bruteforce - Metasploit


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

Module Overview


Name: IBM WebSphere MQ Channel Name Bruteforce
Module: auxiliary/scanner/misc/ibm_mq_channel_brute
Source code: modules/auxiliary/scanner/misc/ibm_mq_channel_brute.rb
Disclosure date: -
Last modification time: 2018-11-20 16:24:17 +0000
Supported architecture(s): -
Supported platform(s): -
Target service / protocol: -
Target network port(s): 1414
List of CVEs: -

This module uses a dictionary to bruteforce MQ channel names. For all identified channels it also returns if SSL is used and whether it is a server-connection channel.

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

Other examples of setting the RHOSTS option:

Example 1:

msf auxiliary(ibm_mq_channel_brute) > set RHOSTS 192.168.1.3-192.168.1.200 

Example 2:

msf auxiliary(ibm_mq_channel_brute) > set RHOSTS 192.168.1.1/24

Example 3:

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

Required Options


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

  • CHANNELS_FILE: The file that contains a list of channel names

Knowledge Base


Vulnerable Application


  • IBM Downloads page: https://developer.ibm.com/messaging/mq-downloads/
  • Tested on IBM MQ 7.5, 8 and 9
  • Usage:
    • Download and install MQ Server
    • Create a new Queue Manager
    • Create a new channel (without SSL)
    • Run the module

Verification Steps


  1. Install IBM MQ Server 7.5, 8, or 9
  2. Start msfconsole
  3. Do: use auxiliary/scanner/misc/ibm_mq_channel_brute
  4. Do: set channels_file <channel_list_file>
  5. Do: set rhosts <target_IP>
  6. Do: set rport <port>
  7. Do: run

Options


The CHANNELS_FILE option

This option should contain the path to a text file which contains a list of channel names that will be checked. One channel name per line.

Scenarios


This module can be used to identify a list of channel names that are configured on the Queue Manager. Additionally, the module will return whether each identified channel uses SSL and if it MQI type. After obtaining a list of valid channel names, these can be used to further enumerate the MQ installation. For example, the ibm_mq_enum module can be executed using a valid channel name in order to obtain information regarding the Queue Manager.

  msf auxiliary(scanner/misc/ibm_mq_channel_brute) > run

[*] 10.1.1.144:1414       - Found channel: TEST.CHANNEL, IsEncrypted: False, IsMQI: True
[*] 10.1.1.144:1414       - Found channel: SYSTEM.ADMIN.SVRCONN, IsEncrypted: False, IsMQI: True

[+] 10.1.1.144:1414       - Channels found: ["TEST.CHANNEL", "SYSTEM.ADMIN.SVRCONN"]
[+] 10.1.1.144:1414       - Unencrypted MQI Channels found: ["TEST.CHANNEL", "SYSTEM.ADMIN.SVRCONN"]

[*] Scanned 1 of 1 hosts (100% complete)
[*] Auxiliary module execution completed

Go back to menu.

Msfconsole Usage


Here is how the scanner/misc/ibm_mq_channel_brute auxiliary module looks in the msfconsole:

msf6 > use auxiliary/scanner/misc/ibm_mq_channel_brute

msf6 auxiliary(scanner/misc/ibm_mq_channel_brute) > show info

       Name: IBM WebSphere MQ Channel Name Bruteforce
     Module: auxiliary/scanner/misc/ibm_mq_channel_brute
    License: Metasploit Framework License (BSD)
       Rank: Normal

Provided by:
  Petros Koutroumpis

Check supported:
  No

Basic options:
  Name           Current Setting  Required  Description
  ----           ---------------  --------  -----------
  CHANNELS_FILE                   yes       The file that contains a list of channel names
  CONCURRENCY    10               yes       The number of concurrent channel names to check
  RHOSTS                          yes       The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>'
  RPORT          1414             yes       The target port (TCP)
  THREADS        1                yes       The number of concurrent threads (max one per host)
  TIMEOUT        10               yes       The socket connect timeout in seconds

Description:
  This module uses a dictionary to bruteforce MQ channel names. For 
  all identified channels it also returns if SSL is used and whether 
  it is a server-connection channel.

Module Options


This is a complete list of options available in the scanner/misc/ibm_mq_channel_brute auxiliary module:

msf6 auxiliary(scanner/misc/ibm_mq_channel_brute) > show options

Module options (auxiliary/scanner/misc/ibm_mq_channel_brute):

   Name           Current Setting  Required  Description
   ----           ---------------  --------  -----------
   CHANNELS_FILE                   yes       The file that contains a list of channel names
   CONCURRENCY    10               yes       The number of concurrent channel names to check
   RHOSTS                          yes       The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>'
   RPORT          1414             yes       The target port (TCP)
   THREADS        1                yes       The number of concurrent threads (max one per host)
   TIMEOUT        10               yes       The socket connect timeout in seconds

Advanced Options


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

msf6 auxiliary(scanner/misc/ibm_mq_channel_brute) > show advanced

Module advanced options (auxiliary/scanner/misc/ibm_mq_channel_brute):

   Name                 Current Setting  Required  Description
   ----                 ---------------  --------  -----------
   CHOST                                 no        The local client address
   CPORT                                 no        The local client port
   ConnectTimeout       10               yes       Maximum number of seconds to establish a TCP connection
   Proxies                               no        A proxy chain of format type:host:port[,type:host:port][...]
   SSL                  false            no        Negotiate SSL/TLS for outgoing connections
   SSLCipher                             no        String for SSL cipher - "DHE-RSA-AES256-SHA" or "ADH"
   SSLVerifyMode        PEER             no        SSL verification method (Accepted: CLIENT_ONCE, FAIL_IF_NO_PEER_CERT, NONE, PEER)
   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)
   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/misc/ibm_mq_channel_brute module can do:

msf6 auxiliary(scanner/misc/ibm_mq_channel_brute) > show actions

Auxiliary actions:

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

Evasion Options


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

msf6 auxiliary(scanner/misc/ibm_mq_channel_brute) > show evasion

Module evasion options:

   Name                Current Setting  Required  Description
   ----                ---------------  --------  -----------
   TCP::max_send_size  0                no        Maxiumum 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.

TCP Port closed.


Here is a relevant code snippet related to the "TCP Port closed." error message:

83:	    @channels = []
84:	    @unencrypted_mqi_channels = []
85:	    begin
86:	      channel_list
87:	      rescue ::Rex::ConnectionRefused
88:	        fail_with(Failure::Unreachable, "TCP Port closed.")
89:	      rescue ::Rex::ConnectionError, ::IOError, ::Timeout::Error, Errno::ECONNRESET
90:	        fail_with(Failure::Unreachable, "Connection Failed.")
91:	      rescue ::Exception => e
92:	        fail_with(Failure::Unknown, e)
93:	      end

Connection Failed.


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

85:	    begin
86:	      channel_list
87:	      rescue ::Rex::ConnectionRefused
88:	        fail_with(Failure::Unreachable, "TCP Port closed.")
89:	      rescue ::Rex::ConnectionError, ::IOError, ::Timeout::Error, Errno::ECONNRESET
90:	        fail_with(Failure::Unreachable, "Connection Failed.")
91:	      rescue ::Exception => e
92:	        fail_with(Failure::Unknown, e)
93:	      end
94:	      if(@channels.empty?)
95:	        print_status("#{ip}:#{rport} No channels found.")

<IP>:<RPORT> No channels found.


Here is a relevant code snippet related to the "<IP>:<RPORT> No channels found." error message:

90:	        fail_with(Failure::Unreachable, "Connection Failed.")
91:	      rescue ::Exception => e
92:	        fail_with(Failure::Unknown, e)
93:	      end
94:	      if(@channels.empty?)
95:	        print_status("#{ip}:#{rport} No channels found.")
96:	      else
97:	        print_good("Channels found: #{@channels}")
98:	        print_good("Unencrypted MQI Channels found: #{@unencrypted_mqi_channels}")
99:	        report_note(
100:	          :host => rhost,

Channel names cannot exceed 20 characters. Skipping.


Here is a relevant code snippet related to the "Channel names cannot exceed 20 characters. Skipping." error message:

118:	          end
119:	          t << framework.threads.spawn("Module(#{self.refname})-#{rhost}:#{rport}", false, this_channel) do |channel|
120:	            connect
121:	            vprint_status "#{rhost}:#{rport} - Sending request for #{channel}..."
122:	            if channel.length.to_i > 20
123:	              print_error("Channel names cannot exceed 20 characters.  Skipping.")
124:	              next
125:	            end
126:	            chan = channel + "\x20"*(20-channel.length.to_i)
127:	            timeout = datastore['TIMEOUT'].to_i
128:	            s = connect(false,

No response received. Try increasing timeout.


Here is a relevant code snippet related to the "No response received. Try increasing timeout." error message:

132:	              }
133:	            )
134:	            s.put(create_packet(chan))
135:	            data = s.get_once(-1,timeout)
136:	            if data.nil?
137:	              print_status("No response received. Try increasing timeout.")
138:	              next
139:	            end
140:	            if not data[0...3].include? 'TSH'
141:	              next
142:	            end

Go back to menu.


Go back to menu.

See Also


Check also the following modules related to this module:

Authors


Petros Koutroumpis

Version


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

Go back to menu.