SQL injection Detailed

Source: Internet
Author: User
Tags sql injection

This article will describe some problems of SQL injection from 5 aspects, such as vulnerability principle, test, exploit, harm, repair. Then introduce some of the techniques of SQL injection.

    • Vulnerability principle

      Injection-like vulnerabilities are owasp TOP 10 regulars, and SQL injection should be very high. By the way, popular Science injection-type vulnerability, including SQL,OS,LDAP injection.

      SQL injection is a vulnerability that occurs at the application database level, when untrusted data is sent to the parser as part of the query statement, and the attacker is able to spoof the parser and execute the unplanned commands when it is issued to the resolver, ignoring the check in the poorly designed application.

Case:

String query = "SELECT * from Accounts WHERE custid='" +request.getparameter ("id") + "'"; When an attacker passes in an ID parameter of ' or ' 1 ' = ' 1

Query statements are stitched into SELECT * from accounts WHERE custid=' or ' 1 ' = ' 1 ' ;

This query is sent to the parser, and the result returned after the parse execution is all records of the accounts table. More dangerous attacks can cause data to be tampered with or even stored procedures being invoked.

    • Vulnerability Testing

      Manual testing:

SQL injection Detailed

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.