VR主題已經成為一種現代化趨勢,它使電腦科幻小說轉化成的光影圖像更接近現實。因此,也毫不奇怪大家對它保持著不變的熱情。多年來,VR耳機的價格已經遠遠低于最開始第一款產品發布時的價格。毫無疑問,未來VR設備在任何家庭中都將會變得像臺式電腦一樣自然。根據IDC的數據,到2021年,VR耳機的出貨量將達到6700萬臺。
這就是為什么我們決定研究一下VR頭戴式設備——也就是VR眼鏡,以了解一個網絡犯罪分子可以如何玩它,以及可能會對設備主人造成什么傷害。
我們研究了攻擊者可能使用的以下攻擊場景:
如果您發現本文至少有一半像我們做的那樣有趣,歡迎閱讀我們對HTC Vive安全性的簡短回顧。
HTC Vive是目前市場上最廣泛的VR設備之一,同時它也激起了大多數研究者的興趣。讓我們先從分析VR系統的組件及其功能開始,HTC Vive由4個主要部分組成。
Fig 1. HTC Vive 眼鏡
眼鏡的主要目的是對用戶頭部進行位置跟蹤并將圖像輸出到VR眼鏡的顯示器。它既是系統中最重要也是最有趣的部分,它配備了攝像頭和32個位置跟蹤傳感器,另外還包含四個連接口:
最開始將設備連接到PC時就用到了三個連接口,只有一個USB連接口保持空閑狀態以供外部設備連接。
在系統工作時,眼鏡是唯一一個會始終連接到PC的組件。通過拆解眼鏡,我們可以接觸到它的主板,以及所有我們感興趣的部分。
主板的第一面上主要有四個組件:
圖2.眼鏡主板第一面
第二面還有幾個重要組件:
圖3.眼鏡主板第二面
圖4.HTC Vive基臺
基臺的主要目的是追蹤用戶的位置,它們以每秒60次的周期發送同步脈沖,然后在房間中從上到下、從左到右投射激光束,傳感器收集捕捉到的數據并將其發送給眼鏡和控制器手柄里的微控制器處理以追蹤用戶的位置。
基臺配備電源和用于同步的Jack 3.5,其中每一個工作站還帶有一個藍牙模塊,用于發送有關設備正在進入或退出睡眠模式的通知。
在基臺內部,有NXP 11U37F (ARM Cortex-M0) 芯片,負責基臺的主要功能。
圖5.底座主板第一面
Broadcom BCM20736 (ARM Cortex-M0) 保證了藍牙的運行。還有RS-485/RS-422收發器,通過Jack 3.5同步基臺的兩個工作站。
圖6.底座主板第二面
基臺和PC之間的交互接近于零(僅限于更新程序),而眼鏡會在硬件級別下借助激光束進行通信,如果光束的工作方式發生任何變化,系統都將無法正常運行。
圖7.HTC Vive 手柄
很明顯,控制器手柄用于追蹤用戶的手部動作以確保用戶獲得完整的VR體驗。至于連接口,它們僅配備microUSB進行充電和更新。但它里面是什么?好吧,里面有基于Cortex-M0的NXP 11U37F處理器,它維護著控制器的主要功能。另外還有FPGA ICE40HX8K-CB132用于處理響應基臺投射的激光束的傳感器;和一個4 Mb Micron M25P40芯片。乍一看,很難發現藍牙芯片,因為它是一個隱藏在金屬屏幕下的wall-flower Nordic nRF24LU1P。
圖8. HTC Vive控制器手柄主板
圖9. HTC Vive的鏈接盒
鏈接盒是PC和眼鏡之間的樞紐,它的一側有四個連接口:
另一側,有三個眼鏡連接口:
我們可以很容易就找到了其所需的藍牙芯片,以便快速便捷地進行設備更新。
瀏覽了SteamVR軟件文件夾后,我們找到了兩個有用的程序:lighthouse_console.exe和lighthouse_watchman_update.exe。第一個是用于處理HTC Vive設備的控制臺,后者則可以更新眼鏡設備。
通過執行lighthouse_console中的help命令,我們可以看到列出的以下命令:
lh> help
associatecontroller Associated the attached controller to the attached puck
axis Toggle VRC axis data dumping
battery Print battery status
button Toggle button data dumping
clear Clear the record buffer and accumulated statistics.
dump Toggle all dumping to the console. You must also turn on the individual { imu, sync, sample } flags.
errors Dump the lighthouse error/status structure.
event Toggle lighthouse aux event dumping
eventmask Select lighthouse aux events to report
isp Enable In-System Programming
haptic [us] Trigger haptic pulse
identifycontroller Trigger haptic pulses on the active serial number to identify it
imu Toggle IMU data packet dumping
imustats Print IMU statistics
period Print sync statistics
dis [<type=auto>] Toggle disambiguation. types={ auto, tdm, framer, synconbeam }
syncd Toggle sw sync detect
pose Toggle static pose solver. Is 'dis' is not active, it will enable it.
poweroff Turn off the active controller
record Toggle event recording. You must also turn on the individual { imu, sync, sample } flags.
serial Select a device to open by serial number substring
sensorcheck Print out hits (and widths) per sensor
save [<filename="lighthouse_console_save.txt">] Save recorded events to a file on disk
sync Toggle sync dumping
sample Toggle sample dumping
trackpadcalibrate Trigger trackpad recalibration on the active controller
uploadconfig [<filename>] Upload the config file to the device
downloadconfig [<filename>] Download the config file
reformatconfig <inputfilename> <outputfilename> Update the config to the latest json format
version Prints the firmware and hardware version on the Watchman board
userdata Get a directory listing of the stored userdata
userdatadownload <name> Download the specified named userdata
userdatadownloadraw <addr> <size> [<filename>] Download and store the user data at specified address
userdatasize Display the size of the user data space (in bytes)
ispdiv <divisor> Set the camera ISP sync signal divisor
quit Quit
但如果在IDA Pro中打開程序則可以看到更多內容:
if ((unsigned __int8)sub_402210(v11, "pair")){
v173[1] = 0;
if (*(_DWORD *)(v217 + 16) == 8449)
sub_42EC30(10000, (char)v173[1]);
else
sub_42ED10((char)v173[1]);
goto LABEL_497;
}
if ((unsigned __int8)sub_402210(v11, "pairall")){
sub_40C4C0(15000, 0);
goto LABEL_497;
}
if ((unsigned __int8)sub_402210(v11, "forcepairall")){
sub_40C4C0(15000, 1);
goto LABEL_497;
}
if ((unsigned __int8)sub_402210(v11, "unpair")){
sub_42BA80(v217);
goto LABEL_497;
}
if ((unsigned __int8)sub_402210(v11, "unpairall")){
sub_40FEF0();
goto LABEL_497;
}
if ((unsigned __int8)sub_402210(v11, "hmdhidtest") )
以下是help命令未列出的命令,但它們仍然在該程序中:
借助此列表,我們可以通過各種方式來測試設備,比如檢查按鈕的狀態。我們也可以下載配置文件,在上傳回來,并執行其他特殊操作。
有了lighthouse_watchman_update.exe,攻擊者可以輕松更新任何設備的固件,這是上文中每種攻擊場景的基礎。此外,大多數微控制器的固件可以通過相鄰目錄訪問,盡管它們各自的功能并不十分清晰。
Usage: lighthouse_watchman_update [OPTIONS] [args...]
Options:
-h Prints this message
-m<dev> Update main firmware (default)
-f<dev> Update FPGA firmware
-r<dev> Update radio firmware
-j<dev> k1,f1 k2,f2 ... Update user data {key,filename}. Multiple files supported. Erases prior user data.
-u <dir> Update all devices with firmware in the specified directory
-U <dir> Same as '-u' option but forces update
-x Do not reset device after successful update
-b<dev> Reset device into bootloader mode
-i<dev> Reset bootloader device into ISP mode
-R<dev> Reset into main firmware from the bootloader
-B <num> Set board revision
-l<dev> <num> Set date/lot code
-a<dev> Print bootloader attributes
-c Print CRC128
-d Update watchman dongle
-D Update watchman dongles and/or convert Steam Controller dongles to watchman
-g<dev> Update fuel gauge firmware
-t <path> Reads timestamp information from a watchman firmware image
-s <serial num> Update the device with matching serial number
--via-dongle Perform watchman firmware updates via a dongle radio connection
--via-bootloader (Watchman v3 devices only) Sends the update via the device's bootloader
--via-application (Watchman v3 devices only) Sends the update via the device's application interface
--force-update (Watchman v3 devices only) Forces an update onto a device
--target=<target> (Watchman v3 devices only) Sets the update target. Available targets:
application, bootloader, ice40, max10, nrf52, bq27520, user, default (set by file)
<dev> device 'w' for watchman 'w3' for watchman v3 'v' for VRC 'n' for NEO_VRC
(default is watchman)
眼鏡主板是整個實驗中最有趣的部分,許多重要的硬件部分都在它上面,它還有很多調試連接口。幸運的是,大多數微控制器都不屬于BGA情況,這也是我們設法找到某些芯片的SWD連接口的原因。圖10顯示了其中一個NXP LPC11U35F。
圖10.NXP LPC11U35F的SWD連接口
為了理解每個微控制器執行的功能并重建組件之間的連接,我們使用了焊接器和萬用表。
圖11.萬用表和焊臺
我們拆開了主板,用我們的萬用表測出了路徑,并制定了組件之間的連接方案(見圖12)。
圖12. HTC Vive組件之間的連接方案
我們之前說過,眼鏡有USB-Hub SMSC USB5537B,其可通過1個USB連接多達7個設備,其中6個可用端口被耳機的主要部件占用,而剩余的外部端口保持空閑以提供給附加設備進行連接。該方案說明不可能從眼鏡側面進入視頻輸出處理,因為它是一個負責程序的PC。FPGA監控32個眼鏡傳感器的狀態,處理它們發出的所有數據,并通過UART傳遞給NXP LPC11U35F/401微控制器。
我們可以得出什么結論?
我們首先想到的是視頻流不會受到任何影響,因為它是由PC處理的,PC將渲染的圖像發送到眼鏡,因此攻擊場景2和3不適用。
其次,我們發現芯片(NXP LPC11U35F/401)負責追蹤眼鏡的位置并通過USB將它們發送到PC。因此,網絡犯罪分子可以修改處理位置數據的系統,以便用戶的虛擬位置與真實位置不同,此情況可對應于攻擊場景1。
然后,我們必須找出存儲在微控制器上的固件,所有微控制器和內存都已經拆焊過,所以,我們需要從中讀取數據,在我們的焊臺的幫助下,我們將微控制器焊接到TQFP適配器上(參見圖13):
圖13.連接到TQFP適配器的芯片
不幸的是,我們找不到SPI內存芯片的適配器,因為它有更少的排針。所以我們只是為它們焊接了一個排針。
圖14.帶有焊接排針連接口的SPI存儲器,用于連接編程器
ChipProg481和一堆電線在提取固件時派上了用場!
圖15.連接到它的ChipProg481和STM32F072。
我們從控制器中提取數據以進行更改,但是其中的所有組件都沒問題,所以我們不必拆除它們。由于連接到SWD的BlackMagick Probe v2,從兩個微控制器提取數據的過程是絕對無縫的。
圖16. Black Magick Probe v2.1連接到控制器板手柄上的SWD
根據收集的數據,我們建立了一個表格,以清晰地說明使用了哪些固件以及在每個微控制器上執行了哪些功能。
Dump 源 | 從SteamVR軟件中提取的固件 | 附加信息 |
---|---|---|
Micron N25Q032A13ESE40E 32 Mb | Micron N25Q032A13ESE40E 32 Mb | Addresses from 0xF8000 to 0xF9C1DF were not found in the SteamVR firmware. |
STM32F072 | DisplayBin tools/lighthouse/firmware/htc/APP_0000000000200160.bin | Addresses from 0x0 to 0x26c8 were not found in the SteamVR firmware. |
Micron M25P40 4 Mb | DisplayBin tools/lighthouse/firmware/htc/APP_0000000000200160.bin | – |
nRF24LU1P | DongleBin tools/lighthouse/firmware/vr_controller/archive/htc_vrc_ dongle_1461100729_2016_04_19.bin |
– |
NXP 11U35F | WatchmanBin tools/lighthouse/firmware/lighthouse_rx_watchman/archive/ htc_watchman_1462663157_2016_05_07.bin |
Configuration archive. |
Micron N25Q032A13ESE40E 32 Mb | WatchmanFPGABin tools/lighthouse/firmware/lighthouse_rx_watchman/archive/ htc_pre_watchman_262_fpga.bin |
PNG_1 Green_4A7A16BB004239_mura_analyzes.mc PNG_2 Green_4A8A16B8004487_mura_analyzes.mc. |
表1.提取的固件與存儲在SteamVR軟件文件夾中的固件之間的比較
HTC Vive的安全問題很早在更新階段就出現過,根據微控制器文檔記載,所有微控制器都支持通過USB進行更新。從固件文件判斷,我們很清楚固件是沒有校驗和的二進制文件。因此,攻擊者可以根據自己的喜好修改固件并將其上傳到眼鏡中。此外,每個微控制器都有足夠的空間(平均45 Kb),以便將修改后的代碼放入其中。Change,upload,enjoy!
例如,在NXP LPC11U35文檔中,陳述如下:
- In-System Programming (ISP) and In-Application Programming (IAP) via on-chip bootloader software.
- ROM-based USB drivers. Flash updates via USB supported.
- ROM-based 32-bit integer division routines
STM32F072文檔:
The boot loader is located in System Memory. It is used to reprogram the Flash memory by using USART on pins PA14/PA15, or PA9/PA10 or I2C on pins PB6/PB7 or through the USB DFU interface.
nRF24LU1P:
The nRF24LU1+ bootloader allows you to program the nRF24LU1+ through the USB interface. The bootloader is pre-programmed into the nRF24LU1+ flash memory and automatically starts when power is applied.
如上所述,有一個特殊的lighthouse_watchman_update.exe控制臺工具可用,而惡意代碼也可以使用它來進行攻擊或實現工具本身的功能。
從HTC_Vive_Tracker_Developer_Guidelines_v1.3可以看出,設備更新的時候用到了以下命令:
- Update MCU’s firmware:
- lighthouse_watchman_update -mnt tracker_mcu_filename.bin
- Update FPGA’s firmware:
- lighthouse_watchman_update -fnt tracker_fpga_filename.bin
- Update RF’s firmware:
- lighthouse_watchman_update -rnt tracker_rf_filename.bin
如果可以更新HTC Vive的軟件,攻擊者就可以添加可能影響系統運行的惡意代碼,并可能導致設備所有者的身體傷害或造成其他不便。
該設備的更新版本在不久前已經發布。但不幸的是,我們還沒有機會研究專業版。盡管如此,有關HTC Vive Pro的可用信息表明基本版本沒有發生根本性的變化。雖然一些微控制器確實更新了,但設備的整體操作原理和其組件之間的交互仍然是相同的。他們只是稍微改變了主板的布局(目前改變了兩個),以及調整了連接器的放置方式。
還有一項尚未實現的真正的新功能:開發人員宣布他們將發布一款配件,可以將設備從線路中解放出來,并借助WiGig技術通過無線信道來傳輸數據。然而,除了有用的功能之外,這種新穎性也帶來了另一種攻擊向量。
總而言之,我們列出了關于上述攻擊情形的結論清單:
HTC vive是一種高科技設備,但顯然它的安全性并不是開發人員的優先考慮的事項。
攻擊者可以輕松訪問HTC Vive中使用的每個微控制器的固件,修改并將其上傳回眼鏡。因此不僅會破壞游戲體驗,還會傷害所有者。
多年后,VR和AR技術將變得更先進和發展,技術的安全問題也將如此。不幸的是,該技術的安全問題同時也可能會變得更加嚴峻和危險。