WEBVTT

00:00:00.000 --> 00:00:03.374 align:middle line:90%


00:00:03.374 --> 00:00:06.266 align:middle line:90%
[MUSIC PLAYING]

00:00:06.266 --> 00:00:10.140 align:middle line:90%


00:00:10.140 --> 00:00:13.140 align:middle line:84%
You might have remembered
seeing in some of the scans

00:00:13.140 --> 00:00:17.190 align:middle line:84%
that we've done either Nessus
previously in vulnerability

00:00:17.190 --> 00:00:20.280 align:middle line:84%
assessments or most
recently when we

00:00:20.280 --> 00:00:23.970 align:middle line:84%
were going through ZApp and
some of the other tools,

00:00:23.970 --> 00:00:25.920 align:middle line:90%
scanning the web app.

00:00:25.920 --> 00:00:28.660 align:middle line:84%
Well, cross-site
scripting is neat.

00:00:28.660 --> 00:00:35.460 align:middle line:84%
It's a bug that has implications
that you're basically running

00:00:35.460 --> 00:00:37.960 align:middle line:90%
code on someone else's website.

00:00:37.960 --> 00:00:40.800 align:middle line:84%
If you do that properly,
you may get access

00:00:40.800 --> 00:00:44.610 align:middle line:84%
to the server itself, or you
may get access to information

00:00:44.610 --> 00:00:46.110 align:middle line:84%
that's also
presented on the site

00:00:46.110 --> 00:00:48.010 align:middle line:84%
that you're not supposed
to get access to.

00:00:48.010 --> 00:00:50.580 align:middle line:84%
But because you
can run a script--

00:00:50.580 --> 00:00:55.732 align:middle line:84%
you can run JavaScript on the
site that wasn't intended--

00:00:55.732 --> 00:00:57.190 align:middle line:84%
you might be able
to do some stuff.

00:00:57.190 --> 00:00:59.580 align:middle line:84%
So let's play around
with it and at least see

00:00:59.580 --> 00:01:03.060 align:middle line:84%
some basics of what it
does and learn a little bit

00:01:03.060 --> 00:01:03.675 align:middle line:90%
about a tool.

00:01:03.675 --> 00:01:07.350 align:middle line:90%


00:01:07.350 --> 00:01:08.940 align:middle line:90%
Let's grab our IP address.

00:01:08.940 --> 00:01:15.810 align:middle line:90%


00:01:15.810 --> 00:01:19.260 align:middle line:90%
And we're on the .2.

00:01:19.260 --> 00:01:26.220 align:middle line:84%
The web servers can be
on .3, and we can just

00:01:26.220 --> 00:01:28.340 align:middle line:84%
run Nmap on that
to double-check.

00:01:28.340 --> 00:01:29.670 align:middle line:90%
Yeah, the port is open.

00:01:29.670 --> 00:01:30.495 align:middle line:90%
Let's take a look.

00:01:30.495 --> 00:01:37.900 align:middle line:90%


00:01:37.900 --> 00:01:41.358 align:middle line:90%
Yep, we got Burp on.

00:01:41.358 --> 00:01:42.650 align:middle line:90%
There's nothing touching it.

00:01:42.650 --> 00:01:45.500 align:middle line:90%


00:01:45.500 --> 00:01:47.130 align:middle line:90%
I turn it off.

00:01:47.130 --> 00:01:48.960 align:middle line:90%
That'll help.

00:01:48.960 --> 00:01:52.710 align:middle line:84%
All right, it's Mutillidae,
which is a nifty tool.

00:01:52.710 --> 00:01:54.420 align:middle line:90%
It's OWASP.

00:01:54.420 --> 00:01:55.260 align:middle line:90%
It's open-source.

00:01:55.260 --> 00:01:57.302 align:middle line:84%
You could run it on your
own machine if you want,

00:01:57.302 --> 00:01:59.980 align:middle line:84%
but you don't get to do
the lab just like me here

00:01:59.980 --> 00:02:00.730 align:middle line:90%
if you do that.

00:02:00.730 --> 00:02:02.250 align:middle line:90%
So play with it here.

00:02:02.250 --> 00:02:04.290 align:middle line:90%
It's fun and easy.

00:02:04.290 --> 00:02:07.150 align:middle line:84%
And it's all can
be good already.

00:02:07.150 --> 00:02:09.044 align:middle line:90%
And what we're going to do--

00:02:09.044 --> 00:02:12.480 align:middle line:90%


00:02:12.480 --> 00:02:15.670 align:middle line:84%
in here, there's all
the different times

00:02:15.670 --> 00:02:17.740 align:middle line:90%
that they've revalued OWASP.

