Security Experts:

Connect with us

Hi, what are you looking for?



“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.

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 a contributing editor at SecurityWeek. He worked as a high school IT teacher for two years before starting a career in journalism as Softpedia’s security news reporter. Eduard holds a bachelor’s degree in industrial informatics and a master’s degree in computer techniques applied in electrical engineering.

Click to comment

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.

Join this webinar to learn best practices that organizations can use to improve both their resilience to new threats and their response times to incidents.


Join this live webinar as we explore the potential security threats that can arise when third parties are granted access to a sensitive data or systems.


Expert Insights

Related Content


Less than a week after announcing that it would suspended service indefinitely due to a conflict with an (at the time) unnamed security researcher...

Risk Management

The supply chain threat is directly linked to attack surface management, but the supply chain must be known and understood before it can be...


Apple has released updates for macOS, iOS and Safari and they all include a WebKit patch for a zero-day vulnerability tracked as CVE-2023-23529.


Patch Tuesday: Microsoft warns vulnerability (CVE-2023-23397) could lead to exploitation before an email is viewed in the Preview Pane.

Application Security

Drupal released updates that resolve four vulnerabilities in Drupal core and three plugins.

Cloud Security

VMware vRealize Log Insight vulnerability allows an unauthenticated attacker to take full control of a target system.

IoT Security

Lexmark warns of a remote code execution (RCE) vulnerability impacting over 120 printer models, for which PoC code has been published.

Application Security

A CSRF vulnerability in the source control management (SCM) service Kudu could be exploited to achieve remote code execution in multiple Azure services.