Normally I don’t go to my site from Google but Friday I did and I got immediately sent to some Russian web site (backgroundstylesheet.ru) and Norton detected a malicious SWF file containing Trojan.Mdroper. My Zenphoto gallery had a hacked version of .htaccess which contained rewrite rules to send users to that Russian web site. The rewrite conditions tested for Google and about 100 other popular sites.
So I deleted it and it came back several times. Searching around I found similar cases with WordPress sites and other sites running PHP could experience the same thing.
I upgraded ZP from 1.3.1.2 to 1.4.1.6, had the install script fix the .htaccess, and had the install script remove the setup files. Poking around I discovered, that my password is visible in ../zp-data/zp-config.php, and in ../zp-data/security_log.txt. Permissions were set so that any web user could read them.
So now my questions…
1) This is a chicken or the egg question. Since all of zp-data is set for any web users to read is that why my site got hacked or was that permission changed as a result of the hacking? Can I protect the zp-data directory and expect my Zenphoto site to work?
2) Is there a script to run to lock down the permissions on the various scripts to make the site more secure? Does all of zp-core have to be visible to users?
3) I changed my database password, and broke the site. It took me a while to make it work. I suspect there is a process (which I did not follow) to changing the password. What should I do next time?
Thanks to the developers of Zenphoto. It is really cool and makes my site look terrific (unless of course my users end up at backgroundstylesheet.ru)