Last active
November 28, 2019 22:00
-
-
Save Exchizz/f81426096613a34532f28336251995ec to your computer and use it in GitHub Desktop.
Logitech spotlight vibrator PoC written in python with pyusb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import usb.core | |
import usb.util | |
import sys | |
from pprint import pprint | |
# find our device with lsusb | |
# 046d:c53e | |
dev = usb.core.find(idVendor=0x046d, idProduct=0xc53e) | |
# was it found? | |
if dev is None: | |
raise ValueError('Device not found') | |
for interface in range(3): | |
if dev.is_kernel_driver_active(interface) is True: | |
print("Kernel detach {}".format(interface)) | |
# tell the kernel to detach | |
dev.detach_kernel_driver(interface) | |
# claim the device | |
usb.util.claim_interface(dev, interface) | |
# I got these numbers from wireshark running in linux while VM Windows was going through the Logitech presentation | |
bmRequestType = 0x21 | |
bmRequest = 0x09 | |
wValue = 0x0210 | |
wIndex = 2 | |
msg = [0x10,0x01,0x09,0x1d,0x03,0xe8,0x80] | |
ret = dev.ctrl_transfer(bmRequestType, bmRequest, wValue,wIndex, msg) | |
assert(ret == len(msg)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment