Newly Found npm Malware Mines Cryptocurrency on Windows, Linux, macOS Devices

Sonatype’s automated malware detection system has caught multiple malicious packages on the npm registry this month. These packages disguise themselves as legitimate JavaScript libraries but were caught launching cryptominers on Windows, macOS and Linux machines.

The malicious packages are:

  • okhsa
  • klow
  • klown

“klow, klown” have been tracked under Sonatype-2021-1472. Whereas, “okhsa” has been cataloged under Sonatype-2021-1473.

Different versions of the “okhsa” package largely contain skeleton code that launches the Calculator app on Windows machines pre-installation. But additionally, these versions contain either the “klow” or the “klown” npm package as a dependency—which is malicious.

The manifest file, package.json, for “okhsa” shows “klown” listed as a dependency.

All of these packages were published by the same author whose account has since been deactivated:

The Sonatype security research team discovered that “klown” had emerged within hours of “klow” having been removed by npm. “Klown” falsely touts itself to be a legitimate JavaScript library “UA-Parser-js” to help developers extract the hardware specifics (OS, CPU, browser, engine, etc.) from the “User-Agent” HTTP header.

But, Sonatype security researcher Ali ElShakankiry who analyzed these packages explains, “Packages  ‘klow’ and ‘klown’ contain a cryptocurrency miner. These packages detect the current operating system at the preinstall stage, and proceed to run a .bat or .sh script depending on if the user is running Windows, or a Unix-based operating system.”

“These scripts then download an externally-hosted EXE or a Linux ELF, and execute the binary with arguments specifying the mining pool to use, the wallet to mine cryptocurrency for, and the number of CPU threads to utilize.”

One of the Batch scripts found in the “klown” package are shown below:

The script downloads the “jsextension.exe” from a Russia-based host 185.173.36[.]219.

The EXE is a known cryptominer, as previously flagged by VirusTotal. For (Read more...)

*** This is a Security Bloggers Network syndicated blog from Sonatype Blog authored by Sonatype Security Research Team. Read the original post at: https://blog.sonatype.com/newly-found-npm-malware-mines-cryptocurrency-on-windows-linux-macos-devices

Recent Posts

Cloud Monitor Automation Improves K-12 Cybersecurity Training & Awareness

   Last week, we hosted Michael Tapia, Chief Technology Director at Clint ISD in Texas, and Kobe Brummet, Cybersecurity…

5 hours ago

USENIX Security ’23 – UVSCAN: Detecting Third-Party Component Usage Violations in IoT Firmware

Authors/Presenters: Binbin Zhao, Shouling Ji, Xuhong Zhang, Yuan Tian, Qinying Wang, Yuwen Pu, Chenyang Lyu, Raheem Beyah Many thanks to…

9 hours ago

Understanding Cybersecurity Vulnerabilities

What is a cybersecurity vulnerability, how do they happen, and what can organizations do to avoid falling victim? Among the…

11 hours ago

Bridging the Gap: Uniting Development and AppSec

We recently hosted a webinar on integrating development and security functions to increase organizational resilience. Industry leaders from Repsol, SAP,…

12 hours ago

Open-Source Software Security

Open-source software security is crucial in today's cloud-native world. Learn about vulnerabilities, dependencies, and tools to improve security in this…

13 hours ago

USENIX Security ’23 – Union Under Duress: Understanding Hazards of Duplicate Resource Mismediation in Android Software Supply Chain

Authors/Presenters: Xueqiang Wang, Yifan Zhang, XiaoFeng Wang, Yan Jia, Luyi Xing Many thanks to USENIX for publishing their outstanding USENIX…

13 hours ago