### 简要描述:
有删除文件的操作,可“反”之。
### 详细说明:
漏洞点:
jcms/m_5_7/replace/opr_importinfo.jsp
部分系统还存在越权。fn_billstatus为1时可以直接访问该页面无需验证:
http://www.shanting.gov.cn/jcms/m_5_7/replace/opr_importinfo.jsp?fn_billstatus=1
[<img src="https://images.seebug.org/upload/201406/092141181ad90af5d903b4517ab4b3287c1c6295.png" alt="image010.png" width="600" onerror="javascript:errimg(this);">](https://images.seebug.org/upload/201406/092141181ad90af5d903b4517ab4b3287c1c6295.png)
http://tuoshan.yzwh.gov.cn/jcms/m_5_7/replace/opr_importinfo.jsp?fn_billstatus=1
[<img src="https://images.seebug.org/upload/201406/092141342d9829a4fcd858f0c21b450bb8e40b52.png" alt="image012.png" width="600" onerror="javascript:errimg(this);">](https://images.seebug.org/upload/201406/092141342d9829a4fcd858f0c21b450bb8e40b52.png)
### 漏洞证明:
扯下代码
```
// 基本变量初始化
String strFilePath = "";
String strFileName = "";
strFilePath = application.getRealPath("") + "/m_5_7/replace/temp/";
```
路径就是这了,不多说,下面看关键的(省略了一部分):
```
CommonUploadFile upload = new CommonUploadFile(strFilePath, "");
boolean bResult = upload.uploadFile(request);
String strUpFileName = "";
if (bResult) {
try {……………………省略
} catch (Exception e) {
strIllMsg += "<" + strFiles[i] + ">";
}
file.delete();
}//end for
}
else {
strMsg = "上传文件失败!";
}
```
我们看到,如果if的条件成立,则最后的操作会删除文件。而if的条件不成立时,则只会提示上传文件失败,嗯,我们可以测试看,何时bResult=false
啊好吧,直接说结果吧,
文件上传时,对于上传的文件会有一个顺序的排列,从file1,file2...一直下去。很奇怪,如果跳过了file1,从file2开始,则此处的bResult=false了。利用这一特点,我们可以反删除,保留我们的文件在temp目录下!
上传时改下后缀:
[<img src="https://images.seebug.org/upload/201406/092145505361faf429edf615d8671c1b60a186c2.png" alt="image014.png" width="600" onerror="javascript:errimg(this);">](https://images.seebug.org/upload/201406/092145505361faf429edf615d8671c1b60a186c2.png)
[<img src="https://images.seebug.org/upload/201406/09214603a7015da101702036534d313aa3b55210.png" alt="image016.png" width="600" onerror="javascript:errimg(this);">](https://images.seebug.org/upload/201406/09214603a7015da101702036534d313aa3b55210.png)
暂无评论