Skip to Content

CompTIA PT0-002: What SQL Injection Technique Uses “1=1” in URL Query String?

Learn how attackers use Boolean-based SQL injection with “1=1” in URL parameters to bypass authentication and extract sensitive data from vulnerable web applications.

Table of Contents

Question

Given the following user-supplied data:

www.comptia.com/info. php?id=1 AND 1=1

Which of the following attack techniques is the penetration tester likely implementing?

A. Boolean-based SQL injection
B. Time-based SQL injection
C. Stored cross-site scripting
D. Reflected cross-site scripting

Answer

A. Boolean-based SQL injection

Explanation

The user-supplied data in the URL contains two key indicators of a Boolean-based SQL injection attack:

  1. The URL parameter “id” is followed by “1 AND 1=1”. This is a common way to test for SQL injection vulnerabilities. The “1=1” part is always true, so if the application is vulnerable, this will cause the query to return results even though the “id” may not exist.
  2. The lack of proper input validation and parameterization in the URL suggests the user input is being directly concatenated into a SQL query. This allows the attacker to prematurely end the original query and start a new one, altering the logic to bypass authentication or access unauthorized data.

Boolean-based SQL injection relies on sending SQL queries and evaluating the application’s response based on whether the injected statement is TRUE or FALSE. By systematically testing TRUE and FALSE conditions, the attacker can infer sensitive information.

The other attack techniques can be eliminated:

  • Time-based SQL injection relies on the database pausing for a specified time, not Boolean conditions.
  • Both stored and reflected XSS involve injecting malicious JavaScript, not altering SQL query logic.

In summary, the “id=1 AND 1=1” in the URL is a clear indicator that the attacker is probing for Boolean-based SQL injection vulnerabilities in order to extract sensitive data or bypass authorization checks in the application.

CompTIA PT0-002 certification exam assessment practice question and answer (Q&A) dump including multiple choice questions (MCQ) and objective type questions, with detail explanation and reference available free, helpful to pass the CompTIA PT0-002 exam and earn CompTIA PT0-002 certification.