Table of Contents
After experiencing the consequences of the vulnerability in WordPress plugin “WordPress Time Capsule” affeting version 1.22.20 and belowe, it became obvious that it was necessary to remove all the malicious code at once to prevent its further expansion
Here's a short description of what the script does:
- Deletes the files of the “WP Time Capsule” plugin (the script does not delete the plugin backups and settings)
- Recursively removes malicious files in the "wp-content" directory
- Recursively removes inserted malicious code in files in the "wp-content" directory
- Moves the important files and the wp-content directory to a temporary directory (e.g. ".htaccess", "wp-config.php" and "wp-content")
- Install the latest version of WordPress via WP-CLI and move files from the temporary directory to the main directory
It is also important to note that if the malicious code you encountered is different from our case, then you need to change the keywords and regular expressions in the script to remove the malicious code completely
Here are quick instructions on how to install the script
- PHP 5.4 or later
- WordPress 3.7 or later
- Download the script and wp-cli.phar file (WP-CLI)
- Make the files executable
$ chmod +x ./wordpress-timecapsule-fix.sh ./wp-cli.phar
When calling the script, it is necessary to specify the directory where the sites are located
$ ./wordpress-timecapsule-fix.sh /www/sitesIf the sites are located in the same directory but in a subfolder like “public”, then you need to change the script a bit
If you get affected by a vulnerability of a plugin, or your Wordpress website , we can prov
This script comes absoulutely with no warranty