00:02:17.740 --> 00:02:19.570 align:middle line:84%
We're going to look at
cross-site scripting

00:02:19.570 --> 00:02:21.790 align:middle line:90%
and reflected first order.

00:02:21.790 --> 00:02:24.430 align:middle line:84%
And we're going to
use this DNS lookup.

00:02:24.430 --> 00:02:27.850 align:middle line:84%
Now, this page would do
a reverse DNS lookup.

00:02:27.850 --> 00:02:32.080 align:middle line:90%
You could do google.com.

00:02:32.080 --> 00:02:36.460 align:middle line:84%
We are sandbox, so it's not
actually going to lookout.

00:02:36.460 --> 00:02:40.800 align:middle line:90%
Let's do a Burp.

00:02:40.800 --> 00:02:50.745 align:middle line:90%


00:02:50.745 --> 00:02:51.495 align:middle line:90%
Turn on the proxy.

00:02:51.495 --> 00:02:55.960 align:middle line:90%


00:02:55.960 --> 00:03:00.190 align:middle line:84%
Sorry, I have FoxyProxy
reach out to Burp.

00:03:00.190 --> 00:03:03.850 align:middle line:84%
Now, if I put something in
here, you can see on the page,

00:03:03.850 --> 00:03:06.500 align:middle line:84%
I put in google.com, and
it reflected down here.

00:03:06.500 --> 00:03:08.260 align:middle line:84%
So it's running
some sort of script

00:03:08.260 --> 00:03:11.110 align:middle line:90%
where it keeps it internal.

00:03:11.110 --> 00:03:15.490 align:middle line:84%
And we've got some sort
of code in our URL.

00:03:15.490 --> 00:03:18.730 align:middle line:84%
So let's see exactly
how this one works.

00:03:18.730 --> 00:03:22.360 align:middle line:90%
Let's just do helloworld.

00:03:22.360 --> 00:03:23.290 align:middle line:90%
And it caught it.

00:03:23.290 --> 00:03:28.840 align:middle line:84%
I've go to the proxy, and we can
see, OK, it passes it down here

00:03:28.840 --> 00:03:30.850 align:middle line:90%
through a POST information.

00:03:30.850 --> 00:03:32.290 align:middle line:90%
OK, awesome.

00:03:32.290 --> 00:03:36.370 align:middle line:84%
So we've got target_host
is helloworld.

00:03:36.370 --> 00:03:38.140 align:middle line:90%
That's what I put in there.

00:03:38.140 --> 00:03:43.220 align:middle line:84%
We're going to use this neat
tool called cross-site scripter

00:03:43.220 --> 00:03:43.720 align:middle line:90%
xsser.

00:03:43.720 --> 00:03:48.680 align:middle line:90%


00:03:48.680 --> 00:03:54.500 align:middle line:84%
Some cool little
ASCII art, but it

00:03:54.500 --> 00:03:58.280 align:middle line:84%
says cross-site scripter
is an automatic framework

00:03:58.280 --> 00:04:00.890 align:middle line:84%
to detect, exploit, and
report cross-site scripting

00:04:00.890 --> 00:04:03.990 align:middle line:84%
vulnerabilities in
web-based applications.

00:04:03.990 --> 00:04:10.120 align:middle line:90%
So we can run that with -url--

00:04:10.120 --> 00:04:15.220 align:middle line:90%


00:04:15.220 --> 00:04:16.240 align:middle line:90%
two tacks.

00:04:16.240 --> 00:04:17.140 align:middle line:90%
It's right there.

00:04:17.140 --> 00:04:20.680 align:middle line:90%


00:04:20.680 --> 00:04:26.560 align:middle line:90%
--url and, quotes, http://.

00:04:26.560 --> 00:04:28.105 align:middle line:90%
We still have that guy.

00:04:28.105 --> 00:04:33.360 align:middle line:84%
I'm going to steal this
right out of the get request.

00:04:33.360 --> 00:04:37.980 align:middle line:90%


00:04:37.980 --> 00:04:39.720 align:middle line:90%
Close those parentheses.

00:04:39.720 --> 00:04:45.240 align:middle line:84%
And we need the payload,
and because this one

00:04:45.240 --> 00:04:47.430 align:middle line:84%
is passed as our
POST request, we'll

00:04:47.430 --> 00:04:50.175 align:middle line:90%
steal it right out of here.

00:04:50.175 --> 00:04:53.860 align:middle line:90%


00:04:53.860 --> 00:04:58.270 align:middle line:84%
And we have to go
back and replace what

