Cyber Security News

Research Discovered 116 Malicious PyPI Packages Downloaded Over 10,000 Times

A cluster of malicious Python projects has been identified in PyPI, the official Python PyPI package repository, which targets both Windows and Linux systems and often deploys a custom backdoor.

In certain instances, the ultimate payload consists of a simplified clipboard monitor designed to steal cryptocurrencies, a version of the notorious W4SP Stealer, or both.

In 53 projects, 116 malicious packages were found by ESET Research in PyPI, the official repository for software related to the Python programming language.

10,000 Downloads Of Malicious Packages

Python programmers frequently use PyPI to share and download code. Since anybody can add to the repository, malware may appear there, occasionally taking the form of popular, legitimate code libraries.

The victims downloaded these files more than 10,000 times in the last year. The download rate has been roughly 80 per day since May 2023.

Malicious package downloads over the past year from PyPI using pip

PyPI packages come in two forms: wheels, or prebuilt packages, which could include compiled modules for a particular Python version or operating system, and source packages, which are built after installation and contain full project source code.

The Python code in the source distribution differs from that in the built distribution in several cases. The malicious code is present in the latter, but the former is clean. 

When a wheel is available, Python’s package manager, pip, prefers it over a source distribution. Thus, the malicious one is installed unless explicitly stated in distinct ways.

The malicious code has been discovered to be bundled into Python packages by the threat actors behind the activity using three different techniques: a test.py script, PowerShell embedded in the setup.py file, and an obfuscated form incorporated in the __init__.py file.

In some packages, main module imports the malicious code

The second method involves inserting PowerShell code into the setup.py file, which is normally launched automatically to assist with the installation of Python projects by package managers like pip.

Malicious PowerShell script is embedded in the setup.py file

In the third strategy, the operators just include the malicious code in the package, disguised only slightly, with no attempt made to include legitimate code.

At the time of this research, PyPI had already removed most of the packages. At the time of this research, PyPI had already removed the majority of the packages. You may view the whole list of 116 packages in the GitHub repository.

“Python developers should thoroughly vet the code they download, especially checking for these techniques, before installing it on their systems. As well as continuing to abuse the open-source W4SP Stealer, the operators have also deployed a simple, but effective, backdoor”, researchers said.

Dhivya

Divya is a Senior Journalist at Cyber Security news covering Cyber Attacks, Threats, Breaches, Vulnerabilities and other happenings in the cyber world.

Recent Posts

Hackers Target AI Infrastructure With RCE, Prompt Injection and API Key Theft

Hackers are actively probing AI systems, turning exposed gateways and agent tools into routes for…

4 hours ago

Hackers Make Phishing Pages Change Their Code Every Time Someone Opens Them

Hackers are making some phishing pages harder to track by changing the code delivered to…

4 hours ago

Iran-Linked Hackers Reportedly Knock UK Power Plant Offline for Four Days

A cyber incident reportedly forced a British power plant to halt operations for about four…

5 hours ago

Russian Hackers Use New HOOKEDGE Malware to Spy on European Defense and Diplomatic Targets

Russian hackers have used a new backdoor called HOOKEDGE to target defense manufacturers, government bodies,…

6 hours ago

Ransomware Gang Claims AI Can Analyze 700GB of Stolen Data Every Hour

TITAN ransomware is pairing file encryption with an ambitious claim: artificial intelligence that can sort…

6 hours ago

Hackers Compromise Hundreds of WordPress Sites to Deploy Amatera Stealer via ClickFix

A fake student resume is being used to place a remote-access tool on researchers’ Windows…

7 hours ago