Malicious Python package discovered that steals Discord tokens and installs a shell

news

According to the operators of the Python Package Index (PyPI), 11 Python libraries have been removed from the portal.

Malicious packages in PyPI use stealthy exfiltration methods
Software supply chain security threat: automated scanning of Python packages in the PyPI repository uncovered stealthy m...

According to the security team at JFrog, the DevOps platform that discovered this malicious library, 11 packages had been downloaded and installed over 30,000 times before the package was discovered.

It also appears that these packages were not developed by the same author, and each package contained slightly different behaviors and methods for exploiting data from infected systems, as shown in the table below.

Package# of downloadsAutomated detection indicatorsDescription
importantpackage

important-package
6305

12897
Shell process with obfuscated input  Hidden connectback shell to psec.forward.io.global.prod.fastly.net, using the trevorc2 client
pptest10001Suspicious version²Uses DNS to send hostname+'|'+os.getcwd()+'|'+str(self.get_wan_ip())+'|'+local_ip_str
ipboards946Sensitive file handling Suspicious versionDependency confusion, sends user info (username, hostname) via DNS tunneling to b0a0374cd1cb4305002e.d.requestbin.net
owlmoon3285eval with obfuscated input Discord token stealer trojan. Sends tokens to https://discord.com/api/webhooks/875931932360331294/wA0rLs3xX_2JgqlfqEfpYoL9zer_Qs7hpsMbwaDl6-UByE_ZRHiXm0t1lr-o_3RFBqBR
DiscordSafety557exec with obfuscated inputDiscord token stealer trojan. Sends tokens to https://tornadodomain.000webhostapp.com/stlr.php?token=
trrfab287Sensitive file handling Suspicious version Dependency confusion, sends user info (id, hostname, /etc/passwd, /etc/hosts, /home) to yxznlysc47wvrb9r9z211e1jbah15q.burpcollaborator.net
10Cent10

10Cent11
490

490
Shell spawning Suspicious versionConnectback shell to hardcoded address 104.248.19.57
yandex-yt4183Suspicious versionPrints pwned message and directs to https://nda.ya.ru/t/iHLfdCYw3jCVQZ, could be a malicious domain (currently seems inactive)
yiffparty1859eval with obfuscated inputDiscord token stealer trojan. Sends tokens to https://discord.com/api/webhooks/875931932360331294/wA0rLs3xX_2JgqlfqEfpYoL9zer_Qs7hpsMbwaDl6-UByE_ZRHiXm0t1lr-o_3RFBqBR


As is clear from the table above, 10 of the 11 packages were clearly malicious. One package, named “yandex-yt”, could easily be a distribution channel for malware.

This is a technique where an attacker registers a package with a name that may be in use within a closed enterprise network, and anticipates that the public package will be pulled when the enterprise package is removed and the dependency tree is not updated.

JFrog researchers have published a detailed analysis of each of the 11 malicious PyPI packages they have discovered.

Comments

Copied title and URL