Assignment No: 3: SQL Injection & XSS Attacks
Assignment No: 3: SQL Injection & XSS Attacks
Assignment No: 3: SQL Injection & XSS Attacks
Surbhi Vasudeva
Akshay Bhope
Set DVWA’s script security to “Low” and perform the following exploits:
• Perform a SQL injection attack and retrieve the list of users in the user database
• Perform a reflected XSS attack (payload is your choice; I’d recommend just popping up a
JavaScript alert)
Describe the SQLi attack you used, how did you cause the user table to be dumped? What
was the input string you used?
SQL Injection is a web security vulnerability where attackers could interfere with the queries
sent to the database from the user interface. Using this vulnerability, attackers could retrieve that
they are not intended to see. In certain cases, attackers could even modify, delete or make
permanent changes.
Click on SQL Injection on the left and then enter the user id as%' or '0'='0.
As the SQL query could be SELECT first_name, last_name FROM users WHERE user_id =
‘’; on supplying input string as %' or '0'='0, the SQL statement becomes SELECT first_name,
last_name FROM users WHERE user_id = '%' or '0'='0';
So, it will return all the first name and last name values which are false and true. % would not be
equal to anything and will return false. On the other hand, 0=0 is always true.
Reference :
1. https://www.computersecuritystudent.com/SECURITY_TOOLS/DVWA/DVWAv107/le
sson6/index.html
2. https://sechow.com/bricks/docs/login-1.html
If you switch the security level in DVWA to “Medium”, does the SQLi attack still work?
No, we were not able to perform the attack as on changing the DVWA security level to medium,
it just offered a dropdown to select the user by id ranging 1-5, on selecting a particular number,
we were able to see the first name and last name.
However, were able to get the user details one by one, if not at once.
Describe the reflected XSS attack you used; how did it work?
References :
1. https://medium.com/@Tanmay_Bhattacharjee/cross-site-scripting-xss-dvwa-damn-
vulnerable-web-applications-36808bff37b3
If you switch the security level in DVWA to “Medium”, does the XSS attack still work?
On setting the security level in DVWA to “Medium”, the XSS attack did not work for us.
It simply displayed the alert statement.
*****************