Hi
We have inherited a website (built in PHP/MySQL) which has been hacked a few times over the last month. The hosting company have indicated there must be issues within the source code of the site.
The site is built using dynamic URL's (e.g. productlist.php?pid=1) and all SELECT AND INSERT queries use the passed arguments to display/store product data.
The same too goes for the admin system which is bolted on to the back end.
The hackers have so far managed to do the following:
1) Upload files and folders inside and outside of web root
2) upload a CGI script which basically buggers up the entire site and background
3) Changed content within the mysQL database
4) Deleted the contents of a product table
5) created a folder which I can't even delete via FTP
The admin system does not allow products to be deleted so I suspect they have managed to find the database username and password details (which are stored outside of web root in a dbcon.php script) and connect directly to the database in order to delete the data.
My question is basically, what would be the most common way for the attackers to get into the system and do what they have done?
Is there a method I need to apply to the scripts to prevent this kind of outside attack?
Any advice would be greatly appreciated.