Hi there,
I’ve had a problem this week with one of my EE sites and I’m not sure whether the breach is because of my EE configuration, or something to do with my hosts. I’m still in my first year of EE development and it’s the first time I’ve ever had to deal with a website under attack so would appreciate any input on where to start.
My site was relaunched last month following an upgrade to v1.6.1. As I’ve just started using TextMate and CSSEdit, I changed at this time to using the Save Templates as Text File option and therefore created a templates_file folder (set to 777) within my renamed system folder. Access to the renamed system folder isn’t masked, and I’ve set up a redirect from admin.website.com to http://www.website.com/renamed_system/ to enable my sole contributor/user of the site to easily access the control panel. Apart from a simple contact form, I’m not using any blogging functionality or anything involving comments etc - it’s really just a simple CMS setup.
Last week I noticed somebody had added links from the sidebar of my website to a dodgy looking external site - and that on closer inspection some of the template pages also included JavaScript at the bottom of the page relating to these external links. I’ve no idea where they came from or how they gained access. My contributor user doesn’t have access to edit the template files, but the changes were definitely made to the template files themselves (i.e. the suspicious code was in the text template files, rather than having been added in one of the weblog entries).
I immediately took the site offline and have changed all the passwords for both my EE logins and the FTP access to the site. However I need to know how the changes were made to ensure that it doesn’t happen again. I guess it could either be:
- someone gained admin access and changed the files within EE control panel (but if so how? I think it is more likely the changes were made to the text files themselves)
- someone exploited the 777 access to the template_files directory (it’s hosted on a shared server) - in which case I need to get in touch with the hosting company
- something else?
Can anyone advise on what might have gone wrong, and how I can avoid it happening again? Is it best practice to stop using the Save Templates as Text Files option once you finish creating the site and updating the templates themselves? Also - should I now mask the (renamed) system folder - and is there anything else I need to do?
Many thanks for your help.
James A