Skip to content

Commit 925088b

Browse files
authored
Create moxa_discover.md
1 parent 2200c9f commit 925088b

File tree

1 file changed

+85
-0
lines changed

1 file changed

+85
-0
lines changed
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
## Vulnerable Application
2+
3+
The Moxa protocol listens on 4800/UDP and will respond to broadcast
4+
or direct traffic. The service is known to be used on Moxa devices
5+
in the NPort, OnCell, and MGate product lines.
6+
7+
A discovery packet compels a Moxa device to respond to the sender
8+
with some basic device information that is needed for more advanced
9+
functions. The discovery data is 8 bytes in length and is the most
10+
basic example of the Moxa protocol. It may be sent out as a
11+
broadcast (destination 255.255.255.255) or to an individual device.
12+
13+
Devices that respond to this query may be vulnerable to serious
14+
information disclosure vulnerabilities, such as CVE-2016-9361.
15+
16+
The module is the work of Patrick DeSantis of Cisco Talos and is
17+
derived from original work by K. Reid Wightman. Tested and validated
18+
on a Moxa NPort 6250 with firmware versions 1.13 and 1.15.
19+
20+
The discovery request contains the bytes:
21+
22+
`\x01\x00\x00\x08\x00\x00\x00\x00`
23+
24+
Where the function code (first byte) 0x01 is Moxa discovery/identify
25+
and the fourth byte is the length of the full data payload.
26+
27+
The first byte of a response will always be the func code + 0x80
28+
(the most significant bit of the byte is set to 1, so 0b00000001
29+
becomes 0b10000001, or 0x81).
30+
31+
A valid response is 24 bytes, starts with 0x81, and contains the values
32+
0x00, 0x90, 0xe8 (the Moxa OIU) in bytes 14, 15, and 16.
33+
34+
## Verification Steps
35+
36+
1. Start msfconsole
37+
2. Do: ```use auxiliary/scanner/scada/moxa_discover```
38+
3. Do: ```set RHOSTS```
39+
4. Do: ```run```
40+
4. Devices running the Moxa service should respond
41+
42+
## Options
43+
44+
**RHOSTS**
45+
46+
Target(s) to scan; can be single target, a range, or broadcast.
47+
48+
## Scenarios
49+
50+
```
51+
msf > hosts
52+
53+
Hosts
54+
=====
55+
56+
msf > use auxiliary/scanner/scada/moxa_discover
57+
msf auxiliary(moxa_discover) > set RHOSTS 192.168.127.254
58+
RHOSTS => 192.168.127.254
59+
msf auxiliary(moxa_discover) > show options
60+
61+
Module options (auxiliary/scanner/scada/moxa_discover):
62+
63+
Name Current Setting Required Description
64+
---- --------------- -------- -----------
65+
BATCHSIZE 256 yes The number of hosts to probe in each set
66+
RHOSTS 192.168.127.254 yes The target address range or CIDR identifier
67+
RPORT 4800 yes The target port (UDP)
68+
THREADS 10 yes The number of concurrent threads
69+
70+
msf auxiliary(moxa_discover) > run
71+
72+
[+] 192.168.127.254:4800 Moxa Device Found!
73+
[*] Scanned 1 of 1 hosts (100% complete)
74+
[*] Auxiliary module execution completed
75+
msf auxiliary(moxa_discover) > hosts
76+
77+
Hosts
78+
=====
79+
80+
address mac name os_name os_flavor os_sp purpose info comments
81+
------- --- ---- ------- --------- ----- ------- ---- --------
82+
192.168.127.254 Unknown device Moxa Device
83+
84+
msf auxiliary(moxa_discover) >
85+
```

0 commit comments

Comments
 (0)