PHP vulnerability solution (8)-HTTP response splitting

Source: Internet
Author: User
Abstract: This article mainly Introduces HTTP response splitting for PHP websites. from the perspective of attackers, we will demonstrate HTTP response splitting for you .... HTTP request format

1) request information: for example, "Get/index. php HTTP/1.1", request the index. php file

2) header: for example, "Host: localhost", indicating the server address

3) blank lines

4) information body

Both "request information" and "header" must end with a line break (CRLF). Blank lines can only contain line breaks, but cannot contain other space characters.

The following example shows how to send an HTTP request to the server www.yhsafe.com.

GET/index. php HTTP/1.1 // request information

Host: www.yhsafe.com // header

// Blank line

It indicates the enter key. an HTTP request is sent only after a blank line is entered by pressing a space. in the HTTP request header, only the Host header is required to be hungry, the rest of the HTTP headers are determined based on the content of the HTTP request.

HTTP request method

1) GET: Request Response

2) HEAD: the same response as GET. only the response header is required.

3) POST: send data to the server for processing. The data is contained in the HTTP message body.

4) PUT: upload a file

5) DELETE: DELETE an object

6) TRACE: TRACE the received request

7) OPTIONS: return the HTTP request method supported by the server

8) CONNECT: converts an HTTP request connection to a transparent TCP/IP channel.

HTTP response format

The server sends the following response after processing the HTTP request submitted by the client.

1) the first line is the status code.

2) The second line starts with other information.

The status code contains a number that identifies the status and a word that describes the status. For example:

HTTP/1.1 200 OK

200 indicates the number indicating the status, and OK indicates the word describing the status. This status code indicates that the request is successful.

Example of HTTP request and response

Open cmd, input telnet, and enter open www.00aq.com 80

Enter

Getindex. php HTTP/1.1

Host: www.00aq.com

Hide the HTTP response header

In apache, httpd. conf, ServerTokens = Prod, ServerSignature = Off

Php. ini in php, option expose_php = Off

The above is the PHP vulnerability solution (8)-HTTP response splitting content. For more information, see PHP Chinese website (www.php1.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.