Is it possible to "trick" a Windows 10 PC into thinking a flash drive is a mouse to execute code on the machine? If so, how?
Note: I'm not trying to do anything malicious. All of this is strictly for learning purposes.
Information Security Stack Exchange is a question and answer site for information security professionals. It only takes a minute to sign up.
Sign up to join this communityIs it possible to "trick" a Windows 10 PC into thinking a flash drive is a mouse to execute code on the machine? If so, how?
Note: I'm not trying to do anything malicious. All of this is strictly for learning purposes.
As part of the USB protocol, every device has a data structure that it provides on connection that describes the device. This structure could also list multiple devices (as if the device was a hub with devices attached).
To make a flash drive pretend to be a mouse, you would have to reprogram the firmware in the device to present a different device descriptor, and may require extensive knowledge of the internals of the flash disk and a way to change the firmware. However there are many tools and tutorials available.
It might be much easier to use a device with a known programming capability, such as one of the Arduino variants. Several Arduino devices actually have examples of how to make them act like a USB keyboard or mouse. With a small Arduino such as the Teensy, it might even be possible to disguise it as a flash drive.
One possible legitimate use of this: I programmed an arduino to read infrared signals from TV remotes and translate those to keystrokes on a simulated keyboard.