MySQL server (two layer) architecture injected into the Bible

Source: Internet
Author: User
Tags php server tomcat server

Background-6 server (Layer Two) architecture

First introduce the basic situation of 29,30,31 this San Guan:

Server side has two parts: the first part of the Tomcat for the engine of the JSP server, the second part of the Apache as the engine PHP server, the real Web service is the PHP server. The workflow is: Client access to the server, direct access to the Tomcat server, and then the Tomcat server requests data from the Apache server. The data return path is reversed.

Here is a brief introduction to the construction of the relevant environment. The environment is ubuntu14.04. Here's an example of the environment I'm building, we need to download three things: Tomcat server, JDK, Mysql-connector-java. Install separately, note that in order to export the environment variable after the JDK installation, Mysql-connector-java need to copy the jar file to the relevant directory of the JDK. Next, unzip the tomcat-files.zip into the Tomcat server Webapp/root directory, where you need to modify the correct path in the source code and the MySQL user name password. Here we will be able to access the normal 29-32 off.

Focus: index.php?id=1&id=2, do you guess whether it shows id=1 data or id=2?

Explain:apache (PHP) parses the last parameter, which displays the contents of the id=2. The Tomcat (JSP) parses the first parameter, which displays the contents of the id=1.

Take slices as a description of the parameter resolution for most servers.

Here we want a question: index.jsp?id=1&id=2 request, for the server configuration in the first diagram, the client request first Tomcat,tomcat parse the first parameter, then tomcat to request Apache (PHP) server, Apache parses the last parameter. Which parameter should be the final return to the client?

Answer: This should be the content of id=2, the Apache (PHP) server that should be served on time, and the data returned should be Apache processing data. And in our actual application, there is a two-tier server situation, then why do you want to do so? Because we often do data filtering and processing at the Tomcat server, which is similar to a WAF. And because of the differences in parsing parameters, we can use this principle here to bypass the WAF detection. This usage is an application of the HPP (HTTP Parameter pollution), HTTP parameter pollution attack. HPP can pose a certain threat to both the server and the client.

MySQL server (two layer) architecture injected into the Bible

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.