Category: WordPress Security / Malware
Threat: WordPress Backdoor / Persistent Malware
Severity: Critical
Target Audience: WordPress Website Owners / Administrators
1. Overview
SC is a type of WordPress backdoor that can rebuild itself after malicious files are deleted.
If a malware file is deleted but reappears seconds later, this usually indicates that another copy of the malware still exists somewhere within the website or database and is restoring the deleted file.
Therefore, simply deleting the recurring file is not sufficient. The persistence mechanism responsible for recreating the file must also be identified and removed.
2. Possible Signs of Infection
A WordPress website may be compromised if you notice one or more of the following:
-
A deleted malware file keeps coming back.
-
An unknown plugin appears.
-
A deleted plugin reappears.
-
An unknown administrator account exists.
-
A security plugin is unexpectedly disabled.
-
.user.ini, db.php, or advanced-cache.php has been modified without your knowledge.
-
Suspicious or heavily encoded code appears in functions.php.
-
An unknown ZIP file appears in the WordPress directory.
-
The website makes unexpected connections to Ethereum gateway services.
3. Check .user.ini
Look for:
.user.ini
Check whether it contains:
auto_prepend_file=
The auto_prepend_file directive causes PHP to load a specified file before processing PHP requests.
If it points to an unknown, hidden, or suspicious PHP file, it should be investigated.
SC has been observed using this mechanism to load a malicious file before normal WordPress processing.
Important: Do not simply delete the referenced file without first disabling the auto_prepend_file configuration.
4. Check WordPress Drop-in Files
Check the following files:
wp-content/db.php
wp-content/advanced-cache.php
If these files exist and were not intentionally created by you or a trusted WordPress plugin, investigate them carefully.
SC may use these WordPress drop-in files as persistence mechanisms.
5. Check Must-Use Plugins
Check:
wp-content/mu-plugins/
Look for:
Must-Use Plugins are automatically loaded by WordPress and can therefore be used to hide persistent malware.
SC has been observed with copies in both mu-plugins and normal plugins.
6. Check Installed Plugins
Go to:
WordPress → Plugins → Installed Plugins
Review every installed plugin.
Pay particular attention to:
-
Unknown plugins
-
Plugins you did not install
-
Plugins with suspicious names
-
Plugins pretending to be caching or security plugins
-
Plugins that reappear after being deleted
SC may disguise itself as a legitimate-looking caching plugin.
7. Check Theme functions.php
Check:
wp-content/themes/<active-theme>/functions.php
Look for code that:
-
You do not recognise
-
Was recently added
-
Appears at the bottom of the file
-
Contains heavily encoded strings
-
Contains functions unrelated to the theme
-
Contains suspicious loaders or remote requests
SC may inject code into functions.php to maintain persistence.
Recommendation: Create a backup before modifying functions.php.
8. Check for Suspicious ZIP Files
Look for unknown ZIP files in:
wp-content/
wp-content/uploads/
wp-content/themes/
Pay attention to ZIP files with:
SC may use ZIP files as part of its restoration mechanism.
9. Check the WordPress Database
If you have access to phpMyAdmin, inspect the WordPress database.
The main tables to review are:
wp_options
wp_users
wp_usermeta
Note: Your database table prefix may not be wp_.
9.1 Check wp_options
Look for:
SC has been observed storing a copy of the backdoor in the WordPress options table under an unknown/random option name.
Warning: Do not delete database records unless you are certain they are malicious. Always create a database backup first.
10. Check Administrator Accounts
Go to:
WordPress → Users → All Users
Review all administrator accounts.
Look for:
-
Unknown administrators
-
Unexpected usernames
-
Accounts you did not create
-
Recently created administrator accounts
-
Suspicious email addresses
SC can create or take over administrator accounts and hide them from normal WordPress views.
If you find a suspicious administrator:
-
Verify whether the account is legitimate.
-
Check the username and email address.
-
Check when the account was created.
-
Remove the account if confirmed as malicious.
-
Change passwords for legitimate administrators.
11. Check WordPress Scheduled Tasks
WordPress uses scheduled tasks to perform automated actions.
You can use a trusted plugin such as WP Crontrol to review scheduled events.
Look for tasks that:
-
You do not recognise
-
Execute suspicious PHP functions
-
Appeared around the time of the infection
-
Are related to files that keep coming back
SC may use scheduled tasks to restore malicious files.
12. Do Not Repeatedly Delete the Same Malware File
This is one of the most important points.
If the sequence looks like this:
Delete malware
↓
File comes back
↓
Delete again
↓
File comes back again
Do not continue deleting the same file repeatedly.
This strongly suggests that another persistence mechanism is still active.
Check:
.user.ini
wp-content/db.php
wp-content/advanced-cache.php
mu-plugins
plugins
functions.php
wp_options
wp_users
scheduled tasks
13. Recommended Cleanup Sequence
Follow this general sequence when cleaning a potentially infected WordPress website.
Step 1 — Create a Backup
Before making changes:
Keep the backup in case a legitimate file or database record is accidentally modified.
Step 2 — Disable auto_prepend_file
If .user.ini contains:
auto_prepend_file=
disable the suspicious configuration first.
PHP may retain the configuration temporarily, so changes may not take effect immediately.
Step 3 — Remove Database Persistence
Review:
wp_options
Identify suspicious or malicious records and remove them only after confirming their purpose.
Step 4 — Remove Suspicious Administrator Accounts
Review all administrator accounts.
Remove accounts that have been confirmed as unauthorised or malicious.
Step 5 — Review Scheduled Tasks
Review WordPress scheduled events and remove confirmed malicious tasks.
Step 6 — Remove Malicious Files
Once the persistence mechanisms have been addressed, remove confirmed malicious files, including:
db.php
advanced-cache.php
malicious plugins
malicious MU plugins
malicious functions.php code
suspicious ZIP files
malicious loader files
SC can maintain multiple copies of itself, allowing one copy to restore another.
14. Scan the Website Again
After cleanup:
-
Run a WordPress malware scan.
-
Scan all WordPress files.
-
Scan the database if supported by the security tool.
-
Review administrator accounts again.
-
Monitor file changes.
-
Check whether previously deleted malware returns.
If the malware comes back, assume that a persistence mechanism has not yet been removed.
15. Update WordPress and Plugins
After cleaning the website:
Many compromised WordPress websites are initially breached through vulnerabilities in outdated plugins, themes, or other website components.
16. Change Important Passwords
After cleaning the website, change passwords for:
If there is a possibility that WordPress authentication keys were compromised, consider regenerating the WordPress security keys/salts.
The source recommends changing passwords and keys that may have been accessible to the attacker.
17. Quick End-User Checklist
[ ] Create a website backup
[ ] Create a database backup
[ ] Check .user.ini
[ ] Check auto_prepend_file
[ ] Check wp-content/db.php
[ ] Check wp-content/advanced-cache.php
[ ] Check mu-plugins
[ ] Review installed plugins
[ ] Check theme functions.php
[ ] Search for suspicious ZIP files
[ ] Review wp_options
[ ] Review wp_users
[ ] Review administrator accounts
[ ] Review WordPress scheduled tasks
[ ] Remove confirmed malicious persistence
[ ] Remove confirmed malicious files
[ ] Run a malware scan
[ ] Update WordPress Core
[ ] Update plugins
[ ] Update themes
[ ] Remove unused plugins/themes
[ ] Change administrator passwords
[ ] Change hosting/FTP/database credentials
[ ] Regenerate WordPress security keys if necessary
[ ] Monitor for reinfection
18. When to Contact Your Hosting Provider or Security Specialist
Contact your hosting provider or a security professional if:
-
The malware keeps coming back after cleanup.
-
You cannot identify what is recreating the malware.
-
You do not have database access.
-
You are unsure whether a PHP file is legitimate or malicious.
-
The website continues showing suspicious behaviour after cleanup.
-
You suspect administrator credentials have been compromised.
-
The website processes online payments and you suspect malicious JavaScript or checkout code injection.
19. Key Rule
If a WordPress malware file keeps coming back, do not assume that deleting the file again will solve the problem.
The correct approach is:
Identify persistence → Disable persistence → Remove malicious components → Scan again → Patch the original vulnerability → Change credentials → Monitor
If the malware returns after cleanup, there is likely still another copy or persistence mechanism present.
Deleting the same file repeatedly does not fix the root cause when another copy of the malware is still active.