OK, so now we know that we can put any code we want in here and it's going to be executed on the system.
So let's have another look now at the statements.
So the statement says select staff from accounts where username is equal to the username that we put
here and passwords equal to the password that we put there.
Let's see if we can use that to log in without using a password, without even knowing the password.
And I'm going to be doing that with the admin.
So the admin or the user name is going to be admin.
And I don't know what the password is for the admin, so I'm going to do I'm just going to put anything.
So nothing really any any random password and any code.
Well, I should run here we were doing and one is equal to one and or stuff.
So what I'm going to do is I'm going to do or instead of and and I'm going to say one is equal to one.
So what's our court is going to be once I run this, once I inject this, this is going to go in here
like we were doing before.
So our code is going to look like this.
So it's going to be selected from accounts where user name is equal to admen.
And password is equal to AAA.
Now, this is wrong.
Or one is equal to one, which is right.
So any time you have an or if the air condition is right, everything is right.
That's the way our statement works.
So let's start from a or using names.
You've got to admit, OK, username is equal to admin and password is equal to AAA.
That's wrong.
Or one is equal to one.
OK, I'll accept that and then it's actually going to execute it and let us log into the admin without
even knowing the password for the admin.
So let's try to inject this now.
And as you can see, I was able to log in as admin and monkey is the signature for the admin now bypassing
logins can be done in so many ways, depending on the code that's written on the page and depending
on the way you want to do it and how you're imagining the code and all the cases.
When you put the single code here, you won't see this message.
Sometimes you do see it, which makes your job so much easier.
If you don't, then you kind of need to guess what it looks like.
So I'm going to show you another example of bypassing instead of injecting the code like this, the
admin parameter is actually injectable as well.
As you see, when I put the single quote, the admin parameter is injectable, exactly the same way
as the password.
So we can inject code in the username as well.
And what I'm going to do now.
So let's have a look on this and I'm just going to reset it to the way it would usually look like.
So you'd have.
And the username and password are the fields that you whatever you put in here, are going to be substituted
in the username and password.
So let's try to inject something in the username.
And what I'm going to say is I'm going to say user name is equal to admin, and then I'm going to close
the quote myself and then I'm going to add a comment.
So my statement when I run this statement is going to look like this and I'm actually just going to
copy it here.
And when I inject when I put this code in here and in my name.
It's going to inject that in their.
So this is what the court is going to look like, it's going to select staff from accounts where username
is equal to Aardman, I close the quote myself here using this right there, and then I've added a comment.
So basically, all of this is not even going to be executed.
So the code is going to be this is going to be select start from accounts where user name is equal to
admin and it's going to let me log in without even entering anything in the password.
So let's do this.
I'm going to put my username as admen and I close the quote and add a comment and then you can put any
password you want to read.
I'm just going to put number one and I'm going to log in.
And as you can see, I managed to log in as admin.
So, again, this is blackbox testing, so you don't really see the code in many cases, you want to
be playing around with it and see how it works with you.
But the main thing is you want to test if the actual injection exists and you'd use that using the method
we showed you in the previous video.
So try a single quote, try the statement, try if true and statements are once equal to one and then
a false statement.
So one is equal to zero two zero to zero.
And if they work as expected, then your target has an Ezekial injection and you can start playing around
with.