dvbbs php 的一个小注入
来源:phpeval's BLOG
作者:phpeval
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( emptyempty($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) ){ //注入了
直接
http://www.site.cn/dispuser.php?name=构造用户名&showUserID=1%20and%201=2
猜
dv php的安全性和dv asp 的安全性不在一个档次。