WEBVTT

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


00:00:04.840 --> 00:00:08.228 align:middle line:90%
[MUSIC PLAYING]

00:00:08.228 --> 00:00:10.170 align:middle line:90%


00:00:10.170 --> 00:00:15.300 align:middle line:84%
Another great web app pen
testing tool is Nikto.

00:00:15.300 --> 00:00:17.820 align:middle line:84%
It's going to do some
automated scans for us.

00:00:17.820 --> 00:00:19.710 align:middle line:90%
Again, make sure it's in scope.

00:00:19.710 --> 00:00:22.680 align:middle line:84%
Don't rely on this as your
end-all be-all for web app pen

00:00:22.680 --> 00:00:23.350 align:middle line:90%
testing.

00:00:23.350 --> 00:00:25.530 align:middle line:90%
But it is a great way to start.

00:00:25.530 --> 00:00:29.790 align:middle line:84%
Let's jump into the lab
environment to play with it.

00:00:29.790 --> 00:00:35.005 align:middle line:90%


00:00:35.005 --> 00:00:36.670 align:middle line:90%
It will be in the terminal.

00:00:36.670 --> 00:00:39.280 align:middle line:90%
Let's check our IP address.

00:00:39.280 --> 00:00:41.590 align:middle line:90%
We have the network here.

00:00:41.590 --> 00:00:49.300 align:middle line:84%
We can ping the dot
3, and it is up.

00:00:49.300 --> 00:00:55.540 align:middle line:84%
And we can run a quick
Nmap scan of the dot 3.

00:00:55.540 --> 00:00:57.175 align:middle line:90%
We see that port 80 is open.

00:00:57.175 --> 00:01:01.040 align:middle line:90%


00:01:01.040 --> 00:01:03.410 align:middle line:90%
Well, let's take a look.

00:01:03.410 --> 00:01:08.390 align:middle line:84%
We're going to find that it
is the OWASP Mutillidae, which

00:01:08.390 --> 00:01:11.240 align:middle line:84%
while it's a free
tool, it works great,

00:01:11.240 --> 00:01:15.650 align:middle line:84%
and it will show all the things
that we need to show off here.

00:01:15.650 --> 00:01:18.290 align:middle line:84%
You could install this
locally on your own machine

00:01:18.290 --> 00:01:21.890 align:middle line:84%
if you want it on
your own VM even

00:01:21.890 --> 00:01:23.840 align:middle line:90%
and run attacks against it.

00:01:23.840 --> 00:01:26.977 align:middle line:84%
We're going to utilize it
because it's open source,

00:01:26.977 --> 00:01:27.560 align:middle line:90%
and it's free.

00:01:27.560 --> 00:01:28.980 align:middle line:90%
And it works.

00:01:28.980 --> 00:01:30.395 align:middle line:90%
Shows exactly what we want.

00:01:30.395 --> 00:01:33.500 align:middle line:90%


00:01:33.500 --> 00:01:37.120 align:middle line:84%
So we're going to start off
by using the Nikto tool.

00:01:37.120 --> 00:01:45.080 align:middle line:84%
And I will just run Nikto
and without any arguments.

00:01:45.080 --> 00:01:48.180 align:middle line:90%


00:01:48.180 --> 00:01:51.330 align:middle line:84%
Nikto just shows us the version,
and there's an error-- no

00:01:51.330 --> 00:01:52.890 align:middle line:90%
host or URL.

00:01:52.890 --> 00:01:53.820 align:middle line:90%
That's fine.

00:01:53.820 --> 00:01:56.340 align:middle line:84%
I would just want to show
you what options are in here.

00:01:56.340 --> 00:02:00.300 align:middle line:84%
If we pick a host, it'll
go after that host URL.

00:02:00.300 --> 00:02:02.910 align:middle line:84%
There's even some
tuning that can be done.

00:02:02.910 --> 00:02:08.280 align:middle line:84%
And it says use tack capital
H for the full help text.

