Three Malicious Libraries Found in PyPI Python Packages Directory

Three libraries containing malicious code have been identified in the PyPI (Python Package Index) catalog. In total, the packages managed to download almost 15 thousand times before the problems were identified and removed from the catalog.

The dpp-client (10194 downloads) and dpp-client1234 (1536 downloads) packages have been distributed since February and include code to send the contents of environment variables, which could include, for example, access keys, tokens, or passwords to continuous integration systems or cloud environments such as AWS. The packages also sent a list to the external host with the contents of the "/home", "/mnt/mesos/", and "mnt/mesos/sandbox" directories.

Three Malicious Libraries Found in PyPI Python Packages Directory

The aws-login0tool package (3042 downloads) was posted to the PyPI repository on December 1 and included code to download and run a Trojan application to take control of hosts running Windows. When choosing a package name, the calculation was made that the keys "0" and "-" are nearby and there is a chance that the developer will type "aws-login0tool" instead of "aws-login-tool".

Three Malicious Libraries Found in PyPI Python Packages Directory

The problematic packages were identified in a simple experiment in which Bandersnatch was used to download some of the PyPI packages (about 200 of the 330 packages in the repository), after which the grep utility was used to select and analyze the packages whose setup.py file mentions "import urllib.request" call, commonly used to send requests to external hosts.

Source: opennet.ru

Add a comment