Hello all,
I would really appreciate a little advice with regards to a couple of problems we're having, I'm a front end developer and a moderate php programmer and am finding myself to be a little out of my depth when it comes to server issues.
We have a small commerce site hosted on Linux/Apache, we only take about £300 -£500 a month online and started out on a tiny budget so we hosted on a shared server. Just recently I discovered an obfuscated "data" file and an injection in some .html and .php files most notably where there is the presence of a closing
<body>
tag. It looks like this:
<b1>--==skff4dg4gd[...]sfdfd5444f==-</b1>
. It doesn't appear to be a particularly malicious hack, but nonetheless it is a hack.
We have a second site hosted with the same provider and that has been compromised in the same way.
And so to my questions,
I've read recently a couple of quite scary statements
if you are hosted on a shared server you might as well consider your site compromised from day one
You are only secure as the least secure site on a shared server
1. My god, is this actually true?
2. I don't fully understand how Apache works, nor am I a up on Linux directory structures, is it actually possible for a malicious script to traverse across the file system accessing and writing to files and folders or would it have needed to access my account directly through a venerability? (Which I'm pretty sure I don't have, or least I can't find).
3. Is it possible to set file and folder permissions so that *Only* scripts in my account can do their work currently everything is set at 755 and some php files at 644, does file permissions help to secure anything at all? What would be the most secure settings?
4. I'm thinking that if shared hosting is so insecure maybe I should move to a dedicated or virtual dedicated server, but does that mean the security of the server is in my hands? What is the difference?
Any advice from anyone that understands the above scenario really would be appreciated, what would you recommend I do? Our host is not being helpful.