00:02:08.280 --> 00:02:11.380 align:middle line:90%
So let's run that.

00:02:11.380 --> 00:02:14.010 align:middle line:84%
And you see, there's even
more details in here.

00:02:14.010 --> 00:02:22.080 align:middle line:90%


00:02:22.080 --> 00:02:24.180 align:middle line:84%
You see, there's
evasion possibilities.

00:02:24.180 --> 00:02:28.260 align:middle line:84%
There's some display
options, formatting options.

00:02:28.260 --> 00:02:35.910 align:middle line:84%
You can even change up what
you want your output to say--

00:02:35.910 --> 00:02:41.640 align:middle line:84%
if you want to ignore
these 404 codes.

00:02:41.640 --> 00:02:45.020 align:middle line:90%
There's a lot in there.

00:02:45.020 --> 00:02:47.820 align:middle line:90%
Tuning has some specific things.

00:02:47.820 --> 00:02:53.420 align:middle line:84%
For example, there is a
local file inclusion that

00:02:53.420 --> 00:02:55.970 align:middle line:90%
can be included-- file upload.

00:02:55.970 --> 00:02:59.030 align:middle line:90%
There's a lot.

00:02:59.030 --> 00:03:02.120 align:middle line:84%
Remote file retrieval,
that could be neat.

00:03:02.120 --> 00:03:05.880 align:middle line:84%
We will investigate a few
of those in a little bit.

00:03:05.880 --> 00:03:12.320 align:middle line:84%
Let's start off just by running
Nikto against our target.

00:03:12.320 --> 00:03:14.050 align:middle line:90%
And we do that with an HTTP.

00:03:14.050 --> 00:03:17.880 align:middle line:90%


00:03:17.880 --> 00:03:21.915 align:middle line:84%
So tack host or tack
H will do the job.

00:03:21.915 --> 00:03:25.350 align:middle line:90%


00:03:25.350 --> 00:03:29.830 align:middle line:84%
And throw our IP address
in there from before.

00:03:29.830 --> 00:03:32.820 align:middle line:84%
So quick thing as we get
back, it's an Apache server.

00:03:32.820 --> 00:03:34.750 align:middle line:84%
We didn't have to run
a whole server scan.

00:03:34.750 --> 00:03:37.450 align:middle line:90%
Nikto handled that for us.

00:03:37.450 --> 00:03:39.465 align:middle line:84%
It gets the port based
on the IP address.

00:03:39.465 --> 00:03:43.140 align:middle line:90%


00:03:43.140 --> 00:03:45.600 align:middle line:84%
Got some low-hanging
fruit in there.

00:03:45.600 --> 00:03:48.990 align:middle line:84%
The version of Ubuntu,
this might be vulnerable.

00:03:48.990 --> 00:03:52.950 align:middle line:84%
We've got some cookies from the
PHP session that were in there.

00:03:52.950 --> 00:04:00.370 align:middle line:90%


00:04:00.370 --> 00:04:01.820 align:middle line:90%
It's a lot of output.

00:04:01.820 --> 00:04:04.952 align:middle line:90%


00:04:04.952 --> 00:04:06.535 align:middle line:84%
They'll make it
little easier to read.

00:04:06.535 --> 00:04:11.380 align:middle line:90%


00:04:11.380 --> 00:04:13.620 align:middle line:90%
But in here, we have got--

00:04:13.620 --> 00:04:16.290 align:middle line:84%
it found data, it
found includes,

00:04:16.290 --> 00:04:17.940 align:middle line:90%
it found the passwords.

00:04:17.940 --> 00:04:21.550 align:middle line:84%
We've attacked this web
app before in other labs,

00:04:21.550 --> 00:04:24.540 align:middle line:84%
so that shouldn't
be too surprising.

00:04:24.540 --> 00:04:28.320 align:middle line:84%
There's also PHP info
which does a test script.

