New malicious NPM packages Used by Attackers Install njRAT Remote Access Trojan

No, not the one that nibbles at your Thanksgiving leftovers. RAT, Remote Access Trojan, is a type of malware that enables attackers to take over an infected system, execute arbitrary commands, run keyloggers, and discreetly conduct other surveillance activities. 

This Thanksgiving weekend, Sonatype discovered a new malware within the npm registry. The malicious packets being “jdb.js” and “db-json.js”, both published by the same author.

Upon further investigation, it was found that the author behind “jdb.js” had published another malicious npm package “db-json.js”. “jdb.js” is a malicious package that has been clubbed with njRAT a.k.a Bladabindi, which had in 2014 caused Microsoft to shut down 4 million sites.

Variants of njRAT have recently been circulated via Bitcoin scams on Youtube and via Excel phishing emails.

Investigation on “jdb.js”

“jdb.js” is an npm package with the only version 1.0.0.

This contains 3 files in it:

  • package.json, the manifest file
  • module.js, an obfuscated script
  • patch.exe, Windows executable containing the njRAT payload

Once the package is installad, the package.json file first launches ‘module.js’ file which is a strongly obfuscated script containing multiple base64-encoded chunks that cannot be easily deciphere. This script does data gathering and reconnaissance and launches patch.exe file

The patch.exe file runs and copies itself into the local “TEMP” folder on the system and renames itself to “dchps.exe” establishes a connection to 46.185.116.2:5552 also the malicious executable edits Windows firewall rules to ensure it would have no trouble communicating with the hardcoded IP. To do so, it issues the legitimate “netsh” command multiple times, starting with:

netsh firewall add allowedprogram “C:\Users\admin\AppData\Local\Temp\dchps.exe” “dchps.exe” ENABLE

Just by infecting the target with the malware, a remote attacker gains the ability to log keystrokes, modify registry values, initiate system shutdown or restart at will, edit web browser (IE) start page, “speak” to the user via text-to-speech synthesis (via SAPI.Spvoice), kill or relaunch critical system processes like task manager, system restore, and PING, in addition to taking control of hardware devices like CD drives, monitors, mouse, keyboard, etc.

Investigation on “db-json.js

After investigation, it is seen that the Genuine-looking “db-json.js” hides “jdb.js” within.

“db-json.js” had a proper README page with working documetation on npm pretending to be JsonDb, which has now been removed for goodness saying ‘This package contained malicious code and was removed from the registry by the npm security team. A placeholder was published to ensure users are not affected in the future’

Therefore, if someone is able to dodge “jdb.js,” by using “db-json.js” in their application, they will put other developers at risk and just limit to risking themselves.

You can follow us on LinkedinTwitterFacebook for daily Cybersecurity and hacking news updates.

Also Read

Linux Foundation Releases List of Most commonly used open-source Software & Security Problems

Gurubaran

Gurubaran is a co-founder of Cyber Security News and GBHackers On Security. He has 10+ years of experience as a Security Consultant, Editor, and Analyst in cybersecurity, technology, and communications.

Recent Posts

New RDP Exploit Allows Attackers to Take Over Windows and Browser Sessions

Cybersecurity experts have uncovered a new exploit leveraging the widely used Remote Desktop Protocol (RDP).…

2 hours ago

New SMS-Based Phishing Tool ‘DevilTraff’ Enables Mass Cyber Attacks

Cybersecurity experts are sounding the alarm about a new SMS-based phishing tool, Devil-Traff, that is…

2 hours ago

DeepSeek Database Publicly Exposed Sensitive Information, Secret Keys & Logs

Experts at Wiz Research have identified a publicly exposed ClickHouse database belonging to DeepSeek, a…

3 hours ago

OPNsense 25.1 Released, What’s New!

The highly anticipated release of OPNsense 25.1 has officially arrived! Nicknamed "Ultimate Unicorn," this update…

3 hours ago

DeepSeek is Now Available With Microsoft Azure AI Foundry

Microsoft has officially added DeepSeek R1, an advanced AI model, to its Azure AI Foundry…

3 hours ago

New Apple SLAP & FLOP Side-Channel Attacks Let Attackers Steal Login Details From Browser

Researchers from the Georgia Institute of Technology and Ruhr University Bochum have uncovered two novel…

15 hours ago