Cybersecurity researchers have recently discovered a malicious package on the Python Package Index (PyPI) named pytoileur, posing as an API Management tool. This package conceals code that downloads and installs trojanized Windows binaries capable of surveillance, persistence, and cryptocurrency theft. Detected by Sonatype’s automated malware detection systems, the package was quickly flagged and removed after being downloaded 264 times.
Pytoileur utilized deceptive techniques to evade detection, such as labeling itself with appealing yet vague descriptions and hiding malicious code within extensive whitespaces in the setup file. The hidden code executed a base64-encoded payload to retrieve a malicious executable, “Runtime.exe,” from an external server. This binary employed PowerShell and VBScript commands for installation and persistence on infected systems, while also using anti-detection measures to evade security analysis.
The malware targeted user data stored in web browsers and accessed assets associated with cryptocurrency services like Binance and Coinbase. Further investigation revealed that pytoileur is part of a larger campaign involving multiple malicious packages on PyPI, all using similar tactics to download trojanized binaries. Other packages identified in this campaign include “gpt-requests” and “pyefflorer,” which also used base64 encoding to hide malicious payloads.
Sonatype’s advisory highlighted that these attacks often involve developers from various niches, such as AI and machine learning enthusiasts, as well as those relying on popular Python frameworks. The reemergence of identical malicious packages signifies threat actors’ continued efforts to recycle old tactics, expanding their targets and netting more victims in the process.
Reference: