Web Apps Intermediate

SQL injection: blind extraction with time delays

The app runs a query on the `TrackingId` cookie but never shows the result or an error. Use conditional `SLEEP()` to read the admin password one character at a time.

Scenario

Every page sets a TrackingId cookie which the server looks up:

SELECT COUNT(*) FROM tracked_users WHERE tracking_id = '<cookie value>'

The result is never displayed and SQL errors are handled silently. The only observable you can influence is response time.

Your objective

Recover the administrator password from the users table using time-based inference, then log in. Solved when you reach the account page as the administrator.

Capture 2 flag(s) and record the exact technique for each step.

Getting started

  1. Inject '-SLEEP(3)-' into the TrackingId cookie and confirm a ~3 s delay.
  2. Build a conditional: ' AND IF(1=1, SLEEP(3), 0)-- - (slow) vs 1=2 (fast).
  3. Confirm the target row: ' AND (SELECT IF(COUNT(*)=1,SLEEP(3),0) FROM users WHERE username='administrator')-- -.
  4. Binary-search each character with SUBSTRING(password,<i>,1) and ASCII(...) > <mid>. Script it.
  5. Submit the password length and the password as the two flags.

Connecting

Press Launch Lab to build your own instance, then use the How to connect panel — it shows the browser link as soon as the app is running. Hit Stop when you are done, or Relaunch / Reset for a clean copy.

Credentials: Start unauthenticated — the tracking cookie is set on the home page.

Hints

Tip

Keep the sleep short and run one request at a time — the grader tolerates a slow solve but not a hammered server.

How to connect

Connect to the lab VPN first

Lab machines sit on an isolated network with no public address. Connect to the VPN once — the same config works for every lab.

1 · Get your config

Download rooted-labs.ovpn

2 · Connect

Linux / macOS — from a terminal:

Windows / mobile — import the file into OpenVPN Connect, Tunnelblick, or the OpenVPN GUI.

3 · Reach the machine

Once connected, the address shown below (SSH command / lab link / RDP command) is reachable. Only lab traffic is routed through the VPN — your normal internet is untouched.

Step 2 — reach the machine

Challenge questions

0 / 2 correct
  1. Submit the initial flag you recovered while solving this lab.
  2. Which vulnerability class does this lab cover? (a few words)
Sign in to attempt
On this page

At a glance

Operating system
Web application
Connection
Browser / HTTP
Questions
0 / 2 solved
Launched by
0 hackers
Maintained by
Faustino Luettgen

Your machine

Status

Booting your machine — this takes about a minute. Connection details appear in the brief below when it's ready.

Ready — see How to connect below.

Provisioning failed. Hit Relaunch to try again.