Researchers have spotted a piece of WordPress malware that allows cybercriminals to collect information from WooCommerce stores and helps them set up compromised websites for future skimming attacks.
WooCommerce is a highly popular open-source eCommerce plugin for WordPress that allows site owners to easily set up their own online store. With more than 5 million installations, it is one of the biggest eCommerce platforms and is often targeted by cybercriminals for financial gain.
Attacks part of an ongoing campaign targeting vulnerable WordPress plugins employ malicious code designed to identify whether sites are using WooCommerce and then query data related to it, web security company Sucuri revealed.
Following initial exploitation, a malicious file is injected into the website’s hosting environment, which provides the attackers with the ability to map what the user/owner of the file has access to.
Written in PHP, the malware creates a series of functions used to search for other WordPress websites and connect to their database to gather WooCommerce data.
One of the functions defined in the malicious file recursively searches the surrounding directories, looking for wp-config.php in any directory and then for the default /wp-content/plugins/woocommerce/ directory.
If the second directory is found, WooCommerce related data is expected to be stored in the $woo variable array. The malware also implements a function to extract MySQL login data from available wp-config.php files, and another function to use the extracted credentials to access the WordPress database.
The malware submits a total of three SQL queries to the WordPress database, to get the number of orders, query the row data for orders in the posts table placed after March 1, 2020, and to search the postmeta table for data related to orders made on or after March 1. This allows the attackers to determine if the compromised store is active and if it has made transactions recently.
Furthermore, the malware drops three backdoors to any identified directory, and then provides the attacker with URLs to the first backdoor.
Responding to a SecurityWeek inquiry, Sucuri’s security researchers said that none of the backdoors contained any WooCommerce specific skimmers. However, the attackers are believed to be setting up for future skimmer attacks against the already backdoored WooCommerce websites.
“If the backdoors are removed and the attackers lose access then they will still have the customer data (not any of the payment data information) that can still be sold for identity theft purposes,” the researchers said.
According to the researchers, although it still needs some refinement, the malware is a great example of how attackers can abuse unauthorized access to identify new targets within compromised hosting environments.
“Since this malware doesn’t load on the front of site, it is best detected with a server-side scanner that can monitor the filesystem for changes and doesn’t merely rely on loading a website to detect indicators of compromise,” Sucuri notes.
Related: Hackers Can Inject Code Into WordPress Sites via Flaw in Product Review Plugin
Related: Flaw in WordPress Plugin Grants Access to Google Search Console
Related: Vulnerabilities in ‘Page Builder’ Plugin Expose 1 Million WordPress Websites