SQL injection attacks for common vulnerabilities in PHP

Source: Internet
Author: User
Tags sql injection sql injection attack

SQL injection attack (SQL injection) is an attacker submitting a carefully constructed SQL statement in a form, altering the original SQL statement, and causing a SQL injection attack if the Web program does not check the submitted data.

General steps for SQL injection attacks:

1, the attacker to access the site with SQL injection vulnerabilities, looking for injection point

2, the attacker constructs injection statements, injection statements and SQL statements in the program combined to generate a new SQL statement 3, a new SQL statement is submitted to the database to perform processing

4. The database executes a new SQL statement that throws a SQL injection attack

Instance

Database

CREATE TABLE ' PostMessage ' (

' id ' int (one) not NULL auto_increment,

' Subject ' varchar not NULL default ',

' Name ' varchar ' not NULL default ',

' Email ' varchar not NULL default ',

' Question ' Mediumtext not NULL,

' Postdate ' datetime not NULL default ' 0000-00-00 00:00:00′,

PRIMARY KEY (' id ')

) Engine=myisam DEFAULT charset=gb2312 comment= ' user's message ' auto_increment=69;

Grant all privileges in ch3.* to ' sectop ' @localhost identified by ' 123456′;

add.php Insert Message

list.php message list

show.php Display Message page

Http://www.netsos.com.cn/show.php?id=71 There may be an injection point, and we'll test

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

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.