Armando found that basic-crypt v1.5.4, published to PyPI on November 30, 2026, is a macOS-only release that brings the package's malicious native module to Apple Silicon. It ships a single wheel for macOS 14 on arm64 whose compiled _native.so checks the names of loaded modules for one that exists only when the requests library is imported, uses that name to decrypt its payloads, and then plants a launcher in a genuine copy of setuptools' _distutils_hack module. On every later Python start, the launcher runs a stager that drops a short-lived ~/.pip3.py script, executes code returned by a Supabase edge function, and then overwrites the script with a harmless-looking pip upgrade command. Because the colook package requires basic-crypt without a version pin, colook installs on Apple Silicon Macs resolve to this release. basic-crypt has recorded 1,727 downloads.
Key Findings
- Malicious version: v1.5.4, published 2026-11-30 10:57 UTC; basic-crypt has no clean release
- Entry point: no install hook -- the payload runs when the compiled extension
basic_crypt._native is loaded by import basic_crypt, which colook performs at import time
- Targets: macOS on Apple Silicon (macOS 14+, arm64); installs a persistent remote-code loader
- Evasion: platform-specific wheel published weeks after the original release; payloads encrypted with a custom cipher keyed on the uppercased name of a
requests sub-module; launcher appended to a genuine setuptools file; stager script overwritten with a decoy one second after launch and deleted by the fetched code
- Detection: MacOS.Trojan.SupplyChain, Text.Trojan.SupplyChain, Archive-ZIP.Trojan.SupplyChain
Package Background
basic-crypt was first published on October 21, 2026 by the PyPI account simendi, which owns no other packages, and declares no source code repository. It offers classroom ciphers -- affine, Atbash, rail fence, ROT13, RC4, XOR and CRC-32 -- with an optional native extension for xor_bytes and crc32. Its earlier releases shipped prebuilt modules for Linux x86_64 and Windows x64 only.
v1.5.4 arrived more than five weeks later with no source distribution and no Linux or Windows wheels -- only basic_crypt-1.5.4-py3-none-macosx_14_0_arm64.whl. Its effect is to close a gap: colook, a terminal-colors package that depends on basic-crypt without a version constraint and imports it at load time, now pulls in a native implant on Apple Silicon Macs as well.
Attack Analysis
A native module with an unexplained second job. The Mach-O module exports the expected xor_bytes and crc32, but it also contains routines named HashString, XorString, FindKeyFromList, Decompress, CreateFileA, WriteAppendA and mkdirRecAssignMode. Armando disassembled the module's initialization routine, PyInit__native, to see how they are used.
Finding the key in the developer's environment. At initialization the module fetches the interpreter's module dictionary, collects every loaded module name into a list, uppercases each one, hashes it, and compares the hash with a stored constant. The matching name is REQUESTS.PACKAGES.URLLIB3.UTIL.CONNECTION, which only exists after requests has been imported. If no name matches, initialization finishes normally and the extension behaves like an ordinary speed-up module. In a sandbox that imports basic-crypt or colook alone, that is all an analyst sees.
Decrypting the payloads. With the key, the module runs a custom stream cipher -- a rolling one-byte state seeded from the key's average byte value, mixed with each byte's index and two key bytes, while the key position advances by an irregular step -- over its embedded data, then zlib-inflates the results. Armando reimplemented the cipher and decrypted the payloads: a complete, genuine copy of setuptools' _distutils_hack/__init__.py; a launcher marked with ##; a stager; and the file name and contents of setuptools' standard distutils-precedence.pth.
Persistence inside setuptools. The module asks Python's site module for the user site-packages directory, creates _distutils_hack/ there, writes the genuine setuptools file and the stager (__base__.py), appends the launcher to __init__.py if it is not already present, and writes distutils-precedence.pth, whose one line imports _distutils_hack at every interpreter start. The launcher takes an exclusive lock on /tmp/nt.t so only one copy runs, and starts __base__.py detached with its output discarded.
A stager that cleans up after itself. __base__.py makes sure requests is installed, then writes ~/.pip3.py, forks, and runs it with a --upgrade argument so the process looks like a pip maintenance task. One second later, the parent overwrites ~/.pip3.py with a two-line script that upgrades pip. The real script calls https://tzqrmubxuluyccmiialf.supabase.co/functions/v1/register with a hard-coded Supabase anonymous-key bearer token and TLS verification disabled, base64-decodes the value field of the response, executes it, and then deletes its own file. The final payload is whatever the operator serves from that endpoint.
Malicious Files
_native.so (MacOS.Trojan.SupplyChain) is the Mach-O arm64 native module. Its initialization routine hashes uppercased sys.modules names (gate key REQUESTS.PACKAGES.URLLIB3.UTIL.CONNECTION), decrypts and inflates its payloads, writes a launcher into the user site-packages _distutils_hack module, and drops a ~/.pip3.py stager that fetches and executes code from a Supabase edge function.
METADATA (Text.Trojan.SupplyChain) is the wheel's manifest for the malicious release.
Recommendations
Developers and security teams should take the following steps:
- Identify exposure: Check whether basic-crypt v1.5.4, or colook, appears in your dependency tree on macOS machines. Any Mac that imported basic-crypt (directly or through colook) in a process where
requests was loaded should be considered compromised.
- Remove the packages: Uninstall basic-crypt and colook. basic-crypt has no clean release.
- Remove the persistence manually: Uninstalling does not remove the implant. In the user site-packages directory (
python3 -m site --user-site), inspect _distutils_hack/__init__.py for code appended after the setuptools module, delete _distutils_hack/__base__.py, and review distutils-precedence.pth. Delete ~/.pip3.py and /tmp/nt.t if present.
- Inspect affected systems: Look for outbound requests to
tzqrmubxuluyccmiialf.supabase.co and for Python processes started with ~/.pip3.py --upgrade, and rotate credentials available to the affected user.
- Scan your software supply chain: Use Spectra Assure Community to check whether packages in your environment have been flagged.
Indicators of Compromise
Malicious Files
| Filename | SHA256 | Detection |
|---|
| _native.so | f77c1993e98530b414b8d6e2da05499fd209b42036b5d33586ce077977118174 | MacOS.Trojan.SupplyChain |
| METADATA | f48d75e5d89acf4dcef2ebca093510443863909d3807d1350939ab584f3e1c9b | Text.Trojan.SupplyChain |
Network IOCs
| URL / IP | Purpose |
|---|
| https://tzqrmubxuluyccmiialf.supabase.co/functions/v1/register | Command-and-control endpoint; the stager fetches base64-encoded Python from this Supabase edge function and executes it |
Archive Hashes
| File | SHA256 |
|---|
| basic_crypt-1.5.4-py3-none-macosx_14_0_arm64.whl | c6e4832096feccfcfc79da180dfcac972be05b53778c46cf10465057cf78c046 |