Found spam email script on server, multiple files affected at the same time
I discovered today that one of our cpanel accounts was sending out a lot of spam email. After doing some digging, I found two files: one file (result.php) was the file that the email linked to; the second file (diff14.php) was the one sending the emails.
The emails sent out by file 2 would contain a link to domain.com/result.php?u=somestring
I noticed that result.php and diff14.php have a date and time of 1/25/17 4:40 PM on my server. Several other files have the same modify time:
/wp-mail.php
/wp-admin/about.php
/wp-admin/update-core.php
/wp-admin/widgets.php
***/wp-includes/SimplePie/diff14.php***
/wp-includes/class-http.php
/wp-includes/class-phpmailer.php
/wp-includes/class-requests.php
/wp-includes/class-smtp.php
/wp-includes/class-wp-theme.php
/wp-includes/functions.php
/wp-includes/ms-function.sphp
/wp-includes/version.php
/wp-includes/wp-db.php
.htaccess
license.txt
readme.8927cd0720f74eeaa13ef8dd26fa78b0.html
***result.php***
I'm wondering what may have happened on that date and time that bundled the two offending files. Or what happened that affected all these files. Would it have been an update?
I know this might be a violation of the "I have been hacked" rule, but I'm wondering if someone can at least interpret the times of all these files. It looks like it may have been an update, but if that's not how WP typically updates (I'm not familiar with how many files WP changes on average), I need to take a closer look. Surface glance at the files in question don't show anything fishy though.
Posted May 22, 2017, 5:49 PM UTC
There is a changelog on wordpress.org that will tell you which files were changed for each update. https://codex.wordpress.org/Version_4.7.5
If you know when a non-core file was changed, like that diff14.php, look in your raw access logs for any access to your site that matches the timestamp of the file. You can then get an idea of what might have happened.