skip to content
Decrypt LOL

Get Cyber-Smart in Just 5 Minutes a Week

Decrypt delivers quick and insightful updates on cybersecurity. No spam, no data sharing—just the info you need to stay secure.

Read the latest edition
Double Query Injection: SQL Injection Technique Overview

Double Query Injection: SQL Injection Technique Overview

/ 3 min read

Quick take - The article discusses double query injection, a SQL injection technique that enables attackers to execute two queries through a single injection point, emphasizing the risks associated with unpatched vulnerabilities in database systems and providing a demonstration using an outdated MySQL version.

Fast Facts

  • Double query injection is a sophisticated SQL injection technique that allows attackers to execute two SQL queries through a single injection point, often using a semicolon to separate them.
  • This method exploits vulnerabilities in applications that mishandle SQL statements, posing significant risks, especially in databases that permit multiple query executions.
  • Versions of MySQL above 5.6 have been patched to mitigate this vulnerability, emphasizing the need for updated database systems.
  • The article includes a demonstration using bee-box, an outdated MySQL version, detailing steps for establishing a remote connection and retrieving sensitive database information.
  • Tools like Burp Suite are recommended to enhance the process of uncovering database information and identifying vulnerabilities in SQL handling.

Double Query Injection: A Sophisticated SQL Injection Technique

Double query injection is a sophisticated SQL injection technique that allows an attacker to execute two separate SQL queries through a single injection point. This method typically utilizes a semicolon (;) to terminate the first query, introducing a second query that can execute harmful actions. These actions may include accessing sensitive data or altering the database content.

Exploiting Vulnerabilities

Double query injection exploits vulnerabilities within applications that improperly handle SQL statements. It poses significant risks, particularly in databases that allow for multiple query executions in a single statement. Versions of MySQL above 5.6 have been patched to mitigate this vulnerability, highlighting the importance of maintaining updated database systems.

Practical Demonstration with Bee-Box

A demonstration using bee-box illustrates the practical application of double query injection. Bee-box operates on an outdated version of MySQL. The demonstration outlines comprehensive steps for establishing a remote MySQL connection from bee-box, including creating a test database and setting up a table populated with dummy data. The process of determining the number of rows within a table is explained, utilizing the Rand() function to generate random decimal values that are then manipulated to yield results of either 0 or 1.

The article delves into SQL functions, contrasting the floor and ceil functions, and elaborates on methods to select all databases from the information_schema. Guidance is provided on retrieving essential database information, including user accounts, table names, and column names. The creation of a testing page on bee-box is also discussed.

Risks and Tools for Mitigation

Double query injection is particularly effective when the front end does not display specific query responses. To aid in the process, the article suggests utilizing Burp Suite, which can increase limits for uncovering database information. Procedures for identifying table names and counting existing tables are detailed, with examples provided on how to fetch sensitive data from the bWAPP database, including email and password information. The potential dangers associated with unpatched vulnerabilities are illustrated, emphasizing the importance of proper data handling in SQL databases.

Original Source: Read the Full Article Here

Check out what's latest