PHP简单的防火墙,通用的PHP网站防护
PHP Firewall是一款由Cyril Levert编写的开源软件,可以作为通用的PHP网站防护之用; 也可以通过对部分源代码进行了修改,增加SaeStorage存储支持、中文语言支持,为新浪云SAE(Sinaapp)应
PHP Firewall是一款由Cyril Levert编写的开源软件,可以作为通用的PHP网站防护之用; 也可以通过对部分源代码进行了修改,增加SaeStorage存储支持、中文语言支持,为新浪云SAE(Sinaapp)应用提供PHP防火墙功能, 有能力有时间的朋友不放做个试试。 一、下载PHP_Firewall文件 点击下载文件,解压后将”php-firewall”文件夹及”Read me.txt”文件放在您的代码文件夹根目录下。 二、配置SAE应用 在sina app engine应用中,点击左侧的storage,新建一个domain,名称为”upload”(其它名称也可以php网页,但是需要注意修改”firewall.php”脚本中的名称),用以存放php firewall运行的日志文件。 三、部署PHP Firewall脚本 打开您的首页或者需要防护php页面(最好在所有页面都有引用的php文件,如common.php中),在文件头部添加对“php-firewall”文件夹下“firewall.php”的引用,php代码如下: ———————————————– define('PHP_FIREWALL_REQUEST_URI', strip_tags( $_SERVER['REQUEST_URI'] ) ); define('PHP_FIREWALL_ACTIVATION', true ); if ( is_file( @dirname(__FILE__).'/php-firewall/firewall.php' ) ) include_once( @dirname(__FILE__).'/php-firewall/firewall.php' ); ———————————————– 保存文件后,svn commit至sae服务器。这样就可以起到基本的防护作用了。 四、关于PHP Firewall 目前版本为1.0.3,支持以下防护: * XSS protection * UNION SQL Injection protection * Bads bots protection * Bads requests methods protection * Small DOS protection * Inclusion files protection * Santy and others worms protection * Server Protection * URL Query protection * Cookies sanitize * Post vars sanitize * Get vars sanitize * IPs range reserved denied * IPs range spam denied * IPs protected * Unset globals PHP var (编辑:成都站长网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |