Summary of MySQL injection bypass filtering techniques

Summary of MySQL injection bypass filtering techniques

First, let’s look at the GIF operation:

Case 1: Spaces are filtered

Use brackets () instead of spaces. Any statement that can calculate a result can be surrounded by brackets.

select * from(users)where id=1;

Use comments /**/ to bypass spaces;

select * from/**/users/**/where id=1;

Case 2: Limit from and certain character combinations

Add a dot after "from". That is, use "from." instead of "from".

select * from.users where id=1;

Then watch the GIF directly:

To put it simply, it means replacing the ' field name ' with hex ;

This reminds me of when I started learning SQL injection, I used load_file or into outfile , and often used hex to encode a sentence and then import it;

The single/double quotes are indeed omitted here, which is foolproof (we won’t mention magic_quotes_gpc() );

But at that time I was only concerned with the results. Today, when I was sorting out the previous data, I found this problem, but I was confused and didn't know why it was coded like this. Let's do it in practice:

You can clearly see the error message. The first single quote after select and the single quote before cmd in the sentence Trojan horse close the following statement and cause an error message.

Then convert it to hex , remove the quotation marks, and find that it can be written;

My machine doesn't give him permission here, so it will prompt that he can't write. It depends on the actual situation.

Summarize

The above is the full content of this article. I hope that the content of this article can be of some help to your study or work. If you have any questions, you can leave a message to communicate.

You may also be interested in:
  • MySQL complete collapse: detailed explanation of query filter conditions
  • Detailed explanation of MySQL single table query operation examples [syntax, constraints, grouping, aggregation, filtering, sorting, etc.]
  • Detailed explanation of count without filter conditions in MySQL
  • Method for implementing multi-field filtering in Mysql database
  • How to filter out certain libraries during mysql full backup
  • MYSQL Must-know Reading Notes Chapter 8: Using Wildcards for Filtering
  • MYSQL Must Know Reading Notes Chapter 7 Data Filtering
  • MYSQL Must Know Reading Notes Chapter 6 Filtering Data
  • MYSQL uses regular expressions to filter data
  • Python connects to MySQL and uses fetchall() method to filter special characters
  • Python implements MySQL single quote string filtering method
  • How to solve mysql replication filter duplication
  • How to dynamically modify the replication filter in mysql

<<:  Detailed examples of Docker-compose networks

>>:  A brief discussion on docker-compose network settings

Recommend

Summary of essential knowledge points for MySQL query optimization

Preface Query optimization is not something that ...

Detailed explanation of MySQL binlog usage

binlog is a binary log file that records all DML ...

HTML table tag tutorial (8): background image attribute BACKGROUND

Set a background image for the table. You can use...

Graphical explanation of the solutions for front-end processing of small icons

Preface Before starting this article, let’s do a ...

Vue3.0 implements the magnifying glass effect case study

The effect to be achieved is: fixed zoom in twice...

Use vue3 to implement a human-cat communication applet

Table of contents Preface Initialize the project ...

Perfect solution to Google Chrome autofill problem

In Google Chrome, after successful login, Google ...

About the overlap of margin value and vertical margin in CSS

Margin of parallel boxes (overlap of double margi...

MySQL not null constraint case explanation

Table of contents Set a not null constraint when ...

Detailed explanation of the implementation of shared modules in Angular projects

Table of contents 1. Shared CommonModule 2. Share...

JavaScript Closures Explained

Table of contents 1. What is a closure? 2. The ro...

How to install docker under centos and remotely publish docker in springboot

Table of contents 1. Installation of JDK1.8 under...