Spoločnosť ReversingLabs výsledky analýzy aplikácie v repozitári RubyGems. Typovanie sa zvyčajne používa na šírenie škodlivých balíčkov, ktoré sú navrhnuté tak, aby nevšímavý vývojár pri hľadaní spravil preklep alebo si nevšimol rozdiely. Počas výskumu bolo zistených viac ako 700 balíčkov, ktorých názvy sú podobné populárnym balíčkom a líšia sa iba malými detailmi, ako je zmena podobných písmen alebo použitím podčiarkovania namiesto pomlčky.
V viac ako 400 balíčkoch boli zistené komponenty, ktoré sú podozrivé z vykonávania škodlivých činností. Najmä bol vo vnútri nájdený súbor aaa.png, ktorý obsahoval vykonateľný kód vo formáte PE. Uvedené balíčky boli spojené s dvoma účtami, cez ktoré bolo medzi 16. a 25. februárom 2020 v RubyGems umiestnených , ktoré boli celkovo stiahnuté približne 95 tisíckrát. Výskumníci informovali správu RubyGems a zistené škodlivé balíčky už boli odstránené z repozitára.
Z identifikovaných problémových balíčkov bol najpopulárnejší „atlas-client“, ktorý na prvý pohľad takmer nie je odlišný od legitímneho balíčka „“. Uvedený balíček bol stiahnutý 2100-krát (normálny balíček bol pritom stiahnutý 6496-krát, t.j. používatelia sa mýlili takmer v 25% prípadoch). Ostatné balíčky boli v priemere stiahnuté 100-150-krát a kamuflovali sa pod iné balíčky pomocou podobnej techniky výmeny podčiarkovania a pomlčky (napríklad, medzi : appium-lib, action-mailer_cache_delivery, activemodel_validators, asciidoctor_bibliography, assets-pipeline, apress_validators, ar_octopus-replication-tracking, aliyun-open_search, aliyun-mns, ab_split, apns-polite).
Malicious packages included a PNG file, in which instead of an image there was an executable file for the Windows platform. The file was created using the Ocra Ruby2Exe utility and included a self-extracting archive with a Ruby script and Ruby interpreter. When the package was installed, the png file was renamed to exe and executed. During execution, a file with VBScript was created and added to the autostart. The specified malicious VBScript cyclically analyzed the clipboard content for information resembling cryptocurrency wallet addresses and, when detected, substituted the wallet number, expecting that the user would not notice the difference and transfer funds to the wrong wallet.
The conducted research showed that it is not difficult to add malicious packages to one of the most popular repositories and these packages can remain unnoticed despite a significant number of downloads. It should be noted that the problem to RubyGems and affects other popular repositories. For example, last year the same researchers discovered a malicious package bb-builder in the NPM repository, which used a similar technique for executing files to steal passwords. Previously, the backdoor was linked to the NPM package event-stream and the malicious code was downloaded approximately 8 million times. Malicious packages also in the PyPI repository.
Zdroj: opennet.ru
