Saturday, February 22, 2025
Homecyber securityDevelopers Beware Of Malicious npm Package Delivers Sophisticated RAT

Developers Beware Of Malicious npm Package Delivers Sophisticated RAT

Published on

SIEM as a Service

Follow Us on Google News

Hackers have multiple reasons for abusing malicious npm packages, as they can first use popular open-source libraries as a medium for distributing malware or backdoors without the users’ knowledge.

Secondly, allow threat actors to penetrate into developers’ and agencies’ networks and systems who are using these infected packs.

As they could take away confidential information, launch supply chain attacks, or even use those accounts to mine cryptocurrencies. In general, exploiting npm packages is an effective and confidential method of attack for hackers.

Cybersecurity researchers at Phylum recently warned developers about malicious npm packages that deliver sophisticated RAT.

Technical Analysis

Phylum’s automated risk platform recently detected a suspicious npm package named glup-debugger-log which has obfuscated files that act as a dropper and provide remote access.

Some obfuscated files were found in package.json that were executed via build and test scripts.

The entry point for the malicious code was identified to be the bind() method from an obfuscated play.js file after deobfuscating it.

Function bind() exports code that produces a random number and then asynchronously executes start() and share().

Start() gets some configuration information which includes hard-coded empty strings for keys “p” and “pv”.

It then makes environment verifications through the use of checkEnv function to decide whether or not the malware should be sent out.

These checks consist of network interface verification, Windows OS check, and ensuring the developer’s desktop folder has at least 7 programs, most likely directed at active developers’ machines.

With ANYRUN You can Analyze any URL, Files & Email for Malicious Activity : Start your Analysis

If all of these tests are successful, the code will attempt to run the command locally, or download and run a remote payload and maintain a background script that provides remote access.

The code does extra checks compared to the initial environment checks. The code can be defined as a “match” key that can target specific machines through either MAC addresses or IPs.

It permits only Windows systems and must have at least 7 things in the user’s Desktop folder, indicating probably that it is an active developer machine.

After a successful checkup, it runs a command locally by means of decoding an already hardcoded Base64 string to “cmd.exe” or “downloads” a remote payload from the URL given.

Moreover, even after the main process exits, it runs another separate script that remains persistent for further malicious activities.

The attacker seems to be interested in developers’ systems for compromise in this way.

The hidden play-share.js sets up an HTTP server on port 3004. Sending a query with “cmd” through this means the attacker can command execution on the compromised system.

It uses child_process to execute the specified command and then returns the output of that command.

Alongside the main dropper, it makes it possible to have remote code execution since it is simple but powerful enough to make something of a crude RAT.

While written in JavaScript, some modularity, stealth, environment targeting, and obfuscation techniques are used.

This shows how attackers evolve malware development in open-source ecosystems.

Looking for Full Data Breach Protection? Try Cynet's All-in-One Cybersecurity Platform for MSPs: Try Free Demo 

Tushar Subhra
Tushar Subhra
Tushar is a Cyber security content editor with a passion for creating captivating and informative content. With years of experience under his belt in Cyber Security, he is covering Cyber Security News, technology and other news.

Latest articles

SPAWNCHIMERA Malware Exploits Ivanti Buffer Overflow Vulnerability by Applying a Critical Fix

In a recent development, the SPAWNCHIMERA malware family has been identified exploiting the buffer...

Sitevision Auto-Generated Password Vulnerability Lets Hackers Steal Signing Key

A significant vulnerability in Sitevision CMS, versions 10.3.1 and earlier, has been identified, allowing...

NSA Allegedly Hacked Northwestern Polytechnical University, China Claims

Chinese cybersecurity entities have accused the U.S. National Security Agency (NSA) of orchestrating a...

ACRStealer Malware Abuses Google Docs as C2 to Steal Login Credentials

The ACRStealer malware, an infostealer disguised as illegal software such as cracks and keygens,...

Supply Chain Attack Prevention

Free Webinar - Supply Chain Attack Prevention

Recent attacks like Polyfill[.]io show how compromised third-party components become backdoors for hackers. PCI DSS 4.0’s Requirement 6.4.3 mandates stricter browser script controls, while Requirement 12.8 focuses on securing third-party providers.

Join Vivekanand Gopalan (VP of Products – Indusface) and Phani Deepak Akella (VP of Marketing – Indusface) as they break down these compliance requirements and share strategies to protect your applications from supply chain attacks.

Discussion points

Meeting PCI DSS 4.0 mandates.
Blocking malicious components and unauthorized JavaScript execution.
PIdentifying attack surfaces from third-party dependencies.
Preventing man-in-the-browser attacks with proactive monitoring.

More like this

SPAWNCHIMERA Malware Exploits Ivanti Buffer Overflow Vulnerability by Applying a Critical Fix

In a recent development, the SPAWNCHIMERA malware family has been identified exploiting the buffer...

Sitevision Auto-Generated Password Vulnerability Lets Hackers Steal Signing Key

A significant vulnerability in Sitevision CMS, versions 10.3.1 and earlier, has been identified, allowing...

NSA Allegedly Hacked Northwestern Polytechnical University, China Claims

Chinese cybersecurity entities have accused the U.S. National Security Agency (NSA) of orchestrating a...