When I came home today I found all my php files infected on godaddy linux hosting. The following code was inserted at the beginning of all files:
/**/ eval(base64_decode("aWYoZnVuY3....")
According to the logs the infected code failed to run:
eval()'d code line 1: gzinflate() [function.gzinflate]: data error
Nevertheless, I want to prevent this from happening again, but I have no idea how they came in the first place. I have an FTP access (no SFTP), so theoretically they were able to sniff out the password, but there is probably a simpler explanation.
They could also exploit an insecurity in Goddady's setup, but in that case I cant't do anything to prevent it.
Could there be a typical error in my PHP code or configuration which makes it possible to hack the php files like this?