### 简要描述: php云人才系统csrf防护不当可刷钱 ### 详细说明: 搜索了下$_SESSION['pytoken'] 一个有两个函数进行了调用 如下 ``` function admin(){ $r=$this->obj->get_admin_user_shell(); $this->registrs(); if($_POST){ if($_POST['pytoken']!=$_SESSION['pytoken']){ unset($_POST['pytoken']); $this->obj->ACT_layer_msg("来源地址非法!",3,$this->config['sy_weburl']); } } if(!$_SESSION['pytoken']){ $_SESSION['pytoken'] = substr(md5(uniqid().$_SESSION['auid'].$_SESSION['ausername'].$_SESSION['ashell']), 8, 12); } $this->yunset('pytoken',$_SESSION['pytoken']); } function check_token(){ if($_SESSION['pytoken']!=$_GET['pytoken'] || !$_SESSION['pytoken']) { unset($_SESSION['pytoken']); $this->obj->ACT_layer_msg("来源地址非法!",8,'index.php'); exit(); } } ``` admin这个函数 只进行判断 是不是有post 这样的话 如果get提交数据 便不会检测token。 再就是后台手动完成订单的地方,没有调用check_token这个函数 ``` function setpay_action(){ $del=(int)$_GET["id"]; $row=$this->obj->DB_select_once("company_order","`id`='$del'"); if($row["order_state"]==1||$row["order_state"]==3){ $nid=$this->upuser_statis($row);...
### 简要描述: php云人才系统csrf防护不当可刷钱 ### 详细说明: 搜索了下$_SESSION['pytoken'] 一个有两个函数进行了调用 如下 ``` function admin(){ $r=$this->obj->get_admin_user_shell(); $this->registrs(); if($_POST){ if($_POST['pytoken']!=$_SESSION['pytoken']){ unset($_POST['pytoken']); $this->obj->ACT_layer_msg("来源地址非法!",3,$this->config['sy_weburl']); } } if(!$_SESSION['pytoken']){ $_SESSION['pytoken'] = substr(md5(uniqid().$_SESSION['auid'].$_SESSION['ausername'].$_SESSION['ashell']), 8, 12); } $this->yunset('pytoken',$_SESSION['pytoken']); } function check_token(){ if($_SESSION['pytoken']!=$_GET['pytoken'] || !$_SESSION['pytoken']) { unset($_SESSION['pytoken']); $this->obj->ACT_layer_msg("来源地址非法!",8,'index.php'); exit(); } } ``` admin这个函数 只进行判断 是不是有post 这样的话 如果get提交数据 便不会检测token。 再就是后台手动完成订单的地方,没有调用check_token这个函数 ``` function setpay_action(){ $del=(int)$_GET["id"]; $row=$this->obj->DB_select_once("company_order","`id`='$del'"); if($row["order_state"]==1||$row["order_state"]==3){ $nid=$this->upuser_statis($row); isset($nid)?$this->layer_msg("充值记录(ID:".$del.")确认成功!",9):$this->layer_msg("确认失败,请销后再试!",8); }else{ $this->layer_msg("订单已确认,请勿重复操作!",8); } } ``` ### 漏洞证明: 1. 我们先来下个订单 [<img src="https://images.seebug.org/upload/201411/0823015552f3914f562e8636a0c1f4372bc26da0.png" alt="图片1.png" width="600" onerror="javascript:errimg(this);">](https://images.seebug.org/upload/201411/0823015552f3914f562e8636a0c1f4372bc26da0.png) 然后在充值记录生成如下 [<img src="https://images.seebug.org/upload/201411/0823020846fa2226d12909c41fa8c915af72b3cd.png" alt="图片2.png" width="600" onerror="javascript:errimg(this);">](https://images.seebug.org/upload/201411/0823020846fa2226d12909c41fa8c915af72b3cd.png) 然后去看下去付款的连接为 http://localhost/phpyun/member/index.php?c=payment&id=1 可以知道 充值记录的id为1 2. 后台中 [<img src="https://images.seebug.org/upload/201411/082302318e1da55c1a5c17951cf89f6facbc66ce.png" alt="图片3.png" width="600" onerror="javascript:errimg(this);">](https://images.seebug.org/upload/201411/082302318e1da55c1a5c17951cf89f6facbc66ce.png) 抓包如下 [<img src="https://images.seebug.org/upload/201411/082302444f855cdd65a2bd016a046dbf1fc602a8.png" alt="图片4.png" width="600" onerror="javascript:errimg(this);">](https://images.seebug.org/upload/201411/082302444f855cdd65a2bd016a046dbf1fc602a8.png) 我们知道没有进行防护 So 我们可以构造出来这样一个url localhost/phpyun/admin/index.php?m=company_order&c=setpay&id=1 然后让管理员进行访问就可以了。 3. 下面我们把这个url插到企业信息这个页面 然后就等管理员维护企业的时候上钩了,如果着急的话 可以尝试社工 [<img src="https://images.seebug.org/upload/201411/082303367d1c8b8d4011e42f60af03e4e3175f55.png" alt="图片5.png" width="600" onerror="javascript:errimg(this);">](https://images.seebug.org/upload/201411/082303367d1c8b8d4011e42f60af03e4e3175f55.png) 这样 我们便充值成功了 [<img src="https://images.seebug.org/upload/201411/0823035013cd8440d3e3222fd2af8830afe07e27.png" alt="图片6.png" width="600" onerror="javascript:errimg(this);">](https://images.seebug.org/upload/201411/0823035013cd8440d3e3222fd2af8830afe07e27.png)