Hackers distribute malicious USB devices as a gift card from Best Buy for its loyal customers as an attempt to trick the victim’s in using the device.
Trustwave found such a letter through their client and analyze the USB device further by plugging in air-gapped computers.
BadUSB Device
By observing the serial numbers and other information embedded in the device such as the serial number “HW-374” and by checking in Google researchers found a “BadUSB Leonardo USB ATMEGA32U4” for sale on shopee[.]tw website.
The USB device contains an Arduino microcontroller ATMEGA32U4 designed to work as a USB keyboard. Once it gets injected in the device it injects various malicious PowerShell commands.
Then it PowerShell commands download a JScript command and save it as prada.txt which is the third level payload.
The JScript is obfuscated and its primary function is to register the infected host with the command and control (C&C) server with a unique ID.
The JScript function is to gather the system information from the infected host. It gathers all the information about the affected host and sends it to the C&C server.
Following are the information it collects
- Username
- Hostname
- User’s System Privilege
- Uses WMI query to get the:
- Process owner
- Domain name
- Computer model
- Operating system information
- OS name
- OS build
- OS version
- Memory capacity
- Free memory available
- OS registered user
- OS registered organization
- OS serial number
- Last boot uptime
- Install date
- OS architecture
- OS product type
- Language code
- Time zone
- Number of users
- Desktop monitor type
- Desktop resolution
- UAC level privilege
- Office and Adobe acrobat installation
- List of running Processes (including PID)
- Whether the infected host is running in a virtualized environment
After processing every command the JScript sleeps for two minutes and then gets the new command from the C&C server.
Here is the full attack chain.
- BadUSB distributed through gift cards.
- BadUSB plugged in with the Laptop
- Get’s recognized as a trusted USB device.
- Types in the PowerShell command.
- Executes stage 2 PowerShell script.
- Malware get’s installed in the system.
- Unpacks JScript command and save it as prada.txt
- Executes malware.
The USB devices are often used by security professionals for conducting physical pentests, these devices are dropped in parking lots or waiting rooms.
Attackers generally use spam email campaigns as a method to distribute malware, but here they have used the USB method to deliver the malware.