How to Clean Malware

Numerous sites are affected already by for.dontkinhooot[.]tw & lovegreenpencils malware, directing users to:
This contamination affects PHP files, JS files, wp_posts tables, site URLs.

Need help? Let us clean your site.

Since this type of contamination is so severe, I would recommend to:
a) Check other sites hosted on the same hosting account.
If malware infection is widespread, each site should be isolated, to prevent cross-site contamination.
b) Perform a site rebuild for each WordPress instance, manually adding plugins, theme and core files from official sources.

To fix a hacked website, follow these steps:

Step 0
Backup site
1. Backup database and site files. If you can’t do it, ask your web host.
2. Disable MySQL remote access, especially if you’re using Plesk.
3. Change MySQL user password.

Step 1
Rebuild site
1. Download a fresh WordPress copy:
2. Extract, add wp-config.php from your infected site inside wordpress folder ( make sure you check its content and clear malicious lines – if any ).
3. Add plugins and theme manually, one by one, inside /wp-content/plugins/ and /wp-content/themes/
4. Upload everything back to your server.

Step 2
Reset site URL
Restore site URL:
Easiest way would be to edit wp-config.php file via FTP or hosting dashboard ( replace with your own domain name ).

define( 'WP_HOME', '' );
define( 'WP_SITEURL', '' );
Step 3
Clean local files
If site rebuild still contains plugins or theme from a previous backup, all index.php and JS files may be corrupted as well.
Look for “$a=chr(“, “chr(104)”, “String.fromCharCode”, “lovegreenpencils”, and “list.insertBefore(s, list.childNodes[0])”.

Insert the following script with pack.php file and place it inside your root folder. This way you can pack all PHP and JS files, which can be cleaned locally.

Search and replace tools for malicious strings inside multiple files: dnGrep, grepwin, VisualGrep ( mac ), powergrep ( paid ).
Example of infected index.php file:

Example of infected JS file:

Step 4
Database check
1. As a precaution measure, look for “lovegreenpencils” and “dontkinhooot” then for “String.fromCharCode”.This way you will know if other tables are infected as well.
Injections usually target wp_posts and wp_options tables. Example:

The following SQL commands may be used to clear any malicious JS:

2. Check users with administrator privileges.

Step 5
Major update
Perform a major update, making sure core files, theme and plugins are up to date.
Disable any unmaintained abandoned plugins.

Step 6
Blacklist status & Google cache
Site should be verified with Google search console. To refresh indexed pages, ask for a re-index.
This way, any infected cached pages listed on Google will be updated.

Step 7
Cross-site contamination
If you’re using a single cPanel for multiple websites, all index.php and JS files may be infected.
So make sure other sites hosted on the server are secured. And better move each site with a separate cPanel, after cleanup will be completed.

Step 8
Find and remove backdoors
Attacker will often install a backdoor file, to regain access later on. In this particular case, PHP scripts can be found inside /uploads folder.
Here are some live samples from the server logs: – – [31/Jan/2021:12:15:40 +0000] “POST /wp-content/themes/twentytwentyone/assets/sass/05-blocks/heading/code.config.php hxxp/1.1” 200 – – [31/Jan/2021:13:09:47 +0000] “GET /wp-content/themes/twentytwentyone/assets/sass/05-blocks/table/sys.suspected.php hxxp/1.0” 200 – – [11/Feb/2021:21:00:16 +0000] “POST /media-admin.php hxxp/1.1” 200 – – [20/Feb/2021:05:39:33 +0000] “GET /wp-content/uploads/wp-stream.php hxxp/1.1” 302

Try our Free site check.

If your Google Ads are currently suspended, we would recommend our Platinum plan, which will include malware cleanup and Ads support:

Decoded chr() malware:

	"header"("Location: hxxps://for.dontkinhooot[.]tw/walkers?id=0092");
	echo "<script>window.stop();
	var a = hxxps://for.dontkinhooot[.]tw/walkers?id=0093document.location.href=a;
"header"("Location: hxxps://irc.lovegreenpencils[.]ga/55ryery?id=22584&rs=2346");

Malware sample:

Malware sample ( PHP files ):

Malware javascript ( JS files ):

Malicious URLs:

Malicious networks:[.]tw/dns – DigitalOcean – DigitalOcean, LLC,,,,,,,, dontkinhooot[.]tw,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,