Skip to content
ShankarStack
IntermediateIndividualWeb Security150 pts

SQL Injection

A safe, intentionally vulnerable data layer that teaches how injection arises and how parameterisation prevents it.

This is an isolated, sandboxed environment created only for you. Techniques here apply only to systems you own or are authorised to test.

Scenario

A search or lookup feature builds a database query from user input by concatenation. You'll demonstrate that the data/code boundary is broken and then show the safe implementation.

Objective

Retrieve the flagged record through the vulnerable parameter without destructive actions, then rewrite the query safely.

Your approach

  1. Identify inputs that reach a database query.
  2. Probe gently and non-destructively to confirm the input alters query behaviour.
  3. Retrieve only the flagged record needed to prove impact — never damage data.
  4. Document the vulnerable pattern with evidence.
  5. Rewrite the query using bound parameters and least-privilege database access.

Rules of engagement

Run this lab only in the isolated environment provided — the downloadable bundle runs on your own machine in a private Docker network. Only interact with the lab's target, keep testing non-destructive, and never use these techniques on systems you don't own or aren't authorised to test. When you've met the objective, submit the flag (format SS{...}) to score.

Remediation focus

Use parameterised queries / prepared statements everywhere, apply least-privilege database accounts, and never build SQL by string concatenation.

Deliverable

Write up what you did, what you observed, the business impact, and a clear remediation — exactly as you would in a professional report.

Hints

Hint 1

Re-read the matching knowledge-base entry before you start.

Hint 2

Capture reproducible evidence as you go — you'll need it for the write-up.

Hint 3

For every finding, identify the single control that would prevent it.

Study the theory

Read the SQL Injection knowledge-base entry

→