Cloud security firm Wiz has uncovered a new fileless attack called PyLoose, which specifically targets cloud workloads to deliver a cryptocurrency miner.
This attack employs Python code to load the XMRig Miner directly into memory using the memfd technique, a known Linux fileless method. Notably, PyLoose represents the first documented Python-based fileless attack aimed at cloud workloads in the wild.
Wiz’s research identified nearly 200 instances where this attack method was used for cryptocurrency mining. While details about the threat actor behind PyLoose remain scarce, their sophisticated capabilities are evident. The attack chain observed by Wiz begins with the exploitation of a publicly accessible Jupyter Notebook service, allowing system command execution through Python modules.
PyLoose itself is a Python script with only nine lines of code, utilizing compression and encryption to embed a precompiled XMRig miner. The payload is retrieved from paste.c-net[.]org through an HTTPS GET request, bypassing the need to write the file to disk by loading it directly into the Python runtime’s memory.
The Python code then decodes and decompresses the XMRig miner, which is subsequently loaded into memory using the memfd memory file descriptor.
The attacker responsible for PyLoose took extensive measures to evade detection, including hosting the Python payload on an open data-sharing service, adapting fileless execution techniques for Python, and compiling the XMRig miner with its configuration embedded, avoiding disk interactions and conspicuous command-line activities.
Additionally, Wiz’s findings coincide with Sysdig’s report on an attack campaign by the threat actor SCARLETEEL, which exploits AWS infrastructure for illicit crypto mining and proprietary data theft.