More than a dozen malicious npm packages have emerged on the npm package repository in August 2023, designed to deploy an open-source information stealer named Luna Token Grabber on systems utilized by Roblox game developers. This ongoing campaign, detected by ReversingLabs on August 1, mimics the legitimate noblox.js package that Roblox developers use for interacting with the gaming platform.
Described as reminiscent of a prior attack from 2021, the malicious packages replicate code from noblox.js but introduce malicious functions, enabling data theft. The packages were collectively downloaded 963 times before being removed.
Notably, the rogue packages include names such as noblox.js-vps, noblox.js-ssh, and noblox.js-secure, targeting various versions of noblox.js. Despite sharing similarities with previous attacks, this campaign showcases distinctive traits, particularly in deploying an executable to deliver Luna Grabber.
ReversingLabs identified a multi-stage infection sequence, a rarity on npm, and highlighted the importance of disguising malicious intent within packages to appear legitimate. The malicious modules adeptly conceal their damaging code within a separate file called postinstall.js, which is executed upon installation.
In contrast, the legitimate noblox.js package uses a similar file for displaying messages to users. The malicious variants verify their presence on Windows machines before downloading and executing a second-stage payload from a Discord CDN or displaying an error message. The second-stage payload evolves with each iteration, incorporating obfuscation mechanisms to evade detection while downloading Luna Token Grabber.
The campaign underscores the persistent trend of malicious actors exploiting typosquatting to deceive developers into installing malicious code under the guise of authentic packages, as noted by cybersecurity experts.