正如预期的那样,确实检测到了 USB,但由于 Linux 在没有适当驱动程序的情况下不知道如何处理它,它只解析其硬件相关参数(供应商和产品 ID)并在那里停止。
下面分别是 USB 设备的入口usb-devices和lsusb命令:
# usb-devices
[...]
T: Bus=01 Lev=02 Prnt=05 Port=00 Cnt=01 Dev#= 8 Spd=1.5 MxCh= 0
D: Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1
P: Vendor=3689 ProdID=8762 Rev=02.00
S: Manufacturer=USBKey
S: Product=USBKey
C: #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=50mA
I: If#= 0 Alt= 0 #EPs= 1 Cls=03(HID ) Sub=01 Prot=00 Driver=usbhid
[...]
# lsusb
[...]
Bus 001 Device 008: ID 3689:8762
[...]
我得出的结论是这是 USB 设备,因为这是两个文件*with_usb*和*without_usb*使用命令lsusb和usb-devices.
所以现在,我会在 USB 插入后立即开始嗅探从 USB 发送到操作系统的字节,大多数情况下无法理解它们,但也许编写一个模拟设备通信行为的驱动程序会是绕过在插入 USB 设备的情况下运行软件的强制性保护策略的最快和最简单的方法。
对于嗅探部分,您可以使用任何基于 的东西libusb,当然也可以使用任何脚本语言的包装器。我本人是 Python 的粉丝,所以这里有一个使用 Python 的 PyUSB 库的小脚本:
#!/usr/bin/env python3
try:
import usb.core
import usb.util
except ImportError:
print("Couldn't find 'pyusb' library!")
exit(-1)
# The 'Vendor' and 'Product' IDs from 'lsusb' or 'usb-devices' entries
vendorID = 0x3689
productID = 0x8762
# Assuming the first interface
usbIF = 0
# Find the USB device
# The USB must be plugged in before running the script
device = usb.core.find(idVendor=vendorID, idProduct=productID)
# Check if device exists
if device == None:
print("Device doesn't exist!")
exit(0)
# Check if device is attached, detach it
if device.is_kernel_driver_active(usbIF):
device.detach_kernel_driver(usbIF)
# Now you will want to fuzz a bit the USB endpoints
(inputCmds, outputCmds) = device[0][usbIF,0].endpoints()
如果模拟 USB 数据包有效,那将是一种更简单的方法来处理应用程序,而无需插入 USB 设备,无需反转 VMProtect 软件。