60 Malicious npm Packages Steal Hostnames, IP Addresses, and DNS Server Details

A coordinated campaign has been discovered within the npm ecosystem, where 60 malicious packages have been published under three distinct npm accounts.

According to Socket’s Threat Research Team, these packages contain install-time scripts that exfiltrate sensitive host data, including hostnames, internal and external IP addresses, DNS server details, and user directory paths.

The data is sent to a Discord webhook under the threat actor’s control, establishing a real-time mapping of infected networks.

Ongoing Campaign Targets Developer

The campaign began nearly two weeks ago, with the most recent malicious package appearing just hours before this report, emphasizing that the operation remains active.

Malicious npm Packages
malicious package released under the npm accounts

These malicious packages target Windows, macOS, and Linux systems, deploying basic sandbox evasion checks to maximize the chances of infecting genuine developer workstations and continuous integration (CI) environments.

As of publication, the combined download count exceeds 3,000, raising concerns about the breadth of potential exposure across the software supply chain.

According to Socket Report, all suspicious packages remain available on npm, with requests for their removal still pending.

Technical Analysis

The core functionality embedded in these npm packages initiates during the installation process.

The malicious script leverages Node.js modules such as os and dns to enumerate sensitive machine data, including hostnames and user information, while also capturing both internal and external IP addresses.

The script utilizes public APIs like ipinfo.io to retrieve external network identifiers and references the contents of package.json to fingerprint which package executed the code.

Crucially, the payload features conditional logic to avoid sandboxed or virtualized environments, recognizing hostnames, domains, and user directory patterns commonly used in security research and automated testing.

This ensures that only live, production environments leak operational data, thus supporting more targeted follow-on attacks.

Once reconnaissance data is collected including DNS settings, user directories, usernames, internal/external IPs, package metadata, and resolved URLs it is compiled into a JSON structure and transmitted to a hardcoded Discord webhook endpoint controlled by the attacker.

Such real-time exfiltration presents significant risk, as it may reveal internal package registries, build pipelines, and sensitive project structures, expanding the attacker’s reconnaissance footprint for future, more destructive campaigns.

The continued existence of these packages on npm, coupled with high download counts, highlights the persistent threat posed by post-install scripts in the JavaScript ecosystem.

Because the registry lacks built-in mechanisms to restrict such hooks, it remains relatively easy for attackers to redeploy identical techniques across new packages and accounts, circumventing takedowns and blacklists.

Security teams are strongly advised to implement dependency-scanning solutions that detect post-install hooks and flag suspicious behavior, such as hardcoded URLs or unusually compact tarballs.

Tools like the Socket GitHub app and CLI can surface these threats in automated workflows, while browser extensions offer real-time risk visibility during package selection.

Proactive monitoring and layered security reviews of all open source dependencies are essential to reducing the risk of supply chain compromise.

Indicators of Compromise (IOCs)

Account (Registration Email)Example Malicious PackagesNumber of PackagesExfiltration Endpoint
bbbb335656 (npm9960+1@gmail[.]com)seatable, e-learning-garena, inhouse-root, template-vite, appium-rn-id20Discord webhook
sdsds656565 (npm9960+2@gmail[.]com)datamart, coral-web-be, garena-react-template-redux, admin-id20Same as above
cdsfdfafd1232436437 (npm9960+3@gmail[.]com)seamless-sppmy, seatalk-rn-leave-calendar, netvis, web-ssar20Same as above

Find this Story Interesting! Follow us on LinkedIn and X to Get More Instant Updates.

Mandvi
Mandvi
Mandvi is a Security Reporter covering data breaches, malware, cyberattacks, data leaks, and more at Cyber Press.

Trending News

Related Stories