[ << ALL_FEED ]

In the world of open-source malware: abc-library and the developer kakarot

More in Supply chain

In the world of open-source malware: abc-library and the developer kakarot

Over the past few days, we’ve been idly watching an interesting author who was trying to upload his disguised hacktools.

Meet one of our hero’s GitHub accounts: wsc33332f

Four projects in the Python Package Index are associated with this GitHub account.

Campaign timeline

Date Event
November 16
09:30 → 10:13
Publication of abc-library 0.1.0, 0.1.1, 0.1.2
PyPI account: karickwu
November 17 – 20 Publication of autoreply 0.1.0 – 0.2.1
PyPI account: karickwu
November 25
04:21 → 04:44
Publication of alogithms 1.0.1 – 1.0.3
PyPI account: kawerik
November 29, 07:11 Publication of alogrithms 1.0.0
PyPI account: kakarot

It’s nice to see stories like this that demonstrate how threat actors learn something new. The timeline already shows that the developer has learned to distribute the campaign across multiple accounts. But the changes were more extensive.

abc-library

The documentation states that this library with an unremarkable name is needed for arithmetic operations, executing commands in the system interpreter, and downloading payloads. Thanks for the honesty.

The author approached development methodically: in 0.1.0 he implemented arithmetic, in 0.1.1 (33 minutes later) — the exec function, in 0.1.2 (10 minutes later) — the download function.

At the end of 2026, it’s probably not even worth noting the fact that the project was most likely vibe-coded.


autoreply

Heavy development was already underway within this package: 11 versions were released over 4 days.

The author rewarded us with not one but two whole readmes: README.md and README_PLS.md

README_PLS.md adds information on how to use the file download functionality

Also noteworthy is a typo — the arithmetic division module is named devide.py instead of divide.py:

The author decided to add string obfuscation. Just in case, the artificial intelligence helpfully annotated how the obfuscated strings are decoded:

All right, jokes aside, there are places in the code where they left work for us:

And not without reason! The obfuscated strings also contain typos that remained even in the final version of the library

Misspelled name Correct name
COMSBEC COMSPEC
waitstasus_to_exitcode waitstatus_to_exitcode
Exjeeded Exceeded

The code for executing system commands has been improved: now all environment variables are passed into the shell, which can speed up exfiltration.

The attacker also started disguising the names of some functions:

Original name Functionality
read_power_series Performs a GET request with the specified headers, parses JSON / YAML, returns the result
sync_exponents Performs a POST request
read_coeff_map Uses read_power_series and verifies that the received response contains the required fields. Looks like a config validator
compute_exponents Checks for internet connectivity, sends the passed data to the specified C2

alogithms

In terms of logic, there are few changes. However, the developer read articles about common malware in PyPI and decided to study how .pth files work.

Using a file with the .pth extension, you can exploit the site-specific configuration hook mechanism in the standard site module. An analysis of the behavior can be read here.

It’s not enough to simply change the extension of a .py file to .pth. The attacker figured this out only after two releases:

The ghost of corporate development patterns began to appear in the code:

alogrithms

The developer almost immediately received a block on the previous package, probably even from several infosec vendors monitoring PyPI. After all, using .pth is a popular malicious pattern

So he decided to split the .pth logic into two files. This did not remove the file with that extension itself — and this release also fell victim to an almost instant banhammer.

———

Trojans in open source are primarily AI people, just like in any field. But while you are studying restoration and taking course in smithing working in IT — the attacker are training.

Want to protect developers from open source threats but don’t know where to start? Know about AppSec practices and want to try our analytics? We, the Supply Chain Security team, have a scanner for SBoMs and manifests for malicious releases based on our expertise. Write in the comments to PT Fusion.

#pypi #scs
@ptescalator

More from global_author

More from global_author

More in Supply chain