Detailed explanation of MySQL injection without knowing the column name

Detailed explanation of MySQL injection without knowing the column name

Preface

I feel like my mind is empty lately, as I have been digging holes just to make room for them. I think it would be better to return to the technology itself and make myself feel more comfortable. Okay, let’s not talk too much, let’s take a look at the detailed introduction.

premise

The following situation applies to MySQL < 5 version, or in MySQL >= 5 version [information_schema library exists], and the library name and table name have been obtained

① When only the table name can be obtained, but not the column name or only the column name without valid content can be obtained [such as id]

② When you want to obtain the structure of other tables, such as table names and column names, through the tables in the information_schema library, but this library is filtered out by WAF

In fact, I personally feel that this method is more practical for versions below 5, because for me, I usually give up when I encounter waf (I am really a bad programmer 23333)

solve

Normal query:

The following is a normal query of the user table content in the test database

select * from user; 

UNION query:

select 1,2,3,4 union select * from user; 

Query the corresponding column of numbers:

You can use numbers to correspond to columns for querying, such as 2 corresponds to the name column in the table.

select `2` from (select 1,2,3,4 union select * from user)a; 

Alias ​​replacement query:

When the backtick ` cannot be used, an alias can be used instead, such as setting the alias of 2 to b

select b from (select 1,2 as b,3,4 union select * from user)a; 

Multiple column merge query:

Same as above: If backticks cannot be used here, you can also use aliases instead

select concat(`2`,0x3a,`3`) from (select 1,2,3,4 union select * from user)a limit 1,1; 

Only for translation and organizing ideas

Original link: https://blog.redforce.io/sqli-extracting-data-without-knowing-columns-names/

Summarize

The above is the full content of this article. I hope that the content of this article will have certain reference learning value for your study or work. Thank you for your support of 123WORDPRESS.COM.

You may also be interested in:
  • MySQL and SQL injection and prevention methods
  • SQL Injection with MySQL Injection Analysis
  • Mysql database uses concat function to execute SQL injection query
  • mysql5 injection vulnerability
  • PHP program to prevent MySQL injection or HTML form abuse
  • Summary of MySQL injection bypass filtering techniques
  • Detailed explanation of outfile, dumpfile, load_file functions in MySQL injection
  • MYSQL updatexml() function error injection analysis
  • Summary of methods to prevent SQL injection in node-mysql
  • 7 key points to prevent PHP MYSQL injection attacks

<<:  Tomcat multi-port domain name access and configuration to enable gzip compression method

>>:  Steps to create a WEBSERVER using NODE.JS

Recommend

How to use the markdown editor component in Vue3

Table of contents Install Importing components Ba...

Build a high-availability MySQL cluster with dual VIP

Table of contents 1. Project Description: 2. Proj...

WeChat Mini Program to Implement Electronic Signature

This article shares the specific code for impleme...

What is the file mysql-bin.000001 in mysql? Can it be deleted?

After installing MySQL using ports, I found that ...

Control the vertical center of the text in the HTML text box through CSS

When the height attribute of Text is defined, the ...

How to find and delete duplicate rows in MySQL

Table of contents 1. How to find duplicate rows 2...

How to achieve 3D dynamic text effect with three.js

Preface Hello everyone, this is the CSS wizard - ...

Linux automatic login example explanation

There are many scripts on the Internet that use e...

Native JS to achieve image marquee effects

Today I will share with you a picture marquee eff...

How to check where the metadata lock is blocked in MySQL

How to check where the metadata lock is blocked i...

How to configure CDN scheduling using Nginx_geo module

Introducing the Geo module of Nginx The geo direc...

10 Best Practices for Building and Maintaining Large-Scale Vue.js Projects

Table of contents 1. Use slots to make components...

Summary of Operator Operations That Are Very Error-Prone in JavaScript

Table of contents Arithmetic operators Abnormal s...

How does Zabbix monitor and obtain network device data through ssh?

Scenario simulation: The operation and maintenanc...