USBdriveby – Exploiting USB in Style
A USB device that emulates a keyboard and mouse can exploit a machine's blind trust in USB input devices to type commands, move the mouse, and click through security prompts, thereby installing a backdoor, disabling a firewall, and changing DNS settings without authorisation. An attacker with brief physical access could gain persistent remote control of the machine.
samy.pl
Published on samy.pl
In this project, we'll learn how to exploit a system's blind trust in USB devices, and learn how a $20 Teensy microcontroller can evade various security settings on a real system, open a permanent backdoor, disable a firewall, control the flow of network traffic, and all within a few seconds and permanently, even…
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the operating system grants implicit trust to USB human interface devices, allowing them to send arbitrary keystrokes and mouse clicks without any authorisation or user confirmation.
Impact
An attacker with brief physical access could install a persistent backdoor, disable the firewall, and redirect network traffic, even after the device is removed.
What the attacker needed
Physical access to an unlocked machine; a USB port; the target runs OS X (or similar)
How it was found
- Plug the USBdriveby device into an unlocked machine.
- The device emulates a keyboard and mouse and sends keystrokes to launch applications via Spotlight/Alfred/Quicksilver.
- It uses AppleScript to resize and position the System Preferences window, then moves the mouse to click buttons that change DNS settings without a password.
- It sends keyboard shortcuts to permanently allow outbound connections in the Little Snitch firewall.
- It installs a reverse shell in crontab that connects back to a remote server every five minutes.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
When you plug in a keyboard or mouse, the computer starts accepting its input immediately without asking for permission. This project shows that a small, custom USB device can pretend to be a keyboard and mouse and use that trust to type commands and click buttons on screen. Because the computer cannot tell the difference between a real keyboard and a fake one, an attacker who briefly plugs in the device can take control of the machine.
What is Misconfiguration?
Settings left unsafe: exposed panels, open storage buckets, debug modes, default credentials.