Have just had a hacked website flagged by Sucuri
There were a number of backdoor PHP files flagged, which I HAVE been able to delete
However, the index.php file has a spam link injected in to the bottom of it.
I've tried deleting it - which DOES work, but file instantly regenerates.
I've tried changing permissions (it is set to -rw-r--r-- www-data:www-data) to root and editing the file - it instantly changes back to the above permissions on save, and my edit is gone
Sucuri is now flagging the site as clean i.e. no more backdoor present BUT there's obviously something there that is still doing this.
Server has a lot of other sites on it too, and none of these are compromised (obviously, anyway) - and so it seems to be something in this specific site's folder that is responsible.
Is there a way of monitoring WHAT is manipulating the index.php file in order to trace where the problem is being generated from? Any other ideas? (Other than start again from scratch, which I CAN do, but not easily).
Any input welcome - thanks!