AIM: Learn To Use Manuel SQL Injection Using DVWA. Solution:S
AIM: Learn To Use Manuel SQL Injection Using DVWA. Solution:S
SOLUTION:S
SQL Injection Menu
Instructions:
Select "SQL Injection" from the left navigation menu.
Basic Injection
Instructions:
Input "1" into the text box.
Click Submit.
Note, webpage/code is supposed to print ID, First name, and Surname to the
screen.
Notes(FYI):
Below is the PHP select statement that we will be exploiting, specifically $id.
$getid = "SELECT first_name, last_name FROM users WHERE user_id = '$id'";
130470105017 PRACTICAL N
Instructions:
Input the below text into the User ID Textbox (See Picture).
%' or '0'='0
Click Submit
Notes(FYI):
In this scenario, we are saying display all record that are false and all records that are
true.
%' - Will probably not be equal to anything, and will be false.
'0'='0' - Is equal to true, because 0 will always equal 0.
Database Statement
mysql> SELECT first_name, last_name FROM users WHERE user_id = '%' or '0'='0';
130470105017 PRACTICAL N
Instructions:
Input the below text into the User ID Textbox (See Picture).
%' or 0=0 union select null, version() #
Click Submit
Notes(FYI):
Notice in the last displayed line, 5.1.60 is displayed in the surname.
This is the version of the mysql database.
130470105017 PRACTICAL N