首页 >> 读书频道 >> 电脑 >> 用户提交的数据
 
· 利用全局变量注册(Reg
· 错误报告
· 数据库安全
· 文件系统安全
· ASP.NET高级教程(
· 安装为 Apache 模
· 安装为 CGI 程序
· 安全 一般策略
· ASP.NET高级教程(
· 各种配置指令
· ASP.NET高级教程(
· 配置文件怎样改变配置选项
 
· 国家六部门联合发文
· 红楼梦:120回全本[清
· 常见图像文件格式详解
· 拉封丹寓言
· 电视剧《刁蛮公主》下载和
· 美容养颜手册
· 加油金顺剧情分集介绍完整
· 素质教育在美国
· 全唐诗卷四十六
· 韩剧《布拉格恋人》剧情介
· 夜航船[作者:明·张岱]
· 局外人[作者:韩·可爱淘
 
· (出租)中动商场部分及写
· (出租)中动动漫基地&#
· 喜剧学院
· 《善德女王》剧情介绍
· 魔女18号 剧情
· 丑女无敌剧情介绍
· 魔女幼熙剧情介绍
· 龙游天下剧情介绍
· 震撼世界的七日剧情介绍
· 静静的白桦林剧情介绍
· 心情日记—老公今天我想对
· 旗舰剧情介绍
欢迎来到月影社区!如果您觉得这里不错,请推荐给您的朋友们。月影社区:http://wf66.com/

用户提交的数据


查看有无更新版本

关键字:PHP 2006-9-22

 

The greatest weakness in many PHP programs is not inherent in the language itself, but merely an issue of code not being written with security in mind. For this reason, you should always take the time to consider the implications of a given piece of code, to ascertain the possible damage if an unexpected variable is submitted to it. 例子 5-17. 危险的变量用法

<?php
// remove a file from the user's home directory... or maybe
// somebody else's?
unlink ($evil_var);

// Write logging of their access... or maybe an /etc/passwd entry?
fputs ($fp, $evil_var);

// Execute something trivial.. or rm -rf *?
system ($evil_var);
exec ($evil_var);

?>
 
 
You should always carefully examine your code to make sure that any variables being submitted from a web browser are being properly checked, and ask yourself the following questions:


Will this script only affect the intended files?

Can unusual or undesirable data be acted upon?

Can this script be used in unintended ways?

Can this be used in conjunction with other scripts in a negative manner?

Will any transactions be adequately logged?

By adequately asking these questions while writing the script, rather than later, you prevent an unfortunate re-write when you need to increase your security. By starting out with this mindset, you won't guarantee the security of your system, but you can help improve it.

You may also want to consider turning off register_globals, magic_quotes, or other convenience settings which may confuse you as to the validity, source, or value of a given variable. Working with PHP in error_reporting(E_ALL) mode can also help warn you about variables being used before they are checked or initialized (so you can prevent unusual data from being operated upon).

 

用户提交的数据

[ 1 ]
用户提交的数据 num

打印本页 关闭

关于我们版权声明本站导航友情连结作品演示 TOP↑