GuardDog Software Identifies Malicious npm Packages Linked to North Korea

06 Aug 2024

In a recent analysis of package scanning within the Python Package Index (PyPi) and npm, GuardDog software has successfully identified two malicious packages associated with a North Korean threat actor group known as “Stressed Pungsan.” This cluster of activity exhibits strong ties to Microsoft’s MOONSTONE SLEET, indicating a sophisticated approach to supply chain attacks.

Malicious Packages Uncovered

The identified packages serve as initial access points for malware distribution, facilitating data exfiltration, credential theft, and lateral movement within compromised environments. On July 7, 2024, an npm user by the name of nagasiren978 uploaded two packages, harthat-hash and harthat-api, which were designed to download additional malware from a suspected North Korean command and control (C2) server.

This server is responsible for distributing malicious batch scripts, with a particular focus on Windows systems, aligning with the tactics employed by the MOONSTONE SLEET threat actor group. The two npm packages exhibit similar malicious behavior, utilizing a pre-install script that downloads a harmful DLL from a remote server, executes it via rundll32, and subsequently self-destructs.

Both packages share nearly identical structures, differing only by a unique identifier in the download URL. The harthat-api package masquerades as the legitimate Hardhat package, employing similar naming conventions to deceive users. Despite originating from the reputable node-config repository, the malicious package modifies the package.json file to eliminate the preinstall script and rename itself to config.

Additionally, the package includes two unexplained files, deference.js and pk.json, whose functions remain outside the scope of this analysis. The preinstall script is particularly insidious, downloading a DLL disguised as a temporary file, renaming it to “package.db,” and executing it through the “rundll32” system utility.

Evading Detection

This method, referred to as “System Binary Proxy Execution,” aims to evade detection by cleaning up after itself—deleting the downloaded DLL and restoring the original package.json file to obscure its malicious activities.

The Datadog Security Research team’s examination of the malicious DLL revealed a seemingly innocuous binary with no overtly harmful functionality. It exported two functions, one of which, GenerateKeyW, is anticipated to harbor malicious code. However, both static and dynamic analyses failed to reveal any self-modification or harmful behavior within the DLL.

The lack of discernible malicious code raises questions about the DLL’s purpose, suggesting it may be an incomplete version or a testing iteration, indicating that the threat actor could be experimenting with their operational infrastructure.

Indicators of Compromise

In a recent incident, threat actors managed to compromise targets through the malicious npm packages harthat-api-v1.3.1.zip and harthat-hash-v1.3.3.zip, which likely contained content designed to appear legitimate. The malicious payloads were traced back to the IP address 142.111.77.196. Potential indicators of compromise (IOCs) include the filenames Temp.b (also known as package.db) and its SHA256 hash, d2a74db6b9c900ad29a81432af72eee8ed4e22bf61055e7e8f7a5f1a33778277.

Top charts for Desktop

uTorrent

uTorrent

Latest update uTorrent download for free for Windows PC or Android mobile

5
1032 reviews
6275729
downloads
Zona

Zona

Latest update Zona download for free for Windows PC or Android mobile

4
614 reviews
1228963
downloads
WinRAR

WinRAR

Latest update WinRAR download for free for Windows PC or Android mobile

5
735 reviews
480684
downloads
Minecraft

Minecraft

Latest update Minecraft download for free for Windows PC or Android mobile

5
750 reviews
451742
downloads

News and reviews for Desktop

Helldivers 2 Targets Smaller File Size by Dropping HDD Support

Arrowhead Game Studios plans to reduce Helldivers 2's file size by ending HDD support on PCs, potentially streamlining updates.

Read more

Launch of GOG Sale Features 4,000 PC Game Discounts

GOG Sale offers discounts on 4,000 PC games from 2023-10-28 to 2023-11-04, featuring modern and classic titles.

Read more

Darkwood 2 Announced: Sequel from Ice-Pick Lodge

Darkwood 2 announced at Xbox Showcase, developed by Ice-Pick Lodge, featuring Aral Sea setting with no quest markers.

Read more

Announce Darkwood 2: Sequel to Horror Survival Game

Darkwood 2 announced by Hooded Horse, developed by Ice-Pick Lodge, featuring new story dynamics. PC and Game Pass release planned.

Read more

Visions of Eternity Launches with Elite Specs Return

The Visions of Eternity expansion revives elite specs in Guild Wars 2, featuring Castora and new customization options.

Read more

Humble Bundle Offers Steam Deck-Compatible Games Bundle

The Humble Bundle's Safe in Our World Anniversary Bundle provides Steam Deck-compatible games until 2025-10-28.

Read more

Redsec Map Update: Best Loot Locations and POIs

Redsec map offers top-tier loot in Fort Lyndon's outskirts. Battle smarter by knowing key areas for gear.

Read more

QNAP Urges Critical ASP.NET Core Patch for NetBak PC Agent

QNAP advises users to patch a critical ASP.NET Core vulnerability affecting NetBak PC Agent to prevent potential attacks.

Read more

Evercore Heroes Ascension to Shut Down After Early Access

Evercore Heroes shuts down on 2025-10-30 after one month of Early Access due to low player interest.

Read more

The Florist Announced: Survival Horror Game by Unclear Games

The Florist by Unclear Games is set for a 2026 release on PC and consoles, featuring versatile gameplay with Jessica Park navigating Joycliffe.

Read more