00:04:28.320 --> 00:04:35.530 align:middle line:90%


00:04:35.530 --> 00:04:38.620 align:middle line:90%
The phpmyadmin is in there.

00:04:38.620 --> 00:04:39.730 align:middle line:90%
That's dangerous.

00:04:39.730 --> 00:04:41.965 align:middle line:84%
That could give us
a lot of access.

00:04:41.965 --> 00:04:52.990 align:middle line:90%


00:04:52.990 --> 00:04:55.630 align:middle line:90%
Did I see a robots.txt is in.

00:04:55.630 --> 00:05:00.820 align:middle line:84%
Here it's got eight entries
that could be useful.

00:05:00.820 --> 00:05:06.830 align:middle line:84%
We've also got-- right here,
there's this vulnerable file

00:05:06.830 --> 00:05:08.750 align:middle line:90%
transversal--

00:05:08.750 --> 00:05:10.160 align:middle line:90%
file traversal.

00:05:10.160 --> 00:05:14.090 align:middle line:84%
Sorry, I added an N. If
you had an index.php.

00:05:14.090 --> 00:05:19.005 align:middle line:84%
And then page equals
these dot dot forward

00:05:19.005 --> 00:05:20.785 align:middle line:90%
slash dot dot forward slash.

00:05:20.785 --> 00:05:26.950 align:middle line:84%
This Is directory traversal
eventually getting back

00:05:26.950 --> 00:05:29.380 align:middle line:90%
to root and then etc password.

00:05:29.380 --> 00:05:33.040 align:middle line:84%
So we will play with that a
little bit and double check

00:05:33.040 --> 00:05:35.842 align:middle line:90%
that we can do what it says.

00:05:35.842 --> 00:05:36.800 align:middle line:90%
There's a lot in there.

00:05:36.800 --> 00:05:40.700 align:middle line:90%


00:05:40.700 --> 00:05:43.250 align:middle line:90%
That's a very useful skin.

00:05:43.250 --> 00:05:47.300 align:middle line:84%
We were able to see, the
target server and the back end.

00:05:47.300 --> 00:05:50.400 align:middle line:90%
A lot included in there.

00:05:50.400 --> 00:05:54.880 align:middle line:84%
Well let's check out that
local file inclusion.

00:05:54.880 --> 00:05:59.090 align:middle line:84%
Mutillidae is neat
in that we can

00:05:59.090 --> 00:06:04.590 align:middle line:84%
get a 2017, A5,
broken access control.

00:06:04.590 --> 00:06:10.100 align:middle line:84%
Go to this insecure directory
object for reference, IDOR,

00:06:10.100 --> 00:06:12.290 align:middle line:90%
and then local file inclusion.

00:06:12.290 --> 00:06:15.410 align:middle line:84%
And it brings up a page that
is vulnerable to local file

00:06:15.410 --> 00:06:18.710 align:middle line:84%
inclusion on purpose, so
we can test things out,

00:06:18.710 --> 00:06:19.880 align:middle line:90%
see what it looks like.

00:06:19.880 --> 00:06:24.190 align:middle line:90%


00:06:24.190 --> 00:06:29.020 align:middle line:84%
And it's this
index.php page equals.

00:06:29.020 --> 00:06:32.485 align:middle line:84%
And we could grab
the exact code.

00:06:32.485 --> 00:06:35.230 align:middle line:90%


00:06:35.230 --> 00:06:37.120 align:middle line:84%
Or let's just grab
this whole URL.

00:06:37.120 --> 00:06:47.500 align:middle line:90%


00:06:47.500 --> 00:06:50.570 align:middle line:84%
What's neat about Nikto
is we can scan that.

00:06:50.570 --> 00:06:54.310 align:middle line:90%


00:06:54.310 --> 00:06:56.970 align:middle line:90%
So we have the full URL.

