Apache Parsing Vulnerabilities and repair methods

Source: Internet
Author: User

Apache parses the file suffix ". "the backend is a suffix. From the back to the front, if the suffix is invalid, the first one will be resolved, for example, 1. php. x1.x2. x3. it will first parse x3. there is no parsing x2. there is no parsing x1. if there is no parsing x1. it will only parse php. :

 

Define a suffix, but not all suffixes? X1.x2. x3 can be changed to any suffix

For example, 1. php. a,. a is not defined, and apache does not understand the suffix of a, so it will parse it forward, that is, parse php.

This problem can be solved using pseudo-static, and files such as. php. * can be rewritten.

Open httpd. conf of apache

Find LoadModule rewrite_module modules/mod_rewrite.so

Remove #, restart apache, and create the. htaccess file under the root directory of the website. The Code is as follows:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule. (php. | php3.)/index. php
RewriteRule. (pHp. | pHp3.)/index. php
RewriteRule. (phP. | phP3.)/index. php
RewriteRule. (Php. | Php3.)/index. php
RewriteRule. (PHp. | PHp3.)/index. php
RewriteRule. (PhP. | PhP3.)/index. php
RewriteRule. (pHP. | pHP3.)/index. php
RewriteRule. (PHP. | PHP3.)/index. php
</IfModule>

It may be mistaken for me. Modify the suffix of php Execution defined by yourself as required, and separate it with |. /Index. php can be replaced with the file you want to display.

Effect:

 

 

 

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.