Monero project compromised


Introduction

Earlier this evening I saw a tweet appear which claimed Monero has been hacked and a malicious binary (instead of the real one) has been served:

Warning Monero users: If you downloaded Monero in the past 24 hours you may have installed malware. Monero's official website served compromised binaries for at least 30 minutes during the past 24 hours. Investigations are ongoing. https://t.co/geqA4dIPar
— dark.fail (@DarkDotFail) November 19, 2019

Post on Reddit:
https://www.reddit.com/r/Monero/comments/dyfozs/security_warning_cli_binaries_available_on/

Github issue:
https://github.com/monero-project/monero/issues/6151

Linux binary

Thanks to user nikitasius I was able to retrieve the malicious binary:
https://github.com/monero-project/monero/issues/6151#issuecomment-555511805

This binary is an ELF file with the following properties:
  • MD5: d267be7efc3f2c4dde8e90b9b489ed2a
  • SHA-1: 394bde8bb86d75eaeee69e00d96d8daf70df4b0a
  • SHA-256: ab9afbc5f9a1df687558d570192fbfe9e085712657d2cfa5524f2c8caccca31
  • File type: ELF
  • Magic: ELF 64-bit LSB shared object, x86-64, version 1 (GNU/Linux), dynamically linked (uses shared libs), for GNU/Linux 3.2.0, from 'x)', not stripped
  • File size: 27.63 MB (28967688 bytes)
When comparing the legitimate file and this ELF file, we notice the file size is different, and a few new functions have been added:

cryptonote::simple_wallet::send_seed

This function is immediately called after either opening or creating a new wallet, as can be seen in Figure 1 and 2 below.


Figure 1 - Create wallet (legitimate)

Figure 2 - Call new seed function






















The seed will be sent to: node.hashmonero[.]com.

cryptonote::simple_wallet::send_to_cc

As you may have guessed, this will send data off to the CC or C2 (command and control) server - this will be stolen funds.

Figure 3 - Send to cc







Sending funds to the C2 is handled using an HTTP POST request to the following C2 servers:

  • node.xmrsupport[.]co
  • 45.9.148[.]65

As far I can see, it doesn't seem to create any additional files or folders - it simply steals your seed and attempts to exfiltrate funds from your wallet.

Windows binary

The C2 server 45.9.148[.]65 also hosts a Windows binary with the following properties:


  • MD5: 72417ab40b8ed359a37b72ac8d399bd7
  • SHA-1: 6bd94803b3487ae1997238614c6c81a0f18bcbb0
  • SHA-256: 963c1dfc86ff0e40cee176986ef9f2ce24fda53936c16f226c7387e1a3d67f74
  • File type: Win32 EXE
  • Magic: PE32+ executable for MS Windows (console) Mono/.Net assembly
  • File size: 65.14 MB (68302960 bytes

The Windows version is essentially doing the same things as the Linux version - stealing your seed and wallet funds - the function names are just different, e.g. _ZN10cryptonote13simple_wallet9send_seedERKN4epee15wipeable_stringE.

Figure 4 - Send to cc









Detection

Note: What is a hash? A hash is a unique identifier. This can be for a file, a word, ... It is preferred to use SHA256 hashes for file integration checks.

You may also use the following Yara rule to detect the malicious or compromised binaries:
Monero_Compromise.yar
Download Yara (and documentation) from:
https://github.com/VirusTotal/yara


Recommendations

Monero team statement

The Monero team has issued a statement as follows:

Warning: The binaries of the CLI wallet were compromised for a short time:


Conclusion

Monero is not the first, nor will it be the last cryptocurrency that will be compromised.

Follow the steps in this blog post to protect yourself and always watch your online accounts closely.

Note: this blog post is not intended to be a full analysis, but rather a quick report on the facts, including recommendations. Questions? Let me know in the comments or on Twitter.



Indicators


Indicator typeIndicator
FileHash-SHA2567ab9afbc5f9a1df687558d570192fbfe9e085712657d2cfa5524f2c8caccca31
FileHash-SHA256963c1dfc86ff0e40cee176986ef9f2ce24fda53936c16f226c7387e1a3d67f74
hostnamewww.hashmonero.com
hostnamenode.xmrsupport.co
hostnamenode.hashmonero.com
FileHash-MD5d267be7efc3f2c4dde8e90b9b489ed2a
FileHash-MD572417ab40b8ed359a37b72ac8d399bd7
FileHash-SHA16bd94803b3487ae1997238614c6c81a0f18bcbb0
FileHash-SHA1394bde8bb86d75eaeee69e00d96d8daf70df4b0a
IPv491.210.104.245
IPv445.9.148.65
domainhashmonero.com
domainxmrsupport.co

On AlienVault:

Article Link: Blaze's Security Blog: Monero download site and binaries compromised