Sequel injection attacks.
So what is sequel injection.
Well sequel injection is where we inject malicious sequels statements into a sequel database.
These are super easy to avoid but it still happens very often and it happens due to poor code.
We'll talk about that in the defense section but if we're successful with a sequel injection attack
we're capable of reading databases extracting information modifying databases and potentially we can
even get a shell with this.
So from here let's go ahead and talk about some common sequel verbs.
These are things you're going to be seeing and you should know.
So feel free to take notes on this or just watch the first time through and then take note the second
time through.
But these are common sequel verbs and let's just cover these really quick.
So every single statement begins with a verb.
And for example one you're gonna see a lot of is select and that's going to retrieve data from a table
answer is going to add data to a table deletes going to remove data from a table updates going to modify
a table drop is going to delete a table very malicious and union is going to combine data from multiple
queries I'm going to give you examples of all these statements here in just a second.
So there's some other common terms that we should know as well so we could say where and that's going
to filter records based on specific conditions you're going to see.
Example this.
There's and or not.
Which is going to filter based on multiple conditions.
So we have one condition and another condition or another condition or not a condition similar to when
we were talking about Python earlier.
Same logic.
And then we have an order by as well.
So this is going to sort records in ascending or descending order.
Now there's a lot more terms than this but these are a very very common ones and ones you should know
so let's look at an example let's say here that we have a sequel table and the table is called users
and we have five users in this table.
Now we've got Frank and the username here Frank.
Full name Frank Castle.
Email Punisher at Marvel dot com and the country they belong to.
So what's gonna happen when we say select from and then we say users OK.
Well we're going to select a star from users so Star is a wildcard and this here is an end statement.
When we have the semicolon that's ending the statement.
So we're just going to say select WILD CARD FROM users meaning select everything from users.
So if we select everything from users here we're going to select this entire table if we want to select
user I.D. and user name from users.
Well guess what.
We're going to just pull down this column and this column so we'll pull down user I.D. and use name.
And we won't pull down any information from here if we wanted to select every single thing from the
user's table where a condition applies say country equals Russia.
Well then we're only going to pull out Natasha here the black widow or let's try one more.
If we select everything from users where the country is the US and username equals Frank.
Well the US to pull down all of these right except and Tasha and then we also set the condition of Frank.
So it's only going to pull down this first column here.
So with that all being said let's quickly talk about special characters you're going to see in sequel.
So you saw an example of a few here we had string de limiters.
Again we have a single quote or double quote.
Right.
And what that does is that just for a string similar to coding and a lot of this logic is like programming
logic.
We have common deliverers.
So we have a dash dash which you're going to see here very soon.
We have a forward slash Asterix and we have the pound sign.
So again feels like coding.
Right.
And this is just another type of language.
So we have wild cards.
You saw the abstract.
We also can use the percent symbol for a wild card.
We have the end of a sequel statement which is a semicolon.
As you saw in the last slide and then we have a bunch of programming logic.
So we have equal signs plus signs greater than less than parentheses.
And you can put things into programmatic logic so that's it.
Here what we're going to do next is we're going to dive in the application and make a lot more sense
of this and what's going on.
We'll talk about how to test for this and some different options that we can do.
So let's look at sequel injection and talk about the different types of sequel injection and see what
we have available to us.