Server Parsing of the Upload Vulnerability Assistant

Source: Internet
Author: User

The upload vulnerability is a favorite and most popular attack method for website intruders. As a result, programmers are also racking their brains to filter the extensions of uploaded files from the previous blacklist, determine whether the extension is. asp ,. asa ,. cer and so on. Now, the White List can directly determine whether the extension is jpg, gif, png, rar, zip, and so on. Even the commonly used 00 cut-off upload does not work in many cases, however, this does not mean that the upload vulnerability is useless. When you see the directory parsing and file parsing problems on the server, the upload is also a return.

 
Windows2003 + IIS6.0 directory Parsing Vulnerability
 
1. All files under the xxx. asp Directory are parsed using asp.
2 1.asp;_2.gif files will also be parsed as asp files
 
Apache2.2.14 directory Parsing Vulnerability
 
No matter what the last Suffix of the file is, as long as it is. php. * The end is parsed into a PHP file by the Apache server. The problem is that if apache is in mime. the types file does not have a defined extension such as x1.x2. in the case of x3, the last x3 is not defined, and it will be parsed into the second-to-last x2 defined extension. Xxx.php.rar or xxx. php.111 will be parsed to php if they are not defined in the mime. types file by default. The same is true for cgi or jsp... If the upload page of the web program is involved, if the uploaded file name can be defined, then we can upload a xxx file. php. apache will still parse the webshell named abc as php.
 
Defense method:
The apache configuration file prohibits execution of files such as. php.
<Files ~ "\. (Php. | php3.)">
Order Allow, Deny
Deny from all
</Files>
 
Nginx-0.8.37 File Parsing Vulnerability
 
Accessing the http://www.bkjia.com/phpinfo.txt/abc.php will use the PHP file to export phpinfo.txt
 
Solution:
1. Modify php. ini, set cgi. fix_pathinfo to 0, and restart php reverse proxy service.
 
2. Add the following content to the nginx VM:
 
If ($ fastcgi_script_name ~ \ .. * \/. * Php ){
Return 403;
}




From http://www.imiyoo.com/blog? P = 42

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.