Connect with us

Hi, what are you looking for?

SecurityWeekSecurityWeek

Cybercrime

‘PGMiner’ Crypto-Mining Botnet Abuses PostgreSQL for Distribution

Palo Alto Networks security researchers have discovered a Linux-based cryptocurrency-mining botnet that being delivered via PostgreSQL.

Palo Alto Networks security researchers have discovered a Linux-based cryptocurrency-mining botnet that being delivered via PostgreSQL.

Dubbed PGMiner, the botnet exploits a remote code execution (RCE) vulnerability in PostgreSQL to compromise database servers and then abuse them for mining for the Monero cryptocurrency. However, the malware attempts to connect to a mining pool that is no longer active.

An open source relational database management system (RDBMS) widely used in production environments, PostgreSQL has a “copy from program” feature that was labeled as a vulnerability (CVE-2019-9193), something that the PostgreSQL security team quickly disputed.

The newly discovered PGMiner, which is believed to be the first crypto-mining botnet delivered via PostgreSQL, targets that disputed vulnerability to propagate.

The attack begins with scans for PostgreSQL servers and attempts to brute-force the password for the user “postgres”, which is present by default on the database. Next, the malware leverages the “copy from program” feature to deploy coin-mining scripts.

Introduced in PostgreSQL 9.3 in 2013, the feature allows a superuser (either local or remote) to run shell scripts on the server. Controversial right from the start, the feature was assigned a CVE in 2019, but the PostgreSQL community challenged it, which resulted in the CVE being considered “disputed.”

Advertisement. Scroll to continue reading.

The argument is that superuser privileges are required to use the feature and that it won’t be a risk if the access control and authentication system works as expected, but researchers fear that it opens PostgreSQL to remote exploitation and code execution directly on the server.

The malware was observed constantly reproducing itself through recursively downloading certain modules. Furthermore, the researchers identified similarities between the dropped crypto-miner and the SystemdMiner malware family.

On the infected machine, the malware attempts to download the curl binary if the curl command is not available. For communication with the command and control (C&C) server, the malware uses the SOCKS5 proxy technique.

The botnet then iterates through a list of folders to find one that allows it to create a file and update its attributes, thus ensuring that the downloader payload can be executed. Furthermore, client tracking functionality was included in the malware, as well as support for multiple architectures.

“PGMiner can potentially be disruptive, as PostgreSQL is widely adopted in PDMS. With additional effort, the malware could target all major operating systems. For example, PostgreSQL is available for all major platforms, including macOS, Windows and Linux. Theoretically, the malware actors could implement another version of PGMiner by targeting a new platform, such as Windows, and deliver it using PostgreSQL,” Palo Alto Networks concludes.

Related: Nearly 1,000 Vulnerabilities Found in Popular Open Source Projects in 2019

Related: Kinsing Linux Malware Deploys Crypto-Miner in Container Environments

Written By

Ionut Arghire is an international correspondent for SecurityWeek.

Daily Briefing Newsletter

Subscribe to the SecurityWeek Email Briefing for the latest cybersecurity threats, trends, and expert insights.

Click to comment

You must be logged in to post a comment Login

Leave a Reply

Daily Briefing Newsletter

Subscribe to the SecurityWeek Email Briefing to stay informed on the latest threats, trends, and technology, along with insightful columns from industry experts.

NOW LIVE: CISO Forum 2026 Summit

Join as we bring together CISOs, senior cybersecurity executives, practitioners, industry experts, and other security leaders to share practical experience and examine the issues shaping enterprise cybersecurity strategy.

Register

Join to learn the four levels of architecting security into the agentic SDLC – from securing the code your developers' agents write to running a coordinated system of security agents you've built yourself.

Register

People on the Move

Kirsten Davies has been appointed National Cyber Director.

Zifino has appointed Toney E. Jennings as CRO.

Zeke Maldonado has been named Principal Deputy CIO at the US Department of Commerce.

More People On The Move

Expert Insights

Daily Briefing Newsletter

Subscribe to the SecurityWeek Email Briefing to stay informed on the latest cybersecurity news, threats, and expert insights. Unsubscribe at any time.