Backdoor:OSX/DevilRobber.A silently installs applications related to Bitcoin-mining; it may also harvest data from the infected machine and listen for additional commands from a remote user.
Disinfection & Removal
Manual Removal Instructions
The following instructions apply to the original version of DevilRobber:
- 1. Delete this folder and all its contents: ~/Library/mdsa1331
- 2. Delete this file: ~/Library/LaunchAgents/com.apple.legion.plist
The following instructions apply to the updated version of DevilRobber (DevilRobberV3):
- Delete the folder and all its contents: ~/Library/Pixel_mator
- Delete this file: ~/Library/LaunchAgents/com.apple.pixel.plist
Note: For both versions, subsequently continuing to use the bundled software will reinstall the malware.
The components of this malware are bundled together with (pirated) legitimate programs. At time of writing, these programs were being offered on the popular torrent-hosting website, The Pirate Bay.
Once active, the malware is capable of stealing information from the infected system; it may also run (separate) applications related to Bitcoin mining.
The technical details listed below are for the original DevilRobber version. This version was also discussed in a Labs Weblog post.
Update (17 Nov 2011)
An updated version of DevilRobber has been discovered, with minor changes in its distribution and operation. This version was discussed in a Labs Weblog post.
Unlike the original version, the updated one identified as DevilRobberV3 is distributed using the file name PixelMator; in addition, the distributed file does not itself contain the backdoor component, but on installation must download the actual backdoor installer package from a remote FTP server.
On execution, DevilRobberV3 will first drop the file, d_status.cfg, in the same directory where it was executed, then download the installer from the remote server and save it as binary.zip. The contents of the package are then extracted and executed.
In addition to the changed distribution method, DevilRobberV3 has the following changes in its information harvesting script:
- It no longer captures a screenshot
- It no longer checks for the existence of LittleSnitch (a firewall application)
- It uses a different launch point name
- It harvests the shell command history
- It harvests 1Password contents (a password manager from AgileBits)
- It now also harvests the system log file
The malware's routine of attempting to steal Bitcoin wallet contents remains unchanged.
Upon execution of the bundled software, the malware first checks if the following file is found in the system:
Little Snitch is a Mac OS X firewall program; if this is found, the malware will skip installation and proceed to execute the clean software as is.
If the firewall program is not present, the malware proceeds with creating the following launch point:
Then with copying its files to the~/Library/mdsa1331 folder.
In our analysis, the files created varied slightly between samples, but have generally consisted of the following:
- mdsa - The malware's main component (detected as Backdoor:OSX/DevilRobber.A.)
- startup.sh - The launch point points to this script, which executes mdsa. This script is detected as Backdoor:BASH/DevilRobber.A
- DiabloMiner - A legitimate application, containing the GPU Bitcoin miner files used by the malware.
- minerd - Another clean, CPU bitcoin miner application.
- miner.sh - This script executes the bundled bitcoin miner applications (detected as Trojan:BASH/DevilRobber.A)
- polipo - Another clean application bundled with the malware, this is a web proxy utility.
- polipo.cfg - polipo's configuration file.
- acab.sh - This script collects data from the infected system (detected as Trojan-Spy:BASH/DevilRobber.A)
MDSA - Remote connections
When the malware's main component (msda) is launched, it searches for and add port mapping to UPnP-capable gateway devices, allowing the following ports to be accessed from outside the network:
- 34123 - The backdoor listens for commands on this port.
- 9000 or 34522 - The port used by the web proxy installed by the malware; the specific port varies depending on the sample.
- 34321 - The reason for this mapping is still undetermined.
msda then creates a thread that listen on port 34123 for commands coming from a remote user. The malware allows the following commands:
- Open an interactive shell prompt
- Capture current screen then download the captured image
msda then starts the bundled web proxy, which can be used by a remote user(s) as a staging point for later attacks.
MDSA - Bitcoin mining
Depending on the sample, msda may also execute the miner.sh script in order to mine Bitcoin, using both GPU and CPU cycles. The malware uses "su.mining.eligius.st" as its mining pool server.
Finally, msda executes the acab.sh script to collect various details from the infected system.
The data collected by acab.sh is stored in a file called "dump.txt". Next, msda will append additional information to this file, then archive and upload it to a remote FTP server. The specific server used varies between samples. This data retrieval routine is repeated on a fixed interval, which also differs between samples.
The data collected may vary between malware samples, but generally consists of the following:
- Keychain dumped by msda (s_dump.txt)
- Safari browsing history
- The number of files that match the following names:
- Terminal command history
- Screenshot of the current screen
- Bitcoin wallet contents
The following information is appended by msda to the "dump.txt" file:
- External IP address of the infected machine
- Downstream and upstream bit rate of the infected network
- Malware's port mapping attempt status
- The time the malware was executed
During analysis, the msda component in some samples were observed dumping the Keychain of the infected system to a file called "s_dump.txt".