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

Vue implements student management function

This article example shares the specific code of ...

Database query which object contains which field method statement

The database queries which object contains which ...

Complete steps to solve 403 forbidden in Nginx

The webpage displays 403 Forbidden Nginx (yum ins...

Understanding of the synchronous or asynchronous problem of setState in React

Table of contents 1. Is setState synchronous? asy...

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

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

Three principles of efficient navigation design that web designers must know

Designing navigation for a website is like laying...

Solve the problem that the IP address obtained using nginx is 127.0.0.1

Get ip tool import lombok.extern.slf4j.Slf4j; imp...

Example of using CSS3 to achieve shiny font effect when unlocking an Apple phone

0. Introduction August 18, 2016 Today, I noticed ...

Detailed steps for installing Tomcat, MySQL and Redis with Docker

Table of contents Install Tomcat with Docker Use ...

How to use resident nodes for layer management in CocosCreator

CocosCreator version: 2.3.4 Most games have layer...

JS, CSS style reference writing

CSS: 1. <link type="text/css" href=&q...

Summary of Form Design Techniques in Web Design

“Inputs should be divided into logical groups so ...