Python packages caught attempting to steal Discord tokens, credit card numbers

The operators of the Python Package Index (PyPI), the official repository for Python components, have removed eight libraries this week that contained malicious code.

Discovered by the JFrog security team, formerly known as VDOO, the eight packages can be grouped into two categories based on the malicious operations they performed.

Two of the eight allowed a remote attacker to run malicious commands on a victim's device by making the infected host connect to an attacker's IP address on TCP port 9009, and then execute any malicious Python code provided by this server.

PyPI packages allowing RCE: pytagorapytagora2 (uploaded by a user named leonora123)

The other six PyPI packages worked primarily as stealers. Once installed on a developer's computer, they collected data from the infected host with a focus on general system information, Discord tokens (scraped from predetermined disk locations), and payment card information (extracted from locally installed browsers such as Google, Opera, Brave, and Yandex).

Python packages acting as stealers: noblesse, genesisbot, are, suffer, noblesse2, noblessev2 (first three developed by user xin1111, while the last three by user suffer)

Based on statistics gathered through third-party service Pepy, the JFrog team said the eight libraries were downloaded more than 30,000 before being removed from the PyPI portal.

An in-depth technical report about each library's technical capabilities is available on the JFrog blog.

This week's incident is also not that out of the ordinary. Malicious packages make it on the official PyPI repository on a regular basis, along with the official repositories of many other programming languages.

For example, security researchers previously discovered malicious PyPI packages that contained a hidden backdoor targeting Linux systems, PyPI packages that opened reverse shells on infected hosts, and PyPI packages that stole SSH and GPG keys.

Furthermore, Discord tokens have also been at the center of incidents on the npm (JavaScript) repository at least on two different occasions.

This particular batch of malicious libraries is of particular interest to their victims because they also might have collected payment card information that could be abused for fraudulent transactions.

While Discord tokens can be revoked and SSH keys can be changed, dealing with fraudulent transactions and canceling and changing payment cards is a far lengthier and complicated process that many victims will now have to get ahead of.

Get more insights with the
Recorded Future
Intelligence Cloud.
Learn more.
No previous article
No new articles
Catalin Cimpanu

Catalin Cimpanu

is a cybersecurity reporter who previously worked at ZDNet and Bleeping Computer, where he became a well-known name in the industry for his constant scoops on new vulnerabilities, cyberattacks, and law enforcement actions against hackers.