Moxa UDP Device Discovery - Metasploit


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

Module Overview


Name: Moxa UDP Device Discovery
Module: auxiliary/scanner/scada/moxa_discover
Source code: modules/auxiliary/scanner/scada/moxa_discover.rb
Disclosure date: -
Last modification time: 2017-07-24 06:26:21 +0000
Supported architecture(s): -
Supported platform(s): -
Target service / protocol: -
Target network port(s): 4800
List of CVEs: CVE-2016-9361

The Moxa protocol listens on 4800/UDP and will respond to broadcast or direct traffic. The service is known to be used on Moxa devices in the NPort, OnCell, and MGate product lines. A discovery packet compels a Moxa device to respond to the sender with some basic device information that is needed for more advanced functions. The discovery data is 8 bytes in length and is the most basic example of the Moxa protocol. It may be sent out as a broadcast (destination 255.255.255.255) or to an individual device. Devices that respond to this query may be vulnerable to serious information disclosure vulnerabilities, such as CVE-2016-9361. The module is the work of Patrick DeSantis of Cisco Talos and is derived from original work by K. Reid Wightman. Tested and validated on a Moxa NPort 6250 with firmware versions 1.13 and 1.15.

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

Other examples of setting the RHOSTS option:

Example 1:

msf auxiliary(moxa_discover) > set RHOSTS 192.168.1.3-192.168.1.200 

Example 2:

msf auxiliary(moxa_discover) > set RHOSTS 192.168.1.1/24

Example 3:

msf auxiliary(moxa_discover) > 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


Vulnerable Application


The Moxa protocol listens on 4800/UDP and will respond to broadcast or direct traffic. The service is known to be used on Moxa devices in the NPort, OnCell, and MGate product lines.

A discovery packet compels a Moxa device to respond to the sender with some basic device information that is needed for more advanced functions. The discovery data is 8 bytes in length and is the most basic example of the Moxa protocol. It may be sent out as a broadcast (destination 255.255.255.255) or to an individual device.

Devices that respond to this query may be vulnerable to serious information disclosure vulnerabilities, such as CVE-2016-9361.

The module is the work of Patrick DeSantis of Cisco Talos and is derived from original work by K. Reid Wightman. Tested and validated on a Moxa NPort 6250 with firmware versions 1.13 and 1.15.

The discovery request contains the bytes:

\x01\x00\x00\x08\x00\x00\x00\x00

Where the function code (first byte) 0x01 is Moxa discovery/identify and the fourth byte is the length of the full data payload.

The first byte of a response will always be the func code + 0x80 (the most significant bit of the byte is set to 1, so 0b00000001 becomes 0b10000001, or 0x81).

A valid response is 24 bytes, starts with 0x81, and contains the values 0x00, 0x90, 0xe8 (the Moxa OIU) in bytes 14, 15, and 16.

Verification Steps


  1. Start msfconsole
  2. Do: use auxiliary/scanner/scada/moxa_discover
  3. Do: set RHOSTS
  4. Do: run
  5. Devices running the Moxa service should respond

Options


RHOSTS

Target(s) to scan; can be single target, a range, or broadcast.

Scenarios


  msf > hosts

  Hosts
  =====

  msf > use auxiliary/scanner/scada/moxa_discover
  msf auxiliary(moxa_discover) > set RHOSTS 192.168.127.254
  RHOSTS => 192.168.127.254
  msf auxiliary(moxa_discover) > show options

  Module options (auxiliary/scanner/scada/moxa_discover):

    Name       Current Setting  Required  Description
    ----       ---------------  --------  -----------
    BATCHSIZE  256              yes       The number of hosts to probe in each set
    RHOSTS     192.168.127.254  yes       The target address range or CIDR identifier
    RPORT      4800             yes       The target port (UDP)
    THREADS    10               yes       The number of concurrent threads

  msf auxiliary(moxa_discover) > run

  [+] 192.168.127.254:4800 Moxa Device Found!
  [*] Scanned 1 of 1 hosts (100% complete)
  [*] Auxiliary module execution completed
  msf auxiliary(moxa_discover) > hosts

  Hosts
  =====

  address          mac  name  os_name  os_flavor  os_sp  purpose  info         comments
  -------          ---  ----  -------  ---------  -----  -------  ----         --------
  192.168.127.254             Unknown                    device   Moxa Device

  msf auxiliary(moxa_discover) >

