what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

Moxa UDP Device Discovery

Moxa UDP Device Discovery
Posted Aug 31, 2024
Authored by Patrick DeSantis | Site metasploit.com

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.

tags | exploit, udp, vulnerability, protocol, info disclosure
systems | cisco
advisories | CVE-2016-9361
SHA-256 | 98b6bc9ac986f9cabba0156932ffefd60159a96b8107e1d9b3448bedd300ff36

Moxa UDP Device Discovery

Change Mirror Download
##
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##

class MetasploitModule < Msf::Auxiliary
include Msf::Auxiliary::Report
include Msf::Auxiliary::UDPScanner

def initialize(info = {})
super(
update_info(
info,
'Name' => 'Moxa UDP Device Discovery',
'Description' => %q(
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.
),
'Author' => 'Patrick DeSantis <p[at]t-r10t.com>',
'License' => MSF_LICENSE,
'References' =>
[
[ 'CVE', '2016-9361'],
[ 'URL', 'https://www.digitalbond.com/blog/2016/10/25/serial-killers/'],
[ 'URL', 'http://www.moxa.com/support/faq/faq_detail.aspx?id=646' ],
]
)
)

register_options(
[
# Moxa protocol listens on 4800/UDP by default
Opt::RPORT(4800)
])
end

# The data to be sent via UDP
def build_probe
# Function Code (first byte) 0x01: Moxa discovery/identify
# The fourth byte is the length of the full data payload
@probe ||= "\x01\x00\x00\x08\x00\x00\x00\x00"
end

# Called for each response packet
def scanner_process(response, src_host, _src_port)
# 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.
return unless response[0] == "\x81" && response[14..16] == "\x00\x90\xe8" && response.length == 24
@results[src_host] ||= []
@results[src_host] << response
end

# Called after the scan block
def scanner_postscan(_batch)
@results.each_pair do |host, response|
peer = "#{host}:#{rport}"

# Report the host
report_host(
:host => host,
:info => "Moxa Device",
)

# Report the service
report_service(
host: host,
proto: 'udp',
port: rport,
name: 'Moxa Protocol',
)

if response.empty?
vprint_status("#{peer} No Moxa Devices Found.")
else
print_good("#{peer} Moxa Device Found!")

# Report vuln
report_vuln(
host: host,
port: rport,
proto: 'udp',
name: 'Moxa Protocol Use',
refs: references
)
end
end
end
end
Login or Register to add favorites

File Archive:

September 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Sep 1st
    261 Files
  • 2
    Sep 2nd
    17 Files
  • 3
    Sep 3rd
    38 Files
  • 4
    Sep 4th
    52 Files
  • 5
    Sep 5th
    23 Files
  • 6
    Sep 6th
    27 Files
  • 7
    Sep 7th
    0 Files
  • 8
    Sep 8th
    1 Files
  • 9
    Sep 9th
    16 Files
  • 10
    Sep 10th
    38 Files
  • 11
    Sep 11th
    21 Files
  • 12
    Sep 12th
    40 Files
  • 13
    Sep 13th
    18 Files
  • 14
    Sep 14th
    0 Files
  • 15
    Sep 15th
    0 Files
  • 16
    Sep 16th
    21 Files
  • 17
    Sep 17th
    51 Files
  • 18
    Sep 18th
    23 Files
  • 19
    Sep 19th
    48 Files
  • 20
    Sep 20th
    36 Files
  • 21
    Sep 21st
    0 Files
  • 22
    Sep 22nd
    0 Files
  • 23
    Sep 23rd
    38 Files
  • 24
    Sep 24th
    65 Files
  • 25
    Sep 25th
    24 Files
  • 26
    Sep 26th
    26 Files
  • 27
    Sep 27th
    39 Files
  • 28
    Sep 28th
    0 Files
  • 29
    Sep 29th
    0 Files
  • 30
    Sep 30th
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2024 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close