00:06:56.970 --> 00:07:04.960 align:middle line:84%
And we'll just do tuning,
tack tuning 5 and tack display

00:07:04.960 --> 00:07:07.380 align:middle line:90%
and V for verbose.

00:07:07.380 --> 00:07:14.640 align:middle line:84%
So we'll have Nikto test
it for final inclusion.

00:07:14.640 --> 00:07:17.625 align:middle line:84%
And we get a lot of
202s or a lot of 200s.

00:07:17.625 --> 00:07:22.090 align:middle line:90%


00:07:22.090 --> 00:07:23.860 align:middle line:90%
Sounds very, very vulnerable.

00:07:23.860 --> 00:07:28.960 align:middle line:90%


00:07:28.960 --> 00:07:30.700 align:middle line:90%
Yeah, a lot of these hit.

00:07:30.700 --> 00:07:32.110 align:middle line:90%
It's a lot of 200 gets.

00:07:32.110 --> 00:07:37.260 align:middle line:90%


00:07:37.260 --> 00:07:39.840 align:middle line:84%
There's etc password
and a lot of things

00:07:39.840 --> 00:07:42.310 align:middle line:84%
afterwards that
all seem to work.

00:07:42.310 --> 00:07:42.810 align:middle line:90%
All right.

00:07:42.810 --> 00:07:46.300 align:middle line:90%
Well, let's actually try that.

00:07:46.300 --> 00:07:47.865 align:middle line:90%
Let's look at what happens.

00:07:47.865 --> 00:07:54.380 align:middle line:90%


00:07:54.380 --> 00:08:11.060 align:middle line:84%
If we do a dot dot forward
slash and etc password.

00:08:11.060 --> 00:08:15.230 align:middle line:84%
Well, we get the outcome and
the output of etc password

00:08:15.230 --> 00:08:17.940 align:middle line:90%
right here in our browser.

00:08:17.940 --> 00:08:24.050 align:middle line:84%
So this is on the web server
that we are attacking.

00:08:24.050 --> 00:08:27.950 align:middle line:90%
On the dot 3, we included--

00:08:27.950 --> 00:08:32.600 align:middle line:84%
because page to look up and
we traversed back to root.

00:08:32.600 --> 00:08:35.120 align:middle line:84%
This just ensured that
we made it back to root.

00:08:35.120 --> 00:08:37.280 align:middle line:84%
And then from root,
got etc password

00:08:37.280 --> 00:08:41.059 align:middle line:84%
and displayed all the
output from there.

00:08:41.059 --> 00:08:42.530 align:middle line:90%
Pretty.

00:08:42.530 --> 00:08:43.520 align:middle line:90%
That's not good.

00:08:43.520 --> 00:08:45.080 align:middle line:84%
You don't want that
in your web app.

00:08:45.080 --> 00:08:52.190 align:middle line:90%


00:08:52.190 --> 00:08:54.620 align:middle line:84%
Another neat thing that
we can do with all this

00:08:54.620 --> 00:08:57.320 align:middle line:90%
is we could output it.

00:08:57.320 --> 00:09:01.140 align:middle line:84%
This was a lot to read,
and it's not fun to read.

00:09:01.140 --> 00:09:03.180 align:middle line:90%
So let's change that.

00:09:03.180 --> 00:09:07.100 align:middle line:84%
Let's make a nice
output, a report for us.

00:09:07.100 --> 00:09:11.960 align:middle line:84%
We'll do tack O, and we'll
call it Nikto.html and tack

00:09:11.960 --> 00:09:14.870 align:middle line:90%
format and HTM.

00:09:14.870 --> 00:09:17.610 align:middle line:90%


00:09:17.610 --> 00:09:20.800 align:middle line:90%
So it runs all of that.

00:09:20.800 --> 00:09:22.240 align:middle line:90%
One more time.

00:09:22.240 --> 00:09:23.620 align:middle line:90%
Could've left off the verbose.

