Connect with us

Hi, what are you looking for?

SecurityWeekSecurityWeek

Vulnerabilities

“USBdriveby” Emulates Mouse and Keyboard to Hijack Computers

A $20 USB microcontroller that someone can wear around their neck can be used to weaponize mouse clicks and keyboard actions in an effort to install backdoors, evade firewalls and modify DNS settings in a matter of seconds, a researcher has demonstrated.

A $20 USB microcontroller that someone can wear around their neck can be used to weaponize mouse clicks and keyboard actions in an effort to install backdoors, evade firewalls and modify DNS settings in a matter of seconds, a researcher has demonstrated.

Security researcher Samy Kamkar has taken a Teensy 3.1 USB-based microcontroller and fitted it with software that can emulate a mouse and a keyboard when connected to a computer. The gadget, dubbed USBdriveby, leverages the fact that many systems blindly trust USB devices connected to them.

Once it’s plugged in to a machine, USBdriveby immediately starts performing mouse and keyboard actions, which allows it to carry out a wide range of tasks, such as opening a backdoor, disabling the firewall, and controlling traffic flow by changing DNS settings. After the device is disconnected, the attacker has full access to the targeted computer.

“When you normally plug in a mouse or keyboard into a machine, no authorization is required to begin using them,” the researcher explained. “The devices can simply begin typing and clicking. We exploit this fact by sending arbitrary keystrokes meant to launch specific applications (via Spotlight / Alfred / Quicksilver), permanently evade a local firewall (Little Snitch), install a reverse shell in crontab, and even modify DNS settings without any additional permissions.”

Kamkar’s example targets an OS X device, but the expert says the attack works just as well on machines running Windows and Unix-like operating systems. The source code for the microcontroller and the various operations performed by USBdriveby has been made available.

These types of attacks are not new, and there is reason to believe that the NSA has already been using such devices in its operations.

Advertisement. Scroll to continue reading.

Earlier this year, at the Black Hat security conference, researchers at Germany-based SRLabs demonstrated that a USB device’s firmware can be reprogrammed for malicious purposes. They called the attack “BadUSB.” The methods developed by SRLabs are more sophisticated than the ones used for USBdriveby, but the German researchers had not released the source code for their modified USB controller firmware.

In September, researchers Adam Caudill and Brandon Wilson released BadUSB source code after a presentation at the DerbyCon security conference. They argued that the code had to be made public so that people can learn how to protect themselves against such attacks.

However, USBdriveby is different from BadUSB and other similar devices, such as USB Rubber Ducky, because it also emulates a mouse, not just a keyboard. The USBdriveby code is available for both Teensy and Arduino microcontrollers. However, Kamkar has pointed out that some Arduino controllers, such as Arduino Nano, are not capable of emulating a USB keyboard or mouse.

USBdriveby is not Kamkar’s first interesting project. One year ago, he developed a drone that could autonomously seek out, hack and take over nearby drones.

Written By

Eduard Kovacs (@EduardKovacs) is senior managing editor at SecurityWeek. He worked as a high school IT teacher before starting a career in journalism in 2011. Eduard holds a bachelor’s degree in industrial informatics and a master’s degree in computer techniques applied in electrical engineering.

Daily Briefing Newsletter

Subscribe to the SecurityWeek Email Briefing for the latest cybersecurity threats, trends, and expert insights.

Click to comment

You must be logged in to post a comment Login

Leave a Reply

Daily Briefing Newsletter

Subscribe to the SecurityWeek Email Briefing to stay informed on the latest threats, trends, and technology, along with insightful columns from industry experts.

NOW LIVE: CISO Forum 2026 Summit

Join as we bring together CISOs, senior cybersecurity executives, practitioners, industry experts, and other security leaders to share practical experience and examine the issues shaping enterprise cybersecurity strategy.

Register

Join to learn the four levels of architecting security into the agentic SDLC – from securing the code your developers' agents write to running a coordinated system of security agents you've built yourself.

Register

People on the Move

Kirsten Davies has been appointed National Cyber Director.

Zifino has appointed Toney E. Jennings as CRO.

Zeke Maldonado has been named Principal Deputy CIO at the US Department of Commerce.

More People On The Move

Expert Insights

Daily Briefing Newsletter

Subscribe to the SecurityWeek Email Briefing to stay informed on the latest cybersecurity news, threats, and expert insights. Unsubscribe at any time.