A new fileless cryptocurrency mining campaign has targeted over 1,500 exposed PostgreSQL servers. The campaign, attributed to the JINX-0126 threat actor, exploits weak or predictable credentials in publicly exposed PostgreSQL instances. Researchers from Wiz identified this attack as an evolution of a previous campaign using the PG_MEM malware.
The attackers have refined their techniques, deploying unique binaries and executing the miner payload filelessly to bypass detection.
The most notable tactic in this campaign involves abusing the COPY … FROM PROGRAM SQL command to run shell commands on compromised servers. Once attackers exploit vulnerable PostgreSQL configurations, they conduct reconnaissance and deploy a Base64-encoded payload.
This payload contains a script that removes competing miners and drops a binary named PG_CORE to establish further control.
In addition to PG_CORE, the attackers deploy an obfuscated Golang binary called postmaster, which mimics legitimate PostgreSQL processes. This binary sets up persistence by creating cron jobs and new roles with elevated privileges. It then writes another binary, cpu_hu, which downloads and launches the XMRig miner filelessly via the memfd Linux technique.
Wiz’s researchers discovered that the threat actor used three separate cryptocurrency wallets, each assigned around 550 workers. With over 1,500 compromised servers, the campaign has successfully established a large-scale cryptocurrency mining operation. This attack highlights the vulnerabilities of weakly configured PostgreSQL instances and the evolving tactics used by threat actors to remain undetected.