The invention relates to universal serial bus (USB), particularly to prevention of USB firmware hacking.
A USB device firmware hack called BadUSB was presented at Black Hat USA 2014 conference, demonstrating how a USB flash drive microcontroller can be reprogrammed to spoof various other device types in order to take control of a computer, exfiltrate data, or spy on the user. Other security researchers have worked further on how to exploit the principles behind BadUSB, releasing at the same time the source code of hacking tools that can be used to modify the behavior of different USB devices.
Robert Fisk provides hardware USB firewall called USG for preventing BadUSB. It is a hardware dongle that sits between a USB port and untrusted USB devices. It will only pass a limited set of instructions and data between the two, not including the instructions used to trigger BadUSB. However, although the USG is effective in preventing BadUSB, it cannot be used for the newest USB type-C. A software firewall will be a much better solution than hardware one, but there is no anti-virus software which can prevent BadUSB attack because the attack program code of BadUSB is hidden in firmware of devices and cannot be scanned by any anti-virus software.
An object of the invention is to provide a method for preventing BadUSB attack, which is software and can be used to all types of USB ports without hardware limitations.
To accomplish the above object, the method for preventing BadUSB attack of the invention includes the steps of: a) obtaining a device description from a USB (universal serial bus) device; b) judging if the device description is reasonable; c) loading a driver for the USB device when yes in step b); d) filtering a command from the USB device after step c); and e) disabling the USB device when no in step b) or the command filtered in step d) is malicious.
Please refer to
The second step is that the USB device 2 declares itself to the host computer 1. When the USB device 2 has been injected with BadUSB, the USB device 2 will typically declare itself to be a keyboard and a storage device. In the third step, the host computer 1 loads a corresponding driver for the USB device 2. In the fourth step, the host computer 1 polls requests of all external devices including the USB device 2 with BadUSB. In the final step, the USB device 2 with BadUSB inputs malicious attack commands to the host computer 1. As a result, the host computer 1 is hacked or infected.
Please refer to
In step S3, the host computer 1 loads a driver for the USB device 2 when yes in step S2. When the USB device 2 passes the first detection, the USB device 2 is preliminary judged safe, so that the USB device 2 can be connected to the host computer 1 by loading its driver. In step S4, the software program filters all commands from the USB device 2 after step S3. Because the USB features are alterable, the abovementioned first detection cannot completely guarantee safety of the USB device 2. When a malicious USB device 2 with BadUSB passes the first detection in step S2 and its driver is loaded in the host computer 1, the malicious USB device 2 will become a keyboard and start inputting malicious commands to the host computer 1. Accordingly, step S4 adopts USB layer firewall to block malicious attack. In other words, step S4 serves as the second level of detection. Such a USB layer firewall is implemented by using a Filter driver, which can be arranged at any level.
It will be appreciated by persons skilled in the art that the above embodiment has been described by way of example only and not in any limitative sense, and that various alterations and modifications are possible without departure from the scope of the invention as defined by the appended claims.