Drupal have advised that if you didn't update your site within 7 hours of the Drupal SA-CORE-2014-005 security release, you should assume your site has been compromised and roll-back to a pre October 15th backup. Below are some steps you can take to ascertain whether your site was compromised, and steps to take if you're unable to roll-back to pre-15th October.
- Check files integrity for changes using Git status or if not possible using Hacked;
- Scan public / private files locations for *.php, *.sh and any other suspicious files. There are some strategies to improve this procedure: for instance, if only images uploads are allowed, then scan for files other than images;
- If the webserver setup is permissive in terms of permissions and users (e.g. Apache user can write anywhere), it will be additionally required to perform audit of the entire server;
- Install, Security review, Drupalgeddon, Site Audit contributed modules and execute these modules checks;
- Set another Drupal hash salt in settings.php file for password generation;
- Reset passwords of all users ;
- If pages are built using the Features module, and it's possible, then revert all the features to their original state;
- Rebuild the menu executing core ‘menu_rebuild()’ function;
- Access the website as an admin user and define a list of areas that need to be manually checked, for instance:
- Review the `variable` table to find any suspicious values. On some installations it might be possible to truncate the table entirely, if the Features module is used and if default values of variables are acceptable.
- Check the database for new MySQL users, update MySQL passwords and regenerate passwords/tokens for any systems, which are integrated;
- Check users to find if any have ‘admin’ role when they shouldn't.
See thispost for SQL scripts to check for new admin users created after the 15th Oct.
- Check roles to find if any have altered permissions, or any new ones have been created.
See this post for a SQL script to check for new roles created after the 15th Oct.
- Check `menu_router` and `users` tables for suspicious entries, e.g. with ‘file_put_contents’ callbacks;
- If MySQL/Apache logs are available then they can be used to perform additional checks and detect attacks by patterns, e.g. grep using ‘?q=node&destination=node’;
- Dump the entire website HTML, e.g. using some crawler, and grep for additional parameters in links;
- If possible analyse sessions table for logins of admin/advanced users from external IP addresses and check their last login dates;
Avid Drupal site builder & user for +9 years.