This repository documents the complete setup and execution of a local SQL Injection practice lab using Damn Vulnerable Web Application (DVWA) on Kali Linux.
This project is created strictly for educational and ethical cybersecurity learning.
- Understand how SQL Injection vulnerabilities occur
- Practice real-world SQLi attacks in a controlled environment
- Learn offensive (exploitation) and defensive (mitigation) techniques
- Gain hands-on experience aligned with OWASP Top 10
| Component | Details |
|---|---|
| OS | Kali Linux |
| Web Server | Apache2 |
| Database | MariaDB (MySQL compatible) |
| Backend | PHP |
| Vulnerable App | DVWA |
| Tools | Burp Suite, sqlmap |
This project is intended only for self-learning and educational purposes.
All testing was performed on a locally hosted lab environment owned by the author.
❌ Do NOT test these techniques on real or third-party websites without permission.
sudo apt update
sudo apt install apache2 mariadb-server php php-mysqli git -y
Start: sudo systemctl start apache2 sudo systemctl start mariadb
Verify Services: Verify Apache by opening: http://localhost
sudo mariadb
You can view sample sql query in the code file
cd /var/www/html sudo git clone https://github.com/digininja/DVWA.git sudo chown -R www-data:www-data DVWA sudo chmod -R 755 DVWA
cd DVWA/config sudo cp config.inc.php.dist config.inc.php sudo nano config.inc.php
Vulnerable PHP Login Page:
$_DVWA['db_user'] = 'dvwa'; $_DVWA['db_password'] = 'dvwa'; $_DVWA['db_database'] = 'dvwa';
Open in browser: http://localhost/DVWA/setup.php
Login Credentials: Username: admin Password: password
Set DVWA Security Level: Low ' OR '1'='1 1 UNION SELECT database(), user() 1' AND SLEEP(5)-- -
- Damn Vulnerable Web Application (DVWA)
- Burp Suite
- sqlmap
- Apache2
- MariaDB
- Use prepared statements
- Input validation and sanitization
- Principle of least privilege
- Disable detailed SQL error messages
https://github.com/digininja/DVWA https://github.com/sqlmapproject/sqlmap https://owasp.org/www-community/attacks/SQL_Injection https://owasp.org/www-project-top-ten/ https://portswigger.net/web-security/sql-injection
Chanukya Venkata Sai
Cybersecurity & CSE Student
⭐ If you found this repository helpful, please consider giving it a star on GitHub.
Your support helps others discover this project and motivates further improvements.