Go back to menu.

Msfconsole Usage


Here is how the scanner/scada/moxa_discover auxiliary module looks in the msfconsole:

msf6 > use auxiliary/scanner/scada/moxa_discover

msf6 auxiliary(scanner/scada/moxa_discover) > show info

       Name: Moxa UDP Device Discovery
     Module: auxiliary/scanner/scada/moxa_discover
    License: Metasploit Framework License (BSD)
       Rank: Normal

Provided by:
  Patrick DeSantis <[email protected]>

Check supported:
  No

Basic options:
  Name       Current Setting  Required  Description
  ----       ---------------  --------  -----------
  BATCHSIZE  256              yes       The number of hosts to probe in each set
  RHOSTS                      yes       The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>'
  RPORT      4800             yes       The target port (UDP)
  THREADS    10               yes       The number of concurrent threads

Description:
  The Moxa protocol listens on 4800/UDP and will respond to broadcast 
  or direct traffic. The service is known to be used on Moxa devices 
  in the NPort, OnCell, and MGate product lines. A discovery packet 
  compels a Moxa device to respond to the sender with some basic 
  device information that is needed for more advanced functions. The 
  discovery data is 8 bytes in length and is the most basic example of 
  the Moxa protocol. It may be sent out as a broadcast (destination 
  255.255.255.255) or to an individual device. Devices that respond to 
  this query may be vulnerable to serious information disclosure 
  vulnerabilities, such as CVE-2016-9361. The module is the work of 
  Patrick DeSantis of Cisco Talos and is derived from original work by 
  K. Reid Wightman. Tested and validated on a Moxa NPort 6250 with 
  firmware versions 1.13 and 1.15.

References:
  https://nvd.nist.gov/vuln/detail/CVE-2016-9361
  https://www.digitalbond.com/blog/2016/10/25/serial-killers/
  http://www.moxa.com/support/faq/faq_detail.aspx?id=646

Module Options


This is a complete list of options available in the scanner/scada/moxa_discover auxiliary module:

msf6 auxiliary(scanner/scada/moxa_discover) > show options

Module options (auxiliary/scanner/scada/moxa_discover):

   Name       Current Setting  Required  Description
   ----       ---------------  --------  -----------
   BATCHSIZE  256              yes       The number of hosts to probe in each set
   RHOSTS                      yes       The target host(s), range CIDR identifier, or hosts file with syntax 'file:<path>'
   RPORT      4800             yes       The target port (UDP)
   THREADS    10               yes       The number of concurrent threads

Advanced Options


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

msf6 auxiliary(scanner/scada/moxa_discover) > show advanced

Module advanced options (auxiliary/scanner/scada/moxa_discover):

   Name                   Current Setting  Required  Description
   ----                   ---------------  --------  -----------
   CHOST                                   no        The local client address
   CPORT                                   no        The local client port
   ScannerMaxResends      10               yes       The maximum times to resend a packet when out of buffers
   ScannerRecvInterval    30               yes       The maximum numbers of sends before entering the processing loop
   ScannerRecvQueueLimit  100              yes       The maximum queue size before breaking out of the processing loop
   ScannerRecvWindow      15               yes       The number of seconds to wait post-scan to catch leftover replies
   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/scada/moxa_discover module can do:

msf6 auxiliary(scanner/scada/moxa_discover) > show actions

Auxiliary actions:

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

Evasion Options


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

msf6 auxiliary(scanner/scada/moxa_discover) > 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.

<PEER> No Moxa Devices Found.


Here is a relevant code snippet related to the "<PEER> No Moxa Devices Found." error message:

85:	        port: rport,
86:	        name: 'Moxa Protocol',
87:	      )
88:	
89:	      if response.empty?
90:	        vprint_status("#{peer} No Moxa Devices Found.")
91:	      else
92:	        print_good("#{peer} Moxa Device Found!")
93:	
94:	        # Report vuln
95:	        report_vuln(

Go back to menu.


References


See Also


Check also the following modules related to this module:

Authors


Patrick DeSantis <p[at]t-r10t.com>

Version


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

Go back to menu.