Spider-Miner: With Great Power Comes Great Problems!

logo
Featured On

EntrepreneurForbesBuisiness InsiderAxios

Spider-miner, spider-miner, does whatever a miner can.

Mine a coin, spawn a thread,

**Uses your electricity while you’re in bed.
**

**Look out!
**

Here comes the spider miner … !

Summary 

To lure in as many victims as possible, attackers must stay up to date with trending topics.

In this case, we are facing someone who has placed a Monero miner in a torrent download of what seems to be the new movie Spider-Man: No Way Home.

The file identifies itself as “spiderman_net_putidomoi.torrent.exe,” which translates from Russian to “spiderman_no_wayhome.torrent.exe.” The origin of the file is most likely from a Russian torrenting website.

This miner adds exclusions to Windows Defender, creates persistence, and spawns a watchdog process to maintain its activity.

Static Review

Before detailing the malware actions, let’s first see what it has planned for us in the code. The malware is not signed and written in .net, and as of this date, it is not present in Virus Total. The malware tries to stay away from examining eyes, by using ‘legitimate’ names for the files and processes that it creates; for example, it claims to be by Google and drops files with names like sihost64.exe, and injects to svchost.exe.

At first, the code seems somewhat unreadable, due to obfuscated function names and strings. All strings in the code are base64 encoding of encrypted strings. It uses decryption on the decoded base64 strings that are provided in the code. During analysis, we changed the function names to meaningful ones, and decrypted the strings for better understanding of the code.

The program has the ability to start a process and inject its embedded resources into another process:

The injection happens in this section of code:

After our decryption, this changes to:

Here we can see that it targets “c:\windows\system32\svchost.exe” for the injection process. Resource “rvyzh” is a zip file, which is decompressed on runtime and injected into svchost.exe in a thread hijacking method.

Please note: Function names and encrypted strings have been modified by us for better readability.

We can also see basic operations of creating persistence, querying host information with wmi, and dropping files.

Later in the research process, we found that the miner is a version of SilentXMRMiner, which is published free to use at github  https://github.com/UnamSanctam/SilentXMRMiner

The project offers a comfortable GUI to compile a new miner, with the relevant information per user. After the information is supplied, all that is left is to distribute the miner.

We encountered various compiled versions of this project, some more obfuscated than others.

Process tree:

Provided by any.run                       

The program starts two powershell encoded commands, that adds the following extended exclusions to Microsoft Defender: ignore all folders under the user profile, the system drive (i.e. “c:\\”), and all files with extensions of “.exe” or “.dll”.

Can’t be too safe, right?

The decoded command translates to:

It then creates a persistence in the shape of registry CurrentVersion\Run key or a scheduled task named “services” on every logon:

Following the creation of the persistence, it makes sure to run it:

The new process “services.exe” runs the same encoded powershell commands:

At first run, it would kill any process that has the name of its components to make sure only one instance is running at a given moment.

The program drops 2 files to disk:

  • Sihost64.exe,
  • WR64.sys

Two new processes are then executed:

  • Sihost64.exe – watchdog process

This file comes from the resource named “oocetcmsrfsmni” and is not so different from the main file. Its main functionality is to make sure the mining process is running.

  • Svchost.exe – this process is the proper miner, which contacts the domain “mine.bmpool.org”.

When trying to base64 decode the commandline string we get: 

A lot of miners often drop a configuration file to the infected host – a file that has information needed to mine and link the mining activity to the attacker. Other than conf file, it is also possible to supply this information in the commandline parameters. The problem with those methods is that AV products will detect this activity quickly and block the process.

To survive this, another option that miners choose is to compile their own version of the xmrig miner, and hide this information inside or even add more functionality.

In our case, Svchost is injected by the main process, as described above, with the contents of a zipped resource. This resource is responsible for the mining. When we extract the contents we can identify “xmrig” mining program, which is an open-source project used to mine Monero coin https://github.com/xmrig/xmrig.

As we can see here, the result is not readable.

This version is a self-compiled version, which contains all of the necessary information needed to start mining (username, password, algorithm, mining pool). All those strings do not appear in cleartext anywhere, and only after dumping the process memory we were able to see all of the above.

In addition, we found evidence of evasion from monitoring tools – such as Process Explorer, Process Hacker, Perfmon, and task manager.

YARA

We created a simple YARA rule to keep track of this miner:

IOCs:

Network

Registry

Conclusion

We recommend taking extra caution when downloading content of any kind from non-official sources – whether it’s a document in an email from an unknown sender, a cracked program from a fishy download portal, or a file from a torrent download.

One easy precaution you can take is to always check that the file extension matches the file you are expecting e.g. in this case, a movie file should end with “.mp4”, not “.exe”. Try to gather information about the file, and always think twice before double-clicking on it. To make sure you see the real file extension, open a folder, go to “View” and check “File name extensions”. This will make sure you see the full file type.

Although this malware does not compromise personal information (which is what most users are afraid of when thinking about a virus on their computer), the damage that a miner causes can be seen in the user’s electricity bill. This is real money that they have to pay, given that the miner runs for long periods. Additionally, the damage can be felt on a user’s device as often miners require high CPU usage, which causes the computer to slow down drastically.

Author

Dana Yosifovich, Security Researcher at ReasonLabs

About ReasonLabs

ReasonLabs is a leading cybersecurity company providing enterprise-grade protection for all users around the globe. Led by a team of cyber experts and visionaries, including former Microsoft Lead Security Program Manager, Andrew Newman, ReasonLabs has developed unique, cutting-edge technology to combat all emerging cyber threats at the earliest possible stage. ReasonLabs’ innovative engine scans over 1 billion files in 180 countries a day, delivering fast, comprehensive data, and providing 24/7 real-time threat detection. To learn more about ReasonLabs, please visit https://reasonlabs.com