24 March 2025
SQL Injection is a common hacking technique that targets vulnerabilities in a web application's database layer...
SQL Injection (SQLi) occurs when an attacker inputs malicious SQL code into a form field...
SELECT * FROM users WHERE username = 'user' AND password = 'pass';
If the application doesn't properly validate or sanitize the input...
SELECT * FROM users WHERE username = '' OR '1'='1' AND password = 'pass';
UNION
operator...
To understand SQL Injection, you can practice on a safe, legal environment...
This command connects to a MySQL server hosted at docker.hackthebox.eu
...
SELECT * FROM products WHERE name LIKE '%[user_input]%';
If you input abc' UNION SELECT username, password FROM users --
...
SELECT * FROM products WHERE name LIKE '%abc' UNION SELECT username, password FROM users --%';
$stmt = $pdo->prepare("SELECT * FROM users WHERE username = ? AND password = ?"); $stmt->execute([$username, $password]);
Never test SQL Injection on systems you don’t own or have permission to test...
Join The Club