1. Understanding the Database Structure

Think of a SQL database like a filing system:

2. The Role of information_schema

Databases like MySQL have a built-in directory called information_schema that acts like a map of the entire server. It keeps track of every database, table, and column that exists.

3. Why GROUP_CONCAT() is Used

Normally, querying information_schema returns results row by row (e.g., table names stacked vertically). Web applications often only display one line of output at a time.

4. Making it Work with UNION SELECT

When a website is vulnerable to SQL Injection, you can append your own query using UNION SELECT. However, SQL requires that your injected query matches the exact number of columns the original application expects.

5. Step-by-Step Attack Flow

To successfully extract data from a blind or output-reflective SQL injection point, you generally follow this roadmap:

  1. Count columns: Figure out how many columns the original query uses.
  2. Find reflection: Figure out which of those columns actually show up on your screen.