There are a number of steps.
1. Edit PHP.INI and look for the "disable_functions" setting and set it like so
disable_functions = show_source, system, shell_exec, passthru, exec, popen, proc_open, proc_close, proc_terminate, proc_get_status, proc_nice, symlink, exec, proc_close, popen, dl, escapeshellarg, escapeshellcmd , php_uname, disk_free_space, disk_total_space
2. If you do not have open_basedir restrictions in effect, consider using them
3. Disallow "%" as a character in filenames - particularly uploads
4. Never trust data from the $_SERVER array. Use
strip_tags( $_SERVER['PHP_SELF'])
rather than $_SERVER['PHP_SELF']
5. Make sure all input from $_POST and $_GET is escaped by mysql_real_escape_string
6. In MySQL queries ALWAYS quote data - especially integer data like so
mysql_query("select * from table where myInt='123' order by something");
If you do that little lot you will close down most avenues of attack.
Main Topics
Browse All Topics





by: grakemPosted on 2009-03-23 at 07:10:48ID: 23957796
you need to filter your user input to prevent people gaining access to your server. Look at Html purifier.
http://htmlpurifier.org/