Lab 5. SQL Injection
Lab 5. SQL Injection
SQL Injection
SQL injection is a code injection technique that exploits the vulnerabilities in the
interface between web applications and database servers. The vulnerability is present
when user’s inputs are not correctly checked within the web applications before being
sent to the back-end database servers
Submission:
You will compose a lab report that documents each step you take, including screenshots
to illustrate the effects of commands you type, and describing your observations. Simply
attaching code without any explanation will not receive credits
Prepare:
- Pre-built Ubuntu VM (download from the SEED Website)
LAB GUIDE:
1. Review the lab environment
#vi /etc/host
# /etc/ apache2/sites-available/ 000-default.conf
2. Get Familiar with SQL Statements
.
we have already created the Users database for you, you just need to load this
existing database using the following command:
-First, let's log in to MySQL console:
you can use the following command to print out all the tables of the selected
database
-next we can use commands to show informations of Users:
mysql> describe credential;
• Task 5.1: Modify your own salary. As shown in the Edit Profile page, employees
can only update their nicknames, emails, addresses, phone numbers, and passwords;
they are not authorized to change their salaries. Assume that you (Alice) are a
disgruntled employee, and your boss Boby did not increase your salary this year. You
want to increase your own salary by exploiting the SQL injection vulnerability in the
Edit-Profile page. Please demonstrate how you can achieve that. We assume that you
do know that salaries are stored in a column called ’salary’.
First I will go into “edit profile” section then type this command to the NickName
field in order to change salary to 80000: ', salary='80000' WHERE
name='Alice';#
-after get the sha1 hash value now we repeat the upper steps to change password to
the sha1 hash value:
‘,password='785df7a7c3c0f7a7e65e1f58300586b1f73d97b2' where Name='Alice';#
-we successful change the password now try to login to Alice account
with the password ‘270509’:
Login successfully.