phpyun注入漏洞#2

- AV AC AU C I A
发布: 2025-04-13
修订: 2025-04-13

### 简要描述: phpyun注入漏洞#2 ### 详细说明: 文件名: \app\controller\friend\index.class.php中 有这样一句 ``` $nid=$M->SaveFriendInfo($_POST,array("uid"=>$this->uid)); ``` 传入了整个post,我们跟进SaveFriendInfo看看. 文件名: \app\model\friend.model.php ``` function SaveFriendInfo($Values=array(),$Where=array()){ if(empty($Where)){ $ValuesStr=$this->FormatValues($Values); return $this->DB_insert_once('friend_info',$ValuesStr); }else{ //很显然,Where是不为空的。 $WhereStr=$this->FormatWhere($Where); $ValuesStr=$this->FormatValues($Values);//重点是看这个函数 return $this->DB_update_all('friend_info',$ValuesStr,$WhereStr); //直接送入语句查询。 } } ``` 文件名: \app\public\action.class.php FormatValues函数如下 ``` function FormatValues($Values){ $ValuesStr=''; foreach($Values as $k=>$v){ if(is_numeric($k)){ $ValuesStr.=','.$v; }else{ if(is_numeric($v)){ //看见没 如果 v为数字的话就 不加单引号 反之引上单引号。因为使用了 is_numeric函数的原因,0x111 这种格式的也可以通过限制 而mysql中也是可以直接解析0x的格式的, 所以我们直接寻找有没有二次注入的地方即可。 $ValuesStr.=',`'.$k.'`='.$v; }else{ $ValuesStr.=',`'.$k.'`=\''.$v.'\''; } } } return...

0%
暂无可用Exp或PoC
当前有0条受影响产品信息