-
Vulnerability Overview
-
Installing the Sulley Fuzzing Framework & Related Protocol Fuzzing
-
Analysis of VxWorks WDB RPC V2
-
VxWorks WDB RPC V2 Service Exposed on the Internet!!!
-
Setting up VxWorks 5.5 & 6.6 simulation environments https://github.com/knownsec/VxPwn/tree/master/doc
-
Running VxWorks (5.5) on vmWare http://www.vxdev.com/html/44/624.htm
-
Python Gray Hat Chapter 9 Sulley http://blog.chinaunix.net/uid-25979788-id-1747694.html
-
Sulley Official Documentation: https://github.com/OpenRCE/sulley/blob/master/docs/index.html

1. Execute the nmap command (may need to execute multiple times)
2. Where 192.168.1.111 is the IP of the host running VxWorks 5.5. After receiving the above scanning packets, the VxWorks host did not give an error message, but the network stack had crashed and could no longer communicate with the outside world.
3. Continuously send large FTP request packets to tcp/21 running FTP service.
4. The following Python code can also be used to verify this issue:

-
Sulley – Windows Installation https://github.com/OpenRCE/sulley/wiki/Windows-Installation
-
FreeBuf also has articles that translate the above documentation: Using fuzzing techniques in penetration testing (with Windows installation guide) http://www.freebuf.com/articles/network/34136.html
-
MinGW
-
Download https://github.com/develersrl/gccwinbinaries/releases/download/v1.1/gcc-mingw-4.3.3-setup.exe
-
During installation, in the “Select Components” dialog box, in addition to the default options, also check “C++ Compiler” and “ObjC Compiler”.
-
Download and install Python 2.7 x86 version (Please install version 2.7.2; higher versions like 2.7.11 may cause errors in subsequent libdasm compilation steps).
-
Download and install Git for Windows (http://git-scm.com/download/win).
-
Add C:\Python27 and C:\MinGW\bin to the system environment variable $PATH.
-
pydbg
-
Download
-
Compile and install
-
libdasm
-
Download http://libdasm.googlecode.com/files/libdasm-beta.zip and unzip it.
-
Compile
-
Install
C:\sulley_build\libdisasm\pydasm>python setup.py install -
Download and install WinPcap (https://www.winpcap.org/install/bin/WinPcap_4_1_3.exe).
-
Download WinPcap Dev Kit (WpdPack).
-
PCapy
-
Download https://github.com/CoreSecurity/pcapy and unzip it.
-
Compile (specify the include directory and lib directory in WpdPack).
C:\sulley_build\pcapy-0.10.5>python setup.py build_ext -c mingw32 -I “C:\sulley_build\WpdPack\Include” -L “C:\sulley_build\WpdPack\Lib” -
Install
C:\sulley_build\pcapy-0.10.5>python setup.py install -
Download and install setuptools and pip.
-
Install impacket
pip install -U impacket -
Sulley
-
Download
-
Confirm process_monitor.py works normally (no import exceptions).
-
Confirm network_monitor.py works normally (should print the list of network cards).
Someone has publicly released a Sulley-based FTP Fuzzing program on GitHub (https://github.com/proteansec/fuzzyftp), and we used it directly for Fuzzing. The script ftp.py fuzzes the protocol field node diagram as follows:

-
No impact on version 6.6.
-
When continuously sending large FTP request packets in version 5.5, it causes a ring buffer overflow, leading VxWorks to be unable to communicate over the network. This issue also falls under the network stack problem mentioned earlier and is not an FTP protocol issue.
For details on Sun RPC, please refer to the following documentation:
-
Unix Network Programming Volume II, Second Edition, Chapter 16
-
ONC+ Developer’s Guide – Appendix B RPC Protocol and Language Specification (http://docs.oracle.com/cd/E19683-01/816-1435/rpcproto-13077/index.html)

Field Variable | Field Explanation | Field Length (bytes) | Field Type |
---|---|---|---|
xid | transaction identifier | 4 | unsigned int |
mtype | message type | 4 | enum |
rpcvers | rpc version | 4 | unsigned int |
prog | remote program | 4 | unsigned int |
vers | remote program version | 4 | unsigned int |
proc | the procedure within the remote program to be called | 4 | unsigned int |
Fuzzing Results: Both versions 5.5 and 6.6 tested 18 crash points. By observing the register states in the results, they belong to one category. This vulnerability only causes the tPortmapd service to crash and does not affect other services. This vulnerability was analyzed in detail by Formaggio at 44con.
To achieve automated or semi-automated Fuzzing, the following issues must be resolved:
-
Randomly or randomly generate a large number of protocol data packets (generated by Sulley this time).
-
Send the generated packets to the tested component/service (specific protocol Fuzz scripts need to be implemented based on Sulley).
-
Detect the status of the tested component, such as whether it can respond, whether the response is correct, etc. (difficulty).
-
Obtain abnormal information from the component, such as the reason for the crash, memory content, etc. (difficulty).
-
Restore the environment of the tested component, such as rebooting.
-
metasploit-framework/modules/auxiliary/scanner/vxworks/wdbrpc_version.rb (https://github.com/rapid7/metasploit-framework/blob/b206de77081069dd53b1f90f57bfaccd0ecbb0d8/modules/auxiliary/scanner/vxworks/wdbrpc_version.rb)
-
metasploit-framework/modules/auxiliary/scanner/vxworks/wdbrpc_bootline.rb (https://github.com/rapid7/metasploit-framework/blob/b206de77081069dd53b1f90f57bfaccd0ecbb0d8/modules/auxiliary/scanner/vxworks/wdbrpc_bootline.rb)
-
metasploit-framework/modules/auxiliary/admin/vxworks/wdbrpc_reboot.rb (https://github.com/rapid7/metasploit-framework/blob/b206de77081069dd53b1f90f57bfaccd0ecbb0d8/modules/auxiliary/admin/vxworks/wdbrpc_reboot.rb)
-
metasploit-framework/modules/auxiliary/admin/vxworks/wdbrpc_memory_dump.rb (https://github.com/rapid7/metasploit-framework/blob/b206de77081069dd53b1f90f57bfaccd0ecbb0d8/modules/auxiliary/admin/vxworks/wdbrpc_memory_dump.rb)


(Reference from Wind River Documentation)

-
IP Header
-
UDP Header
-
RPC Request Header
-
WDB Parameter Wrapper
-
Function input parameters
Response Data Packet

-
IP Header
-
UDP Header
-
RPC Reply Header
-
WDB Reply Wrapper
-
Function output
-
WDB_TARGET_CONNECT


We encapsulated the functions described above in Python code; please refer to wdbdbg.py (https://github.com/knownsec/VxPwn/blob/master/sulley/wdbdbg.py), where you need to use the third-party module capstone (https://capstone-engine.github.io/download/3.0.4/capstone-3.0.4-python2.7-win32.exe), please install it yourself.
-
Monitor the status of all components (services).
-
Malicious firmware flashing, backdoor implantation.
-
Reboot VxWorks devices.
-
Arbitrary memory read and write.
-
Login bypass.
-
…
By calling the wdbrpc-scan script with Zmap, approximately 50,000 IPs with exposed ports were scanned, among which 34,000 could read system information and bootline information.
Top 10 countries by number:
China: 7861
United States: 5283
Brazil: 3056
Italy: 1025
Japan: 823
Russia: 647
Mexico: 505
Kazakhstan: 486
Australia: 481
India: 448
Number of VxWorks system version statistics:
VxWorks5.5.1 15601
VxWorks5.4.2 6583
VxWorks5.4 5410
VxWorks5.4.2 5254
VxWorks5.5 899
VxWorks 654
VxWorks5.3.1 236
Number of affected PLC module models:
Rockwell Automation 1756-ENBT firmware versions 3.2.6, 3.6.1, and others.
Siemens CP 1604, Siemens CP 1616.
Schneider Electric Quanta Ethernet modules.
-
30339 IPs running WDB RPC service version V1 (i.e., hosts running VxWorks 5.x version).
-
2155 IPs running WDB RPC service version V2 (i.e., hosts running VxWorks 6.x version).
-
20093 hosts running unknown version of VxWorks. These hosts did not return the expected WDB_TGT_INFO format results for both versions of WDB_TGT_INFO_GET requests, but returned shorter error response packets. However, their format conforms to the WDB RPC response format, so it can be basically concluded that these hosts run WDB RPC services, i.e., running VxWorks systems, but the version is unknown. This issue deserves further study.
Top 10 countries distribution statistics
Country | Code | Number |
---|---|---|
India | IN | 667 |
Uganda | UG | 266 |
United States | US | 228 |
Brazil | BR | 156 |
Bhutan | BT | 128 |
Canada | CA | 73 |
Namibia | NA | 60 |
Rwanda | RW | 60 |
South Africa | ZA | 59 |
Korea | KR | 57 |
VxWorks 6.x Version Statistics
Version | Number |
---|---|
VxWorks 6.6 | 1878 |
VxWorks 6.7 | 8 |
VxWorks 6.8 | 250 |
VxWorks 6.9 | 4 |
Unknown version of VxWorks | 15 |
Chip/Integrated Circuit Board | Number | Application Products or Industries |
---|---|---|
Freescale MPC8308 | 671 | Smart grid home energy gateways, data hubs, wireless LAN access points, wireless home base stations, consumer electronics printing, and industrial applications including industrial control and factory automation. |
Freescale MPC8313E | 522 | Small Office/Home Office (SOHO), printing, IP services, and industrial control. |
Freescale MPC8544 | 291 | Networking, communication, and industrial control. |
Freescale P1010E – Security Engine | 271 | IP cameras, industrial robots, wireless LAN (WLAN) access points, network-attached storage, printing and imaging, routers. |
Freescale MCF5372L | 205 | Internet Voice Protocol (VoIP), security and access control panels, healthcare instruments and devices. |
Freescale Unknown processor | 88 | |
Freescale CDS MPC8548E – Security Engine | 16 | Enterprise networking, telecommunications transmission and switching, and 3G wireless base station applications. |
Freescale E500: Unknown system version | 15 | Communication, industrial control. |
TI TNETV1050 Communication Processor | 14 | VoIP. |
Unknown | 14 | |
BCM53000 (MIPS74K) | 12 | Routers. |
AR7100 SERIES | 8 | Home or enterprise-level wireless access points, routers, gateways. |
Freescale P2020E – Security Engine | 6 | Networking, telecommunications, military, and industrial. |
Freescale E300C3 | 6 | Networking, communication, industrial control. |
Intel(R) Pentium4 Processor SYMMETRIC IO MPTABLE | 2 | |
IBM PowerPC [Fluke Odin] 405GPr Rev. 1.1 | 2 | Digital cameras, modems, set-top boxes, mobile phones, GPS, printers, fax machines, network cards, switches, storage devices. |
RENESAS SH7751R 240MHz (BE) | 2 | Routers, PBX, LAN/WAN, printers, scanners, PPC. |
Broadcom BCM91250A/swarm | 2 | Ethernet communication and switching. |
Xilinx Zynq-7000 ARMv7 | 2 | Advanced Driver Assistance Systems, medical endoscopes, small cellular basebands, professional cameras, machine vision, telecom-grade Ethernet backhaul, 4K2K ultra-high-definition televisions, multifunction printers. |
BCM1190 A2/bcm1190) | 2 | VoIP, broadband access. |
Telvent HU_A ColdFire Board (MCF5485) | 1 | Industrial and embedded networking. |
RDL3000-SS – ARM11MPCore (ARM) | 1 | Carrying, SCADA, communication. |
ZTE SCCE(S3C2510 Rev.10.0) | 1 | SOHO routers, gateways, WLAN AP. |
AR9100 SERIES | 1 | Home or enterprise-level wireless access points, routers, gateways. |
We can see that exposing WDB RPC services to the Internet poses great dangers, but it is an indispensable tool for system developers of hardware devices using VxWorks. It needs to be turned on during the development process, but it must be turned off when compiling VxWorks systems for factory devices.
Corresponding vulnerabilities can be found at: https://www.sebug.net/vuldb/ssvid-88844 (click [Read the original text] to visit).