00:04:58.270 --> 00:05:01.450 align:middle line:90%
we passed in this helloworld.

00:05:01.450 --> 00:05:05.530 align:middle line:84%
And for cross-site scripting,
you do XSS in that place.

00:05:05.530 --> 00:05:07.540 align:middle line:84%
And that's going to
represent a variable.

00:05:07.540 --> 00:05:12.130 align:middle line:84%
And the same way
that intruder, you

00:05:12.130 --> 00:05:14.950 align:middle line:84%
put that squiggly,
in some other tools,

00:05:14.950 --> 00:05:20.220 align:middle line:84%
you will put in a
variable like this.

00:05:20.220 --> 00:05:23.280 align:middle line:84%
And let's just
see what it finds.

00:05:23.280 --> 00:05:25.830 align:middle line:90%
All right, it is vulnerable.

00:05:25.830 --> 00:05:26.475 align:middle line:90%
What did it do?

00:05:26.475 --> 00:05:29.000 align:middle line:90%


00:05:29.000 --> 00:05:32.720 align:middle line:84%
Looks like it ran this
payload right there.

00:05:32.720 --> 00:05:37.900 align:middle line:90%


00:05:37.900 --> 00:05:40.820 align:middle line:84%
I'm just throwing in this hash
to see what would come up,

00:05:40.820 --> 00:05:43.280 align:middle line:90%
and it says it's vulnerable.

00:05:43.280 --> 00:05:44.300 align:middle line:90%
OK.

00:05:44.300 --> 00:05:44.900 align:middle line:90%
That's neat.

00:05:44.900 --> 00:05:52.340 align:middle line:84%
Let's try and see how
vulnerable it is, so --auto.

00:05:52.340 --> 00:05:55.940 align:middle line:84%
This is going to try a
lot of vulnerabilities

00:05:55.940 --> 00:05:57.935 align:middle line:90%
or a lot of payloads, rather.

00:05:57.935 --> 00:06:04.600 align:middle line:90%


00:06:04.600 --> 00:06:09.850 align:middle line:84%
All right, it ran
1,291 injections,

00:06:09.850 --> 00:06:11.620 align:middle line:90%
and they were all successful.

00:06:11.620 --> 00:06:15.170 align:middle line:90%
So it's very vulnerable.

00:06:15.170 --> 00:06:18.100 align:middle line:84%
It's almost like it was designed
that way so that I could

00:06:18.100 --> 00:06:20.860 align:middle line:90%
show you all the neat things.

00:06:20.860 --> 00:06:23.950 align:middle line:84%
Well, we did auto,
and that's cool.

00:06:23.950 --> 00:06:29.350 align:middle line:84%
Let's try a custom
script, custom payload.

00:06:29.350 --> 00:06:34.420 align:middle line:84%
I'm going to run
script like this.

00:06:34.420 --> 00:06:38.140 align:middle line:84%
If you do HTML and you
want to run script--

00:06:38.140 --> 00:06:41.620 align:middle line:84%
HTML scripts, you
do it like that.

00:06:41.620 --> 00:06:45.440 align:middle line:84%
And then you put whatever
you want it to do in between.

00:06:45.440 --> 00:06:49.840 align:middle line:84%
So we'll run this alert
function, alert 1.

00:06:49.840 --> 00:06:56.530 align:middle line:84%
And this is pretty elementary,
but if it works, it works.

00:06:56.530 --> 00:06:59.900 align:middle line:84%
We can do better in the
future, and we should.

00:06:59.900 --> 00:07:05.320 align:middle line:84%
You can make your
alerts or your payloads

00:07:05.320 --> 00:07:08.240 align:middle line:84%
more useful, but
for this example,

00:07:08.240 --> 00:07:09.460 align:middle line:90%
so it's easily repeatable.

00:07:09.460 --> 00:07:10.760 align:middle line:90%
We're going to go with that.

00:07:10.760 --> 00:07:13.030 align:middle line:90%
So we had intercepted.

00:07:13.030 --> 00:07:16.360 align:middle line:84%
We found that it was vulnerable,
boom, so right there.

00:07:16.360 --> 00:07:19.450 align:middle line:84%
We're going to take this
payload that it used.

00:07:19.450 --> 00:07:21.175 align:middle line:90%
A URL encoded this.

00:07:21.175 --> 00:07:23.920 align:middle line:90%
You see that?

00:07:23.920 --> 00:07:28.861 align:middle line:84%
And we're going to play
it right back in here.

00:07:28.861 --> 00:07:30.200 align:middle line:90%
You see that?

00:07:30.200 --> 00:07:30.700 align:middle line:90%
Boom.

00:07:30.700 --> 00:07:36.270 align:middle line:90%


00:07:36.270 --> 00:07:38.010 align:middle line:90%
with that.

00:07:38.010 --> 00:07:41.430 align:middle line:84%
I threw it in there
instead of the helloworld.

00:07:41.430 --> 00:07:45.150 align:middle line:84%
And now, if we forward
it, I look over here,

00:07:45.150 --> 00:07:46.740 align:middle line:90%
and we got this alert.

00:07:46.740 --> 00:07:49.530 align:middle line:90%
Window with a 1 in the middle.

00:07:49.530 --> 00:07:50.550 align:middle line:90%
Success.

00:07:50.550 --> 00:07:53.100 align:middle line:90%
Great success.

00:07:53.100 --> 00:07:54.480 align:middle line:90%
All right.

00:07:54.480 --> 00:07:59.410 align:middle line:84%
Let's try another
one, another page.

00:07:59.410 --> 00:08:02.423 align:middle line:84%
This did it through
a POST request.

00:08:02.423 --> 00:08:03.840 align:middle line:84%
Let's look at
cross-site scripting

00:08:03.840 --> 00:08:08.280 align:middle line:84%
reflected, and we'll go
with this poll question.

00:08:08.280 --> 00:08:12.570 align:middle line:90%
Yeah, yeah, just forward it on.

00:08:12.570 --> 00:08:14.740 align:middle line:90%
What was that?

00:08:14.740 --> 00:08:15.240 align:middle line:90%
All right.

00:08:15.240 --> 00:08:18.720 align:middle line:90%


00:08:18.720 --> 00:08:22.470 align:middle line:90%
We will pass just an Nmap.

00:08:22.470 --> 00:08:25.560 align:middle line:84%
I'll turn off
intercept for a second.

00:08:25.560 --> 00:08:28.405 align:middle line:90%
We send that.

00:08:28.405 --> 00:08:30.155 align:middle line:84%
It looks like something
is already caught.

00:08:30.155 --> 00:08:36.620 align:middle line:90%


00:08:36.620 --> 00:08:38.600 align:middle line:90%
Awesome.

00:08:38.600 --> 00:08:40.070 align:middle line:84%
Well, it said your
choice is Nmap.

00:08:40.070 --> 00:08:46.920 align:middle line:90%


00:08:46.920 --> 00:08:50.050 align:middle line:90%
Let's see what's going on here.

00:08:50.050 --> 00:08:52.850 align:middle line:90%
Let's actually intercept this.

00:08:52.850 --> 00:08:54.410 align:middle line:90%
Let's try it again.

00:08:54.410 --> 00:08:56.910 align:middle line:90%
What's been passed?

00:08:56.910 --> 00:08:59.840 align:middle line:84%
We've got this PHP
session showints.

00:08:59.840 --> 00:09:03.810 align:middle line:90%


00:09:03.810 --> 00:09:06.510 align:middle line:84%
And this is passing
it through a get

00:09:06.510 --> 00:09:16.180 align:middle line:84%
request with variables in
the URL and maps in there,

00:09:16.180 --> 00:09:17.970 align:middle line:90%
which is why it showed up.

00:09:17.970 --> 00:09:22.410 align:middle line:84%
All right, let's play with
this in cross-site scripter.

00:09:22.410 --> 00:09:24.195 align:middle line:90%
It's going to be very similar.

00:09:24.195 --> 00:09:29.300 align:middle line:90%


00:09:29.300 --> 00:09:35.450 align:middle line:84%
But instead of all this
payload information,

00:09:35.450 --> 00:09:38.870 align:middle line:84%
we're going to pass
it through the URL.

00:09:38.870 --> 00:09:40.310 align:middle line:90%
So it's just still a URL--

00:09:40.310 --> 00:09:44.240 align:middle line:84%
index.php, and it's
got the page here.

00:09:44.240 --> 00:09:46.340 align:middle line:90%
That's awesome.

00:09:46.340 --> 00:09:49.910 align:middle line:84%
Question mark all the
way through, awesome.

00:09:49.910 --> 00:09:52.340 align:middle line:90%
Pass it back there.

00:09:52.340 --> 00:09:54.740 align:middle line:84%
Though we need to
replace Nmap because that

00:09:54.740 --> 00:10:00.740 align:middle line:90%
is our actual variable with XSS.

00:10:00.740 --> 00:10:05.150 align:middle line:90%
See there in the bottom right?

00:10:05.150 --> 00:10:05.870 align:middle line:90%
All right.

00:10:05.870 --> 00:10:06.710 align:middle line:90%
Replace that.

00:10:06.710 --> 00:10:07.790 align:middle line:90%
Let's get quotes.

00:10:07.790 --> 00:10:10.460 align:middle line:90%
Let's see if it's vulnerable.

00:10:10.460 --> 00:10:13.250 align:middle line:90%
And it looks like it is.

00:10:13.250 --> 00:10:14.990 align:middle line:90%
It found one.

00:10:14.990 --> 00:10:16.460 align:middle line:90%
It passed it.

00:10:16.460 --> 00:10:17.570 align:middle line:90%
See how it did that.

00:10:17.570 --> 00:10:18.290 align:middle line:90%
Very neat.

00:10:18.290 --> 00:10:21.995 align:middle line:90%


00:10:21.995 --> 00:10:24.740 align:middle line:84%
Let's see if we can
do a custom again.

00:10:24.740 --> 00:10:36.010 align:middle line:84%
Fp and script and then
alert 1, and close

00:10:36.010 --> 00:10:40.020 align:middle line:84%
the script and some HTML
for you right there.

00:10:40.020 --> 00:10:44.370 align:middle line:84%
And found-- looks
like it does work.

00:10:44.370 --> 00:10:46.460 align:middle line:84%
It's putting it
now in the payload,

00:10:46.460 --> 00:10:48.880 align:middle line:84%
and we can just use
this guy right here.

00:10:48.880 --> 00:10:52.190 align:middle line:90%


00:10:52.190 --> 00:10:53.060 align:middle line:90%
I'll just copy that.

00:10:53.060 --> 00:10:58.700 align:middle line:90%


00:10:58.700 --> 00:11:01.280 align:middle line:90%
Pump that into Burp.

00:11:01.280 --> 00:11:08.600 align:middle line:90%
Replace it in our request.

00:11:08.600 --> 00:11:13.083 align:middle line:84%
So now, we've got that script
URL encoded right there.

00:11:13.083 --> 00:11:14.000 align:middle line:90%
Let's see if it works.

00:11:14.000 --> 00:11:16.670 align:middle line:90%
We'll forward it on.

00:11:16.670 --> 00:11:20.190 align:middle line:84%
And hey, we get
an alert with a 1.

00:11:20.190 --> 00:11:20.690 align:middle line:90%
Huzzah.

00:11:20.690 --> 00:11:23.600 align:middle line:90%


00:11:23.600 --> 00:11:25.730 align:middle line:90%
And it keeps opening him.

00:11:25.730 --> 00:11:27.530 align:middle line:90%
Very interesting.

00:11:27.530 --> 00:11:33.710 align:middle line:84%
Well, now, alerts with a 1
are not all that exciting.

00:11:33.710 --> 00:11:37.040 align:middle line:84%
And that's one of
the classic faux pas

00:11:37.040 --> 00:11:39.380 align:middle line:84%
when shown off
cross-site scripting.

00:11:39.380 --> 00:11:41.960 align:middle line:84%
It's like, OK, it's
neat that it did that.

00:11:41.960 --> 00:11:45.140 align:middle line:84%
Now, what's the
applicability to me?

00:11:45.140 --> 00:11:48.290 align:middle line:84%
We're going to get into that
in the web app penetration

00:11:48.290 --> 00:11:51.500 align:middle line:90%
testing for pathway.

00:11:51.500 --> 00:11:53.690 align:middle line:84%
This course in pen
testing student

00:11:53.690 --> 00:11:56.500 align:middle line:84%
is just to show
you a little bit.

00:11:56.500 --> 00:11:58.960 align:middle line:84%
Get you a taste of
the web app portion

00:11:58.960 --> 00:12:02.260 align:middle line:84%
so that you can be at least
an effective junior pen tester

00:12:02.260 --> 00:12:03.830 align:middle line:90%
in the big scheme of things.

00:12:03.830 --> 00:12:06.340 align:middle line:84%
If you are doing
lots of web pen--

00:12:06.340 --> 00:12:10.660 align:middle line:84%
web app pen tests, then
I suggest you dive deep

00:12:10.660 --> 00:12:11.680 align:middle line:90%
into some of that.

00:12:11.680 --> 00:12:15.320 align:middle line:84%
And this is, again,
a taste of that.

00:12:15.320 --> 00:12:20.260 align:middle line:84%
So there's a whole other
course, and I will probably

00:12:20.260 --> 00:12:23.030 align:middle line:90%
see you in that course.

00:12:23.030 --> 00:12:28.290 align:middle line:84%
And let's finish out some
more of these labs here now.

00:12:28.290 --> 00:12:29.000 align:middle line:90%