So in the last lesson on cross scripting, we completely destroyed the database that was stored here
on the excess has stored page, it will not even stay on this site.
It will say hacked, hacked.
And then take us to the GOP website.
Well, let's clear that up so that we can do some sequel injection.
Let's go to set up and then create that reset the database.
Now we come back to cross site scripting stored.
You'll see it's back to empty with just one comment down there and none of our other attacks.
That's the great thing about Devoir.
We don't have to do a lot of work to reset everything.
We can just come back to set up and reset the database.
But let's go to sequel injection ESKIL Injection.
That's the other broad class of HTML or website attack that we need to be familiar with, because any
time we have a form that interacts with a database and most of our forms interact with databases because
we want to store that information, someone's entered in on our server, we need to take care to make
sure that we don't enable sequel injection.
That means injecting some or a structured query language that runs our database.
Give you a quick just a quick example.
Let's submit a user I.D. Let's try one that tells me that that's the administrator to.
Gordon Brown, so I'm just looking through a database, and this is, of course, made to be a little
easier than normal, we normally can't just test through all of the different users here.
All right, so we have about five uses, it looks like.
Well, that's because it's using just the ID information here, right?
So it's taking in this one and turning it into a query that goes on to the database.
Well, we have our devoir security set to load.
So if I come back the sequel injection and say one quote or one equals quote one.
Now, this is a strange syntax.
I know, but I'll zoom in a little more there.
That is one quote or one equals quote one.
This is equerry.
I'm changing Macquarie in my normal cycle, usually this is where user ID equals quote and then whatever
we put inside one and so we've said one quote, so admin or one equals one?
Well, one is always equal to one.
Right.
And we put this quote here so that when it finishes the quote on the other side of the database, this
should do something completely different because one is always equal to one.
So it's not true for just one user.
It's true for all the users.
One equals one is true for admin, Gordon Brown, Hackney, Pablo Picasso and Bob Smith.
All that is one of the simplest versions of fuel injection or sequel injection.
We just asked the database to tell us everything, but in this case, we were able to see all of the
users.
Their first name and their last name, just by doing one piece of sequel injection and this piece of
sequel injection was not even terribly advanced to just one, quote, space or and you could do just
about anything.
You can do a equals.
Hey, and notice, I just don't close that second quote because I've closed my first quote in my school
statement, my skill command out in my Web page with this one.
So I need to open another one back so I'll finish it out.
And this command should do the same thing.
Well, as always, equal to a so it's going to show for every one of those users their first name and
last name, there are some much more advanced things that we can do with sequel injection and we'll
see how to do things like showing all the password hash values and even how to see the name of the database
and maybe even delete the database of all these users in the next lesson.