A new malware campaign has compromised over 5,000 WordPress sites by creating unauthorized admin accounts, installing a malicious plugin, and exfiltrating data.
Once a site is targeted, a harmful script is loaded from the domain wp3(.)xyz. This script creates a rogue admin account named wpx_admin, using credentials hardcoded within the code itself. The script first retrieves the necessary CSRF token for authentication. It then sends a POST request to the site, triggering the creation of the user account. The script also logs the result of the operation.
Once the script downloads the malicious plugin from https[:]//wp3(.)xyz/plugin(.)php
, it activates the plugin on the compromised site.
The script then communicates with https[:]//wp3(.)xyz/tdw1(.)php
, sending sensitive information, including admin credentials and operation logs, through obfuscated image requests.
Then, Finally the attacker gains admin access, the script uploads a malicious plugin to the WordPress site. It does so by fetching the plugin from a remote server and submitting it through the WordPress plugin installation page.
The installPlugin function works as follows:
Fetches the plugin upload page to retrieve the CSRF token, which is needed to bypass security protections.
Downloads the malicious plugin from the remote server.
Submits the plugin for installation, including the CSRF token, completing the process and installing the malicious plugin.
Indicator of Compromise (IOC):
How to Protect Yourself from This Type of Attack?
Block Malicious Domains: Use firewalls to block domains like https://wp3(.)xyz.
Audit Admin Accounts: Regularly check for unauthorized users.
Remove Suspicious Plugins: Validate and clean plugins on the site.
Enhance CSRF Protections: Implement stronger CSRF defenses.
Enforce Multi-Factor Authentication (MFA): Require MFA for all admin accounts.
Limit Login Attempts: Use tools to block IPs after multiple failed logins.
Deploy a Web Application Firewall (WAF): Block malicious traffic and requests.
Conduct Regular Security Audits: Review WordPress setup for vulnerabilities.
Apply Least Privilege: Limit admin access to only trusted users.
Enforce Strong Passwords: Require complex, regularly updated passwords.
Use Intrusion Detection (IDS): Monitor for abnormal server activity.
Secure Sensitive Data: Protect credentials, config files, and backups.
Disable XML-RPC: Turn off if not needed to avoid exploit risks.
Backup Regularly: Ensure frequent backups and test restoration.
Use SSL/TLS Encryption: Enforce HTTPS for secure communication.
Useful Resources for Web Security Checks:
Conclusion:
In conclusion, once an attacker gains administrative access, they can bypass security measures like CSRF tokens to upload and install a malicious plugin. This enables them to take full control of the site, often without immediate detection. To prevent such attacks, it’s crucial to enforce strong admin credentials, restrict plugin uploads to trusted sources, and regularly audit installed plugins. Additionally, keeping the WordPress platform and its components up to date is essential in reducing vulnerabilities that could be exploited by attackers.
Happy Learning !!