Hey, guys, welcome back to another episode on How to Hack, so now we'll look into the last Uttara
on SQL injection intro.
OK, so this is about compromising confidentiality with string sequel injection.
OK, so again, we are on Web Good, which is a vulnerable Web application system.
We will try out all this different kind of attacks on so we can see on the left site.
All this are the different stories that we'll be doing as part of a Web application penetration testing
series.
So compromising confidentiality with string SQL injection.
All right.
So what is string string sequel?
So this is the payload that goes in to the input form and we are trying to break into the system.
All right.
So here we have an employee named John Smith.
OK, so they work for a company and we have these current and so teahan is a unique authentication.
All right.
So here you can think of it kind of like a password or a one time password that is sent to a mobile
devices as you authenticate to the different parts of a banking app of a system.
All right.
So over here, we can see the query, the structured query language select all from employees where
last name equal and then they have the input name and then followed by authentication, underscore Tianyun.
All right.
So again, the input information over here.
So, for example, if I enter the last name Smith or I can copy and I can pay Smith over here and then
followed by the tanne.
So go ahead and pass it and we'll get department.
All right.
We are able to see.
All right.
We are getting the user name, the first name to last name, the Department of Salary, phone number
and so on.
So we can get all these different details.
Right.
So what we are trying to do here is to retrieve all employee data from the employee's table.
So how can we do so?
All right.
So over here, OK, once again, going back to the previous tutorial about SQL injection, I really
have to pay look for us.
So all we got to do right is to be able to pull all information and records of the system.
OK, so that's what we can do as part of the attack.
OK, so over here.
All right.
What we will do is to put for example or one equal one, OK?
And this will help us immediately get the whole information out of the system.
So we continue to have the authentication feel over here.
And all I got to do is to enter the following.
OK, I can copy this part, this segment and input into our payload.
So what we are doing is a single code or OK, one equal one followed by semicolons of one equal one
is always true.
So go ahead and click department.
All right.
So we can, for example, get rid of the semicolon.
OK, all the singer code again.
All right.
So he says you have succeeded.
You successfully compromised the confidentiality of data by viewing internal information that you should
not have access to.
Well done.
OK, so once again, we're able to pull the entire table, all the rules of information.
And on one of the previous tutorials on the lessons, we actually added in an extra call on phone.
All right.
Into the database system so we can see the user name to first name, last name, department salary and
all these different details.
OK, so once again, going back to the basics, you have to input forms.
So do test them first for susceptibility to SQL injection or to different kind of payloads.
So you need different kind of panels already available and a lot of these payloads are available out
of the box to get a call and instead you can just input into the system to test.
So whether they're sanitizing to input or not.
OK, so that's how we actually run the attack.
All right.
So we've got the employee.
We go the authentication.
All right.
So and of course, you can mapi back to the structured query language here or you can build it on your
own.
Think about how they are developing the Web application system to actually pull all this different course
and how they check for all this different table information.
All right.
And then after which, you can create your payload to inject into the system.
All right.
So now let us continue.
All right.
Into lesson 12.
OK, so we have compromising integrity with query chaining.
OK, so again, CIA confidentiality, integrity and availability, confidentiality, meaning that can
someone who is unauthorized be able to view confidential data, financial information in which they
have no rights to access to?
All right.
Integrities about changing the data.
How are we monitoring changes to the database system, to the follow systems?
And finally, availability?
Is it subjected to denial of service attack?
Can we shut down the entire system?
So those are the different kind of traits of CIA, which are the fundamentals of cybersecurity.
OK, so Secretary Cheney, allow us at additional instructions into the query.
So rather than just pulling information out, can we do Futter different types of structured query language
to inject into the Web application system?
All right.
So once again, we have Smith.
All right.
I can copy the information here.
And I have.
And which is authentication click get department.
All right, so we are looking again at the normal way of how it works.
And we can see over here we have the user ID, first name, last name, department salary of 10.
All right.
And OK, so we can see all the details of employee name authentication and so on.
So, of course, what we are doing, as you have seen from the previous lesson, OK, what we can do
is we can inject information into the input forms.
All right.
So I really have to payload here.
So what we can do again is to copy the following.
OK, we can copy the following and I can pace it and I'll explain to you what it all means.
So first of all, we are closing OK to password and or one equal one, which is always true.
OK, or you can just close it directly.
And we have the following command.
We have update.
All right.
Which is a structured query language and we have update employees.
So we're updating the table employees and we are setting the salary to a specific number.
So we're setting it to eighty five thousand.
OK, and we have where user ID equal OK to this specific user ID which we have over here.
Right.
So once you have all these different details, you can go in and get department.
Go ahead.
Clicked on that and immediately we're able to firstly pull out all information off the table.
And secondly, we've updated.
All right.
A system with a new Sellery number, as you can see over here.
All right.
So we've updated Smith's salary numbers.
So that's how we are able to violate the integrity section of the CIA.
Try it.
OK, so let's go back up and go into the final lesson, lesson one tree, which is compromising availability,
meaning can we shut down the database system?
Can we drop the table so that no one has access into the system?
OK, so over here, what we are seeing is that now that you're the top earner in your company, but
do you see that?
All right.
There seems to be excess log table.
So excess log actually stores all these different changes to the database and you actually lock down
all those things so that it can be used for audit purposes and to look back at what happened to the
changes in the database system.
So first of all, we have over here drop table access so we can copy this.
And let me explain to you what is payload means, first of all.
OK, so firstly, we're entering a.
Percentage saying, OK, so this would actually help us complete victory, and then after that, we
are ending the instructions here and we have a semicolon and it followed by a new instruction, which
is drop table, and we're dropping to a specific table excess on a score of law.
OK, so this will immediately help us see all those details.
And of course, before I even do drop table, I can actually enter, for example, select all from excess
law to perhaps even view information inside this particular table so we can actually go ahead and enter
that.
And this would help us see some details about the table.
So over here, we can see all of the queries that have been sent into the database system.
So we have select all from employees.
OK, we have all these different details that have been sent over into the system.
And over here we can see this particular lock.
Right.
So we have select or from employees and then there is a updating employees set salary, eighty five
thousand dollars.
OK, so immediately we're able to see the lock fall.
OK, so what we'll do next is to actually just copy the payload and just pass it over here.
So what we are doing instead now is drop paper.
So this would get rid of the entire excess lock table and Afolabi double dash again.
So double dash at the end would actually come in all the rest of the story and allowing us to actually
run the attack against the system immediately because it go ahead and enter such locks.
And now we can see that we have delete it says lock table and we compromised the availability of the
data.
So once again, I hope you've learned something valuable in today's tutorial and we will like, share
and subscribe the channel so that you can be kept abreast of the latest cybersecurity.
Thank you so much once again for watching.