← Back to Writeups
CUSTOMEasyWeb

Lina

XESXOR9/10/20261 min read
#web#custom#easy#limit_bypass#sql_comment_injection

Lina

Platform: spbctf | Category: Web | Type: Challenge | Difficulty: Easy | OS: NA | Author: XESXOR | Date: 2026-03-09 | Status: Solved Techniques: limit_bypass, sql_comment_injection

Summary

Task: SQL injection with LIMIT 0 preventing results. Solution: Use comment injection (-- ) to bypass LIMIT clause.

Lina — Web Kids 2.0

Description

SQL injection task at https://2019-10-20-sqlinj.ctf.su/lina

Beginner-level SQL injection challenge (1 point) from Web Kids 2.0 CTF platform.

Analysis

The task is a basic SQL injection. Upon analyzing the query, it was discovered that LIMIT 0 is appended to the SQL query, which prevents any results from being returned even when the query executes successfully.

Key problem: the query has the form:

sql
SELECT * FROM table WHERE condition LIMIT 0

Solution

Using classic SQL injection with a comment to bypass LIMIT: ‍​‌‌​​‌​​​‌‌​​‌​​​​‌‌​‌​​​​‌‌‌​​‌​​‌‌​​​‌​​‌‌‌​​​​​‌‌​‌‌​​​‌‌​​​​‍

Payload:

' OR 1=1 --

This payload:

  1. ' — closes the string literal
  2. OR 1=1 — makes the condition always true, returning all records
  3. -- — comments out the rest of the query, including LIMIT 0

The resulting query becomes:

sql
SELECT * FROM table WHERE field='' OR 1=1 -- LIMIT 0

‍​‌‌​​‌​​​‌‌​​‌​​​​‌‌​‌​​​​‌‌‌​​‌​​‌‌​​​‌​​‌‌‌​​​​​‌‌​‌‌​​​‌‌​​​​‍