TcIo.sys
TcIo.sys and TcRouter.sys are WHQL Microsoft-signed kernel drivers from Beckhoff Automation GmbH (TwinCAT 3 Industrial Automation Runtime). TcIo.sys exposes arbitrary physical memory read/write via ZwOpenSection on Device\PhysicalMemory, arbitrary MMIO mapping via MmMapIoSpace, PCI configuration space read/write via HalGetBusDataByOffset and HalSetBusDataByOffset, and full PCI BAR probing and mapping. TcRouter.sys exposes arbitrary port I/O via direct ring-0 in/out instructions. Both drivers use plain IoCreateDevice with no DACL and have no caller validation on IRP_MJ_CREATE. All IOCTLs use METHOD_NEITHER with FILE_ANY_ACCESS. No hardware gate -- drivers load on any x64 Windows without Beckhoff hardware. CVE-2018-7502 was assigned for an untrusted pointer dereference in IOCTL 0x222206 affecting 19 drivers in the TwinCAT family (CISA advisory ICSA-18-081-02, Source Incite SRC-2018-0007). The physical memory and port I/O primitives described here go beyond the scope of CVE-2018-7502. 18 related drivers share the same codebase and certificate.
Known samples 2
2 recorded TRUE · 0 recorded FALSE · 0 unknown for loading despite HVCI. Results apply to individual samples.
TcIo.sysSample 1 · HVCI TRUE
- MD5
508fce0a671bdd7f157c3f456bb7d33e- SHA1
89edecb8860105b06b707af91d8831af2c5521ff- SHA256
e0c58531501d6176ed0f632addca977616b0dab460f32f0a5909d21f828fc63b- Imphash
2296feba7970ee2c7866c1c500eb162c- Authentihash MD5
f5e4cd493e9b8fecc74bcd5522b64556- Authentihash SHA1
5fd984796147df626f3edae056863bb46af277fe- Authentihash SHA256
6a7bd55c6706e69b134aabcf4a006b14efb98a26eb1a23cd6402ca17cfc3eef3- Machine
- AMD64
- Version
- 3.1.0.2104
- Publisher
- Beckhoff Automation GmbH
TcRouter.sysSample 2 · HVCI TRUE
- MD5
aae460e5be936aeb0e79317927d79ca0- SHA1
9322d0a40abd3a25ac53006c483b8974edfb953a- SHA256
d89938a469e8e4b429507522b5a52cb6f87c50f559f22f3042921631b768e59a- Imphash
872daab1baf534a62c538d0a37cab271- Authentihash MD5
2eafd69d7d76b86abff25c3bb5e37498- Authentihash SHA1
67596d0bf855b7cbdce5cf3fe99d1581ca0231fb- Authentihash SHA256
33bdf2ede15d5fed1f4f2fc4368419c72aec005e0d489b1cf074a8f74e53a055- Machine
- AMD64
- Version
- 3.1.0.2355
- Publisher
- Beckhoff Automation GmbH & Co. KG
Recorded command
sc.exe create TcIo binPath=C:\windows\temp\TcIo.sys type=kernel && sc.exe start TcIoElevate privileges · Privileges: kernel · OS: Windows 10
Research & references
Acknowledgement: Patrick Saif @weezerOSINT

