Security Experts:

Connect with us

Hi, what are you looking for?



‘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.”

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.

Click to comment

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.

Join this webinar to learn best practices that organizations can use to improve both their resilience to new threats and their response times to incidents.


Join this live webinar as we explore the potential security threats that can arise when third parties are granted access to a sensitive data or systems.


Expert Insights

Related Content


Less than a week after announcing that it would suspended service indefinitely due to a conflict with an (at the time) unnamed security researcher...


Zendesk is informing customers about a data breach that started with an SMS phishing campaign targeting the company’s employees.


Satellite TV giant Dish Network confirmed that a recent outage was the result of a cyberattack and admitted that data was stolen.


The release of OpenAI’s ChatGPT in late 2022 has demonstrated the potential of AI for both good and bad.


The changing nature of what we still generally call ransomware will continue through 2023, driven by three primary conditions.


As it evolves, web3 will contain and increase all the security issues of web2 – and perhaps add a few more.

Application Security

PayPal is alerting roughly 35,000 individuals that their accounts have been targeted in a credential stuffing campaign.


No one combatting cybercrime knows everything, but everyone in the battle has some intelligence to contribute to the larger knowledge base.