00:09:23.620 --> 00:09:26.200 align:middle line:90%


00:09:26.200 --> 00:09:29.860 align:middle line:84%
And then at last, we see,
we've got Nikto.html.

00:09:29.860 --> 00:09:33.880 align:middle line:90%


00:09:33.880 --> 00:09:36.415 align:middle line:84%
And we could just open
up our File Explorer.

00:09:36.415 --> 00:09:40.450 align:middle line:90%


00:09:40.450 --> 00:09:42.130 align:middle line:84%
And I will click
New to that HTML,

00:09:42.130 --> 00:09:44.080 align:middle line:90%
and it opens it in the browser.

00:09:44.080 --> 00:09:46.990 align:middle line:84%
Now, we've got a nice
little GUI of that output.

00:09:46.990 --> 00:09:52.180 align:middle line:90%


00:09:52.180 --> 00:09:54.720 align:middle line:84%
So it tested index.php
like we asked.

00:09:54.720 --> 00:09:57.450 align:middle line:90%


00:09:57.450 --> 00:10:00.240 align:middle line:84%
And it's showing all
the things that it tried

00:10:00.240 --> 00:10:02.490 align:middle line:90%
and what it got back.

00:10:02.490 --> 00:10:08.570 align:middle line:84%
Eventually, this etc
password returned bad stuff.

00:10:08.570 --> 00:10:10.740 align:middle line:90%
And it worked for us.

00:10:10.740 --> 00:10:11.540 align:middle line:90%
Can we look at it?

00:10:11.540 --> 00:10:11.870 align:middle line:90%
Boom.

00:10:11.870 --> 00:10:12.410 align:middle line:90%
It works.

00:10:12.410 --> 00:10:17.520 align:middle line:90%


00:10:17.520 --> 00:10:20.070 align:middle line:84%
We can even try out a
few of these other ones

00:10:20.070 --> 00:10:22.850 align:middle line:90%
and see what they return.

00:10:22.850 --> 00:10:24.980 align:middle line:84%
I feel like it's not
supposed to look like that.

00:10:24.980 --> 00:10:28.640 align:middle line:90%


00:10:28.640 --> 00:10:31.790 align:middle line:84%
And that's really the
power of Nikto right there.

00:10:31.790 --> 00:10:35.030 align:middle line:90%


00:10:35.030 --> 00:10:37.240 align:middle line:84%
So I hope you got
a bit out of this.

00:10:37.240 --> 00:10:41.140 align:middle line:84%
Showing you another tool
at including your toolbox.

00:10:41.140 --> 00:10:43.030 align:middle line:84%
More things that
you can utilize,

00:10:43.030 --> 00:10:46.930 align:middle line:84%
ways you can find
vulnerabilities and bugs in web

00:10:46.930 --> 00:10:51.730 align:middle line:84%
apps, and some nice ways
of getting your output

00:10:51.730 --> 00:10:54.130 align:middle line:84%
reports, so you can
go back through later

00:10:54.130 --> 00:10:57.430 align:middle line:84%
after your assessment
to then build up

00:10:57.430 --> 00:10:58.870 align:middle line:90%
your report to your client.

00:10:58.870 --> 00:11:01.870 align:middle line:90%


00:11:01.870 --> 00:11:04.390 align:middle line:84%
With that, we're going
to change a little bit

00:11:04.390 --> 00:11:07.240 align:middle line:84%
and actually do some
active attacks instead

00:11:07.240 --> 00:11:09.580 align:middle line:84%
of running scans
or utilizing tools

00:11:09.580 --> 00:11:11.260 align:middle line:90%
that do things automatically.

00:11:11.260 --> 00:11:13.660 align:middle line:84%
We're going to do
some attacks, so we'll

00:11:13.660 --> 00:11:15.780 align:middle line:90%
see you in the next lab.

00:11:15.780 --> 00:11:17.000 align:middle line:90%