What is Tim Thumb?
Tim Thumb is a php script that handles web images; it is used to resize, crop and enlarge JPGs, PNGs and GIF image formats. It was first developed and used as part of the Mimbo Pro WordPress theme, but it was so popular it ended up on most websites.
As with most new plugins or code that gain popularity so quickly, hackers took an interest as well. Hackers discovered that the code could be hacked and used to redirect traffic as well as redirect e-mails to third party sites.
The vulnerability was fixed quickly and the code was updated. But even today, not everyone is aware that they were compromised and continue to use the old script.
Luckily, there is a way to find out if you are compromised; if you are using the old version of the script. What you need to do is visit your website/blog (you may have to use a browser you normally don’t use or log out of your website). If, when trying to visit the website you’re redirected to a Google safety warning page that says something like – Warning: Something’s Not Right Here! – then you have a problem. That message can be caused by many things including a hacked “Tim Thumb” script.
There is also a Tim Thumb vulnerability checker page, that is more likely to find if you have the issue. It is a plugin you install. It scans your website for the vulnerability and it can also upgrade you to the safe Tim Thumb version. You can also do the update manually.
How To Fix The Tim Thumb Hack
You’re going to need to delete a few files from your WordPress directory:
/wp-admin/upd.php and /wp-content/upd.php need to go.
Then, you need to reinstall these files:
Last, but not least, you’ll need to open wp-config.php and delete the code that has been snuck through the Tim Thumb vulnerability. This is the what the bad code looks like:
There will also be some Tim Thumb script cached files that you’ll have to remove:
All of the code must be deleted.
After you’ve deleted the malicious code, you need to install a fresh, updated Tim Thumb version, and, just to be safe, change the password for your website and your MySQL password as well. The MySQL password is the one in your wp-config.php that allows WordPress to connect to the database.
After doing all of that, you manage to clean up the Tim Thumb hack. This is a good lesson. We often assume that things are ‘safe’ and that everything will work as it should. But in reality, we can’t be sure if the plugins we install are safe from hacking or if the person who wrote the plugin has good intentions. Sometimes it’s wise to wait a while when new plugins come out, so that there is time to see if it is a target before you install it. Sometimes there’s no time for that, so make sure you back up your website and database when you install new plugins!