SQLi lab setup & writeups

Lab setup

The page linked below shows a simple setup to start learning SQL and testing SQL injection payloads locally. One of the biggest things you can do to catapult your learning and experience is to set things up locally and test them. You'll gain a deeper understanding of systems, how they work, how they are exploited, and invaluable troubleshooting skills. It WILL set you apart from those that just rely on pre-made or hosted CTFs.

SQLi testing labs

Labs list

SQL injection vulnerability in WHERE clause allowing retrieval of hidden data

PortSwigger | free | easy | link to lab

Solution
1. Click on a search item such as gifts

2. Modify the query to include your payload

/filter?category=Gifts' or 1='1

3. Send the request

SQL injection vulnerability allowing login bypass

PortSwigger | free | easy | link to lab

Solution
1. Browse to the login page

2. Enter your payload into the username box

administrator' or 1=1-- -

3. Enter any password

4. Click Log in

SQL injection attack, querying the database type and version on Oracle

PortSwigger | free | easy | link to lab

Solution

SQL injection attack, querying the database type and version on MySQL and Microsoft

PortSwigger | free | easy | link to lab

Solution

SQL injection attack, listing the database contents on non-Oracle databases

PortSwigger | free | easy | link to lab

Solution

SQL injection attack, listing the database contents on Oracle

PortSwigger | free | easy | link to lab

Solution

SQL injection UNION attack, determining the number of columns returned by the query

PortSwigger | free | easy | link to lab

Solution

SQL injection UNION attack, finding a column containing text

PortSwigger | free | easy | link to lab

Solution

SQL injection UNION attack, retrieving data from other tables

PortSwigger | free | easy | link to lab

Solution

SQL injection UNION attack, retrieving multiple values in a single column

PortSwigger | free | easy | link to lab

Solution

Blind SQL injection with conditional responses

PortSwigger | free | medium | link to lab

Solution

Blind SQL injection with conditional errors

PortSwigger | free | medium | link to lab

Solution

Visible error-based SQL injection

PortSwigger | free | medium | link to lab

Solution

Blind SQL injection with time delays

PortSwigger | free | medium | link to lab

Solution

Blind SQL injection with time delays and information retrieval

PortSwigger | free | medium | link to lab

Solution

Blind SQL injection with out-of-band interaction

PortSwigger | free | medium | link to lab

Solution

Blind SQL injection with out-of-band data exfiltration

PortSwigger | free | medium | link to lab

Solution

SQL injection with filter bypass via XML encoding

PortSwigger | free | medium | link to lab

Solution

Last updated

Was this helpful?