Más que 700 malicious libraries detected in RubyGems repository

Malicious libraries in RubyGems repository

Information security researchers at ReversingLabs reportado el descubrimiento de 725 malicious libraries that stole the contents of the clipboard in the official RubyGems repository.

RubyGems is a package manager for the Ruby programming language. According to their own site statistics, the repository contains around 158 thousand packages (called gems) with nearly 49 billion total downloads.

A complete list of libraries can be seen aquí.

Malicious packages were uploaded to RubyGems from February 16 to February 25, 2020 from two accounts: JimCarrey and PeterGibbons.

Researchers write that the malware was removed from RubyGems as early as February 27, two days after ReversingLabs notified developers of its finding.

Malicious libraries in RubyGems repository

All detected malware were clones of various legitimate libraries. Usaron la técnica de typosquatting., that means they had names deliberately similar to the originals, and even worked as intended, pero también contenía archivos maliciosos adicionales.

An additional file built into each such package was called aaa.png. Despite the extension, this file was not a PNG image. De hecho, it was a Windows PE executable.

A propósito, I have already written about how cybercriminals encrypt malware in images: Por ejemplo, MyKingz botnet uses Taylor Swift photo to infect target machines.

Installing any of the malicious libraries caused a chain of the following actions:

  • The PE file created a Ruby script called aaa.rb containing the Ruby interpreter and all the necessary dependencies to run;
  • this script created a Visual Basic script called oh.vbs;
  • the script created a key for autorun in the registry;
  • the startup key executed the second Visual Basic script every time the computer started or rebooted;
  • the second script intercepted the data sent to the clipboard, and looked for templates similar to the addresses of cryptocurrency wallets, and replaced them with an attacker’s wallet.

Malicious libraries in RubyGems repository

ReversingLabs writes that thousands of users later have downloaded these libraries. Sin embargo, judging by the attacker’s Bitcoin address, during all the time of the campaign’s activity he was not able to intercept any payments, changing the address to his own.

Researchers believe that behind this attack is the same person or group that loaded malicious libraries into RubyGems earlier, en 2018 y 2019. Both incidents were distinguished by the use of similar methods, and the goal was stealing cryptocurrency from users.

Por Vladimir Krasnogolovy

Vladimir es un especialista técnico al que le encanta dar consejos y sugerencias cualificados sobre los productos de GridinSoft. Está disponible las 24 horas del día, los 7 días de la semana para ayudarte con cualquier pregunta relacionada con la seguridad en Internet.

Dejar un comentario

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *