Web Vulnerabilities /

What is SQL Injection

EASY1 task

What is SQL Injection?

SQL injection (SQLi) is one of the most common and dangerous web vulnerabilities. It occurs when user input is included directly in a database query without proper sanitization.

How It Works

A normal login query looks like this:

SELECT * FROM users WHERE username='admin' AND password='password123'

If the developer builds this query by concatenating user input:

query = "SELECT * FROM users WHERE username='" + username + "'"

An attacker can input:

admin'--

Which makes the query:

SELECT * FROM users WHERE username='admin'--' AND password='whatever'

The -- comments out the rest, bypassing the password check entirely.

How to Spot It

Signs a site might be vulnerable:

  • Error messages containing SQL syntax when you add a quote
  • The page behaves differently with ' vs ''
  • URLs containing id=1 parameters

Your Task

For this Easy lesson, no exploitation is needed. Simply read and understand the concept above.

The flag for completing this lesson is below.

Answer the questions below

Room Progress0 / 10 pts
0/1 tasks complete

Read the lesson and understand what SQL injection is. Submit the flag to confirm completion.

💡 Show hint

The flag is shown at the end of the lesson content above.

No target
No target machine for this room.