Instructor: Okay, now let's have a look
on a stored XSS example.
Now stored XSS is very similar to our reflected one.
It allows you to inject JavaScript code into the browser,
the code is executed on the people that visit the page.
The only difference is with the reflected,
you have to send the URL to your target.
So the target had to actually click on a URL
for the exploited to run or for the code to run.
In the stored XSS,
the code will actually be stored into the database
or into the page.
So every time any person runs that page,
they will see your code and your code will be executed.
So you won't need to interact with any users
or send them anything.
Therefore, this could be much more dangerous
than reflected XSS.
So, let's have a look on this.
Now I clicked on the XSS stored here on the left,
and you have this page.
And this page just allows you
to add a message to the system.
So I'm going to put my name as Zaid.
We're just going to do a normal test first,
and we're going to put a message body for example.
And then I'm going to sign the guestbook
and you can see that Zaid added a message
called "message body".
So if you would go to here
and to another mission,
so this is a different mission to a different place.
And if we go into the XSS store,
we can see that there's two entries.
So the entries are being loaded from the database
and they contain the entries in that database.
So if we manage to inject code in here,
then any person who runs this page,
the code will run it
without even having to send that person anything.
So let's try to inject stuff here.
So let's put my name as Zaid,
and I'm going to try to put my code in here.
So I'm going to try to inject into the message
and I'm going to put it as "script".
I'm going to use the exact test code
that we used in the previous video,
just a message saying XSS.
Again, very basic code,
but it serves for the purposes of this video.
And we're going to say "alert",
"XSS",
and I'm going to try to sign the guestbook.
And as we can see now, I got the XSS here,
but the real magic happens when a normal person-
so let's just go home first
and let's assume this is just the normal website
and people just are coming and browsing it,
and once they're going to go to the guestbook,
JavaScript code will be executed on their system
from that website.
So the code is coming from that website
and it's going to be executed
on every person that visits this page.
Again, we're just showing a proof of concept here.
In future videos, we'll show how to further exploit
this kind of vulnerability.