1

Rooting a server is done through uploading a shell on a target website and running a root exploit to gain root privileges on a server thus gaining access to sites that are hosted on that shared server. My question is, what is preventing a person from just buying a site on a shared server and upload a shell himself and root the server to gain access to their sites hosted on it (the administrator of a site himself on a server)? Also, why is it not possible to root servers like the ones available on free hosting at 000webhost (because of the large number of disabled php functions?).

1 Answer 1

7

There are many other methods (of course) to attack web servers, but lets limit ourselves to the method you're interested in - getting some file onto the server, and making the server execute it. The major access control that prevents total destruction of web servers is file permissions, and an important secondary control is media-type instructions on the web server. I'm explaining how these work on Linux/Unix, which accounts for the majority of web servers in use today.

Broadly speaking, your web directory where the files that constitute your website are (usually something like /var/www for simple installations) will have permissions that control which users are able to read, write, and execute files.

A properly configured system will have permissions that permit only the operations that are required, and nothing further. That means that a malicious user would not be able to upload his malicious payload, because he would not have write access.

Perhaps the web server admin made a mistake with file permissions? The second layer of security is media-type instructions. So even after uploading a PHP pseudo-shell like "phpshell", the web server may have been told not to execute any PHP files. (e.g. something like "AddType text/plain php").

For shared hosting, the most common security measure is indeed by disabling PHP (by whatever method). Also, many hosting providers provide a single Virtual Machine for each customer, so even if you manage to root the VM somehow, you can't break into any other VMs, or the VM host.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .