Black Hat: How to make and deploy malicious USB keys
- 05 August, 2016 01:17
USB keys were famously used as part of the Stuxnet attack on the Iranian nuclear program and for good reason: it’s got a high rate of effectiveness, according to a researcher at Black Hat 2016.
Of 297 keys spread around the University of Illinois Urbana Champaign 45% were not only plugged into victims’ computers but the victims then clicked on links in files that connected them to more malware, says Elie Burstzein, a Google researcher who presented the results.
That rate was pretty constant regardless of where the keys were dropped and what they looked like, he says. Keys were left in parking lots, common rooms, hallways, lecture halls and on lawns. Some had no labels but others did that said confidential and exam answers. Some had metal door keys attached on a ring and some had door keys plus a tab with an address and phone number.
More than half of those that were opened were opened within the first 10 hours.
Twenty-one percent of those who plugged in the devices then took a survey to say why they did. Sixty-eight percent said they wanted to return the drives and 18% said they were just curious and the rest had various other reasons.
What were they curious about? Pictures were consistently popular at 33% to 45% depending on the type of key that was picked up. Resumes were about as popular as photos with a spike in interest to 53% for those keys that were unlabeled. Other documents not so much.
Burstzein says building the keys was not trivial. The team he worked with had to figure out how to make a device small enough to fit into a key case, create a mold for the case, pour the resin, figure out how to unmold it so it had a smooth look and trim it to appear professional. It took weeks to perfect the techniques. Each one cost about $40.
The team also spent a lot of time writing code for the keys that could figure out what operating system was running on the machine they were plugged into. One test was a shell script that tried to lock the scroll lock key. If it worked, it was a Windows machine.
It was difficult to test the timing between commands and know they were successfully executed so they used caps-lock toggling as an indicator. When a command was successful, it would toggle the switch as a feedback bit, he says.
The code used reverse shell to get thorough the firewalls, scripting language and obfuscation to avoid antivirus detection, used a payload that delivered a maximum 62.5 keystrokes per second and used metasploit to act as a command and control server.
Preventing USB key attacks isn’t easy. The best methods are to educate users not to plug them in, block their use altogether on machines or restricting use.