USB attacks explained

Krzysztof Opasiak, Warsaw, Poland

LVEE 2017

USB is the most common external interface in the world. Even machines which, for security reasons, are disconnected from the Internet often offer USB connectivity. This creates a new attacks surface for skilled hackers.
USB implementation may be exploited on various levels. To effectively protect against such attack, knowledge about already exploited vulnerabilities is required. This paper is a survey of state-of-the-art USB-related attacks.

Introduction
On a very high level, USB is a communication protocol which allows to provide and use some abstract services (functionalities). Machine which provides some additional functionality is called a USB device and machine which uses this functionality is called a USB host. Typically USB host is a computer, DVD player etc. and USB device is a pendrive, web camera or sound card but it can also be a mobile phone or tablet!
One of very famous USB features is Plug&Play. It means that USB host is able to automatically detect new USB devices and discover functionalities offered by them. Together with automatic support provided by most of host operating systems it makes USB very user-friendly and easy to use. Unfortunately, the same automation may lead to new security threats. . .

USB attacks
Popularity and blind trust in USB security seem to be one of the major reasons why malware started spreading also using this attack vector. From the security perspective we can distinguish three types of attacks toward USB based on their main target:
• USB host focused attacks,
• USB traffic analysis, modification and injection attacks,
• USB device focused attacks.

USB host focused attacks
This type of attacks aims at taking over the control of the USB host machine.
We can distinguish three subgroups of such attacks.
The first group of such attacks uses vulnerabilities in the high level system infrastructure related to support of given USB function. Very good examples of such attacks are Conficker 1 and Stuxnet 2, which used the vulnerabilities in external storage support.
The second group of USB host focused attacks tries to exploit vulnerabilities in USB stack and drivers implementation. This is mainly done by creating malicious devices which sends specially prepared payload to exploit some buffer overflow or other vulnerability. Very good repentant of such attacks is Plug & Root device presented during BlackHat Conference in Las Vegas back in 2005 3.
Thanks to dedicated fuzzers like facedancer 4 and umap 5 and increasing developers’ awareness USB stacks (esp. Linux stack) are getting more and more resistant to this group of attacks.
Finally, the third group of attacks abuses Plug & Play philosophy and blind user trust in harmlessness of USB devices. This group of attacks became famous in 2014 thanks to BlackHat USA presentation – BadUSB 6. This attack simply tries to trick user to connect device which offers different functionality than user may assume based on its physical outfit.

USB traffic analysis, modification and injection attacks
This type of attacks usually aims at discovering some secret information like passwords or at modification of USB traffic to abuse functionality expected by user.
First group of those attacks are passive listeners usually recording HID protocol which is used by for example keyboards. Those devices are relatively cheap and are being found from time to time in public places like libraries 7 or schools 8.
Second group involves not only listening but also modification of USB traffic and injection of additional messages. Recent example of such attacks may be BadUSB 2.0 introduced by David Kierznowski and described in 9.

USB device focused attacks
Third type of attacks is targeted at USB devices. Usually not those simple tiny device lie pendrive because people try to keep them safe but rather those more complicated like mobile phones and tablets. All those devices carry a lot of sensitive user data which can be accessed via USB. It’s worth to mention that the same USB port is often used for both data transfer and battery charging. Short battery life encourages user to connect mobile device to publicly available charging stations.
This leads to hazard of unauthorized access to private data like photos or contacts. More advanced attackers may event try to take over the control of device using for example ADB resource exhaustion attack 10.

SummaryUSB is a extremely popular external interface. It has been adopted to various use case and incorporated by most devices on the market. Through being extremely usefully, USB should be also considered as a real security thread especially in high security environments.