A recent discovery by security researchers has unveiled a new malicious npm campaign that utilizes fake installation logs to conceal malware activity. ReversingLabs identified these attacks, which involve malicious packages masquerading as legitimate software installations while secretly downloading and executing malware designed to steal sensitive data and crypto wallets.
Known as the “Ghost campaign,” this malicious operation began in early February and consists of several malicious packages with downloader functionality. These packages aim to acquire a user’s sudo password during installation, which is later utilized to deploy a remote access trojan (RAT) on the victim’s system.
The perpetrators behind this campaign have gone to great lengths to make the installation process appear genuine. Fake npm install logs were created to deceive users, displaying messages about downloading dependencies, progress bars, and random delays to mimic a legitimate installation process. However, in reality, none of these actions actually occurred.
During the fake installation, users were prompted to enter their sudo password under the guise of fixing an installation issue or performing optimization tasks. Once the password was entered, it was used to initiate the final stage of malware execution without the user’s knowledge.
The malware payload was sourced from external locations such as a Telegram channel and hidden web3 content. This payload was decrypted using an online-retrieved key and executed locally with the stolen sudo password.
The remote access trojan deployed by the malicious packages is capable of stealing crypto wallets, gathering sensitive information, and receiving commands from a command-and-control (C2) server. Some versions of the malware included additional files to enhance data theft capabilities.
Researchers observed similarities in code structures and techniques across several malicious packages, indicating either a new campaign or a preliminary test run for a larger operation. Similar methods were also detected in other recently reported malicious npm packages.
To mitigate the risk of exposure to malicious open-source packages, researchers recommend verifying package authors and repository history, monitoring installation scripts and unusual prompts, utilizing automated security scanning tools, and avoiding entering sudo passwords during package installation.
ReversingLabs has committed to monitoring npm repositories for similar threats and promptly flagging malicious packages as they are uncovered. Stay vigilant and take proactive measures to protect against these evolving cyber threats.
