SQL Injection is a web security vulnerability that allows attackers to interfere with a website’s database queries by injecting malicious SQL code into input fields. This often happens when user input is not properly validated or sanitized. For example, an attacker could input a specially crafted SQL statement into a login form to bypass authentication or retrieve sensitive data like usernames and passwords. SQL Injection can lead to data breaches, unauthorized access, or even deletion of entire databases. Preventing it involves using parameterized queries, prepared statements, and input validation.
SQL injection vulnerability in WHERE clause allowing retrieval of hidden data
This lab contains a SQL injection vulnerability in the product category filter. When the user selects a category, the application carries out a SQL query like the following:
SELECT * FROM products WHERE category = 'Gifts' AND released = 1
Use Burp Suite to intercept and modify the request that sets the product category filter.
Modify the category parameter, giving it the value '+OR+1=1--
Submit the request, and verify that the response now contains one or more unreleased products.
SQL injection vulnerability allowing login bypass
This lab contains a SQL injection vulnerability in the login function.
To solve the lab, perform a SQL injection attack that logs in to the application as the administrator user.
Use Burp Suite to intercept and modify the login request.
Modify the username parameter, giving it the value: administrator'--
UI Design
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt.