hdwiki注入导致任意文件下载

- AV AC AU C I A
发布: 2025-04-13
修订: 2025-04-13

### 简要描述: RT。为一个朋友找的。 ### 详细说明: hdwiki上传附件处文件名过滤不严,导致可以注入: ``` function douploadimg() { $imgname=$_FILES['photofile']['name']; $extname=file::extname($imgname); $destfile=$_ENV['attachment']->makepath($extname); $arrupload=file::uploadfile($_FILES['photofile'],$destfile); if($arrupload['result']==true){ if(isset($this->setting['watermark'])){ $_ENV['watermark']->image($destfile,$destfile); } $uid=intval($this->user['uid'])?$this->user['uid']:0; $did=intval($this->get['2'])?$this->get['2']:0; $_ENV['attachment']->add_attachment($uid ,$did,$imgname ,$destfile ,htmlspecialchars($this->post['picAlt']) ,$extname); ``` 直接将$imgname插入attachment表。 但前台没有输出点,只能够盲注。 但因为是附件上传处,我们可以通过注入控制附件文件位置。 下载的时候即可读取该文件,产生一个任意文件读取: ``` function dodownload(){ if(!isset($this->get[2]) || !is_numeric($this->get[2])){ $this->message($this->view->lang['parameterError'],'BACK'); } $result=$_ENV['attachment']->get_attachment('id',$this->get[2],0); if(!(bool)$attachment=$result[0]){...

0%
暂无可用Exp或PoC
当前有0条受影响产品信息