I’m trying to figure out a cron job which will copy a file (timthumb.php) from the root of ftp (above our public_html directory) and recursively replace all existing instances of the file throughout the FTP. I’m also open to other ideas if someone has another method for doing this.
The master file would live at:
/timthumb.php
A cron would run daily to replace instances such as:
/public_html/wp-content/themes/xxxxxx/scripts/timthumb.php
or
/public_html/mysite1/tools/timthumb.php
(We’re assuming the instance will always be named timthumb.php, so there’s no need to look into the content of the file to match code)
The goal of this cron is to prevent old instances of timthumb from existing on our server.
Any help or ideas would be greatly appreciated
Thanks
-Sam
PS You can read about the timthumb exploit here:
http://markmaunder.com/2011/08/01/zero-day-vulnerability-in-many-wordpress-themes/
This would do it: