Full PHP vulnerability solution (5)-SQL injection attacks

Source: Internet
Author: User
Tags sql injection attack
Abstract: This article mainly introduces SQL injection attacks against PHP websites. The so-called SQL injection attack means that some programmers do not judge the validity of user input data when writing code, so that the application has security risks. You can submit a piece of database query code to obtain the desired data based on the results returned by the program .... SQL Injection attacks are specially crafted SQL statements submitted by attackers in the form to modify the original SQL statements. if the web program does not check the submitted data, this will cause SQL injection attacks.

General steps for SQL injection attacks:

1. attackers can access websites with SQL injection vulnerabilities to find injection points.

2. attackers construct injection statements, which are combined with the SQL statements in the program to generate new SQL statements.

3. the new SQL statement is submitted to the database for processing.

4. the database executes new SQL statements, triggering SQL injection attacks.

Instance

Database

Create table 'postmessage' ('id' int (11) not null auto_increment, 'subobject' varchar (60) not null default ", 'name' varchar (40) not null default ", 'Email 'varchar (25) not null default", 'Question 'mediumtext not null, 'postdate' datetime not null default '2017-00-00 00:00:00 ′, primary key ('id') ENGINE = MyISAM default charset = gb2312 COMMENT = 'Caller's message 'AUTO_INCREMENT = 69; grant all privileges on ch3. * to 'sectop' @ localhost identified by '000000'; // add. insert a message in php // list. php message list // show. php display message

Page http://www.netsos.com.cn/show.php? Id = 71 there may be injection points. let's test

Http://www.netsos.com.cn/show.php? Id = 71 and 1 = 1

Test again. The vulnerability has been fixed.

The above is the full PHP vulnerability solution (5)-content of SQL injection attacks. 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.