I have a server that was running an older version of lighttpd (1.4.19 on a freebsd 6.2-RELEASE (yea, old) machine) and google alerted me that it had found malware embedded on one of my server's pages. It just so happened to be our index page. I promptly removed the malware and started looking at server logs for how it got there. With no trace in any of the logs of the files being edited, I noticed that the index page's owner had been changed to www, which is the lighttpd user. I then concluded that some sort of veunerability must have existed for that software version and promptly upgraded to 1.4.26.
Now the malware is back. I have started some pretty verbose server logging with ftp, lighttpd, and all login attempts to try and see how this script is getting in. Are their any suggestions as to other approaches to take?
It's a pain, but it must be done. You are not paranoid when you know they are after you.
– guilherme Jun 08 '10 at 01:58Once you have that, look through all of your log files, particularly your web server log files, both before that point to see if you can identify the attacker and the attack method and after that point to see if you can identify what they may have done using any PHP shell script they may have uploaded.
And in answer to Chris S, his webserver files were originally owned by normal users. The attack changed them to be owned by www.
– Ladadadada Jun 08 '10 at 12:31