当前位置:首页 > 软件开发 > net
firefox

针对PHP木马攻击的防御之道

 本文通过介绍一些技巧介绍了针对php木马攻击的防御之道,通过这些方面你可以更好的防范木马程序。

  1、防止跳出web目录

  首先修改httpd.conf,如果你只允许你的php脚本程序在web目录里操作,还可以修改httpd.conf文件限制php的操作路径。比如你的web目录是/usr/local/apache/htdocs,那么在httpd.conf里加上这么几行:

  php_admin_value open_basedir /usr/local/apache
/htdocs

  这样,如果脚本要读取/usr/local/apache/htdocs以外的文件将不会被允许,如果错误显示打开的话会提示这样的错误:

  warning: open_basedir restriction in effect. file is in wrong directory in

  /usr/local/apache/htdocs/open.php on line 4

  等等。

  2、防止php木马执行webshell

  打开safe_mode,

  在,php.ini中设置

  disable_functions= passthru,exec,shell_exec,system

  二者选一即可,也可都选

 ↓相关文章:
© 2006-2008 All Rights Reserved