WEBVTT

00:01.770 --> 00:10.170
Welcome to the video using nikto to find web based vulnerabilities in this video we will use a tool

00:10.170 --> 00:15.060
built it actually called nikto to start testing web sites for vulnerabilities.

00:16.050 --> 00:22.290
To our nikto scans to search for only certain risks in order to not overwhelm our target with requests

00:23.040 --> 00:29.250
and we'll put our ethical hacking head on and see how a vulnerability discovered by nikto could be used

00:29.250 --> 00:31.350
and abused in the real world.

00:32.290 --> 00:34.340
As we get closer to the end of this course.

00:34.360 --> 00:40.060
It's been fun to start taking what we've learned about network scanning and begin shifting the focus

00:40.120 --> 00:46.080
more to how an attacker can use this scan data to probe systems for vulnerabilities.

00:47.070 --> 00:52.500
And in this video I want to take things one step further and show you how a vulnerability can actually

00:52.500 --> 00:55.290
be leveraged to gain a foothold on a system.

00:56.600 --> 01:01.730
First though let's take a look at a tool that's built right into Cauley called nikto.

01:02.000 --> 01:09.990
If you want to get some basic information about nikto simply type it into the command line with no arguments.

01:10.010 --> 01:17.720
Now my personal preference whenever I'm running a tool is to make sure it's completely up to date.

01:17.740 --> 01:22.270
I've run into many situations where I was banging my head against a wall because I couldn't get a tool

01:22.270 --> 01:28.590
to work only to find out that I was running into a bug that was fixed in the current version in the

01:28.590 --> 01:36.310
case of nikto that can be done by running nikto space tech update and hitting enter.

01:36.490 --> 01:43.190
Interestingly nikto tells us right here that we should be using the version of the tool from get Let's

01:43.190 --> 01:51.590
hop on google real quick and I'm going to search for update nikto Kalli and right here from the nikto

01:51.590 --> 01:52.870
tool home page.

01:52.880 --> 01:59.470
It says the version we should be using is from get up a little further down in these instructions.

01:59.470 --> 02:01.620
It gives us the commands we need.

02:01.900 --> 02:08.020
So I'm going to copy those and paste them into a terminal and I'm going to modify my command just a

02:08.020 --> 02:14.160
little bit so that nikto gets downloaded to a folder called slash Opt. slash nikto to

02:20.040 --> 02:21.060
inside that folder.

02:21.060 --> 02:23.920
I don't see a nikto script that I can run.

02:23.970 --> 02:33.490
So let's go into the program folder and boom there's nikto doppio And just for future reference that

02:33.520 --> 02:40.000
nikto Web site we were just on says that if we want to check for updates to the tool in the future we

02:40.000 --> 02:48.600
can just do a get space pull from a directory within the repo so see here that I could do a poll from

02:48.600 --> 02:56.690
our current directory or even one folder back.

02:56.710 --> 03:04.000
OK so we've got the latest nikto and we see that by running the command itself we get a brief summary

03:04.000 --> 03:05.640
of commands and what they do.

03:08.540 --> 03:14.500
But we can also do a nikto tech capital H to get really detailed help.

03:14.650 --> 03:24.310
We might want to do a pipe more here so we can view the output one screen at a time.

03:24.440 --> 03:29.920
All right so what the heck let's just give this a quick shot and do the most basic scan possible.

03:30.350 --> 03:33.450
I'm going to type nikto space Takht H.

03:33.710 --> 03:37.960
Plus my default gateway which will be the target of this scam.

03:43.960 --> 03:47.110
So as you can see nothing too mind blowing here.

03:47.320 --> 03:51.800
But we do get some basic information about the technology running on the server.

03:52.270 --> 03:58.820
In this case like HEG EPD and a few more bits of information about how the server is configured.

03:59.070 --> 04:04.720
But what we don't really see here is much detail as far as the kinds of tests nikto actually performed.

04:05.780 --> 04:15.140
If we go back to the nikto tech capital H pipe more one more time we can see that the TAC display flag

04:15.230 --> 04:17.630
gives us more options.

04:17.700 --> 04:24.060
So as a quick example if we wanted to go really nuts with this detailed logging we could add the Takk

04:24.120 --> 04:33.590
display capital V flag to the end of the scan command that's going to be a little hard to sift through.

04:33.670 --> 04:41.080
So we might want to pick a slightly less chatty display output or we can log the output to a file which

04:41.080 --> 04:42.350
we'll talk about in just a moment

04:45.580 --> 04:47.820
OK going back into the Help menu again.

04:47.880 --> 04:53.350
There's another option that will help refine your scan and that is the tuning option.

04:54.600 --> 05:04.130
If we wanted to for example just do injection tests on our target we could add TAC capital-T space for

05:04.130 --> 05:05.320
nine.

05:05.570 --> 05:13.820
The four is for injection tests such as cross-site scripting and the Nine is for sequel injection.

05:13.920 --> 05:21.570
Just keep in mind that if you invoke this tack t flag then only the types of tests you specify after

05:21.570 --> 05:29.140
the TAC t will be executed as I mentioned earlier if you're going to gather this much data about your

05:29.140 --> 05:33.210
scan you probably want to save it to a file in case you need it later.

05:33.880 --> 05:42.240
So let's go back to the help menu one more time and look at an option called Ptak output the help output

05:42.240 --> 05:50.360
doesn't go into too much detail but nikto does support a variety of output formats including CXXVI HVM

05:50.410 --> 05:56.900
Mal ex-MIL NBC and even exporting into the metal plate framework.

05:57.870 --> 06:04.930
So if I want to take that last scan I did and save the are put to him now I can add a tack.

06:04.980 --> 06:05.760
Oh.

06:06.240 --> 06:10.470
And then an H T.M. file name.

06:10.500 --> 06:16.610
Now once this scan is done I'll do a quick shortcut and type Firefox space.

06:16.770 --> 06:24.630
The name of my scan file obviously you could just open this file directly from Firefox but we're learning

06:24.630 --> 06:27.990
as many shortcuts as we can in this course to maximize our time.

06:27.990 --> 06:28.450
Right.

06:29.920 --> 06:35.610
And here's a nice HDMI output of the scan and the findings now.

06:35.620 --> 06:42.130
Notice that this h tim file has the high level findings of the scan but does not include that verbose

06:42.130 --> 06:49.200
logging that I specified with the text display space setting.

06:49.210 --> 06:56.380
So what I've done in the past to get around that is run the same command again and then add a space

06:56.380 --> 07:01.200
greater sign Plus the filename.

07:01.220 --> 07:08.060
Now this time when the scanner finishes we've got this detailed log log file that we can sift through

07:08.060 --> 07:10.360
if necessary.

07:10.460 --> 07:16.270
And then we've still got the HVM file with the higher level details of the scan as well.

07:17.970 --> 07:24.390
For a lot more details on nikto and all the various command line options just do a quick Google search

07:24.480 --> 07:31.570
for nikto help personally I found these first two sites to be very helpful.

07:33.630 --> 07:39.390
OK let's close with something kind of fun and see how a nikto scan can actually lead you in the direction

07:39.420 --> 07:41.640
of fully compromising a system.

07:42.780 --> 07:47.650
What I've done is installed a machine on my network that is vulnerable by design.

07:48.150 --> 07:55.700
And I got it from a site called Volna hub dot com Volna is a fantastic resource.

07:55.740 --> 08:01.220
If you want to practice your network scanning and penetration testing skills in a safe and legal way

08:02.520 --> 08:06.250
essentially what you do is you download these V.M. to your machine.

08:06.480 --> 08:12.240
You load them up in something like VM Ware player or virtual box and then you can bang away on them

08:12.300 --> 08:14.300
from the comfort of your own network.

08:14.670 --> 08:20.880
While we're here on vuln hub dotcom please do allow me just a little bit of shameless self-promotion.

08:20.880 --> 08:27.270
I've built a couple of machines and submitted them to vuln hub and they're named after a few of my favorite

08:27.360 --> 08:28.470
all time movies.

08:29.690 --> 08:33.470
Billy Madison which we can get to via the search box here.

08:34.320 --> 08:41.330
We'll pit you against the evil Eric Gordon as he tries to stop Billy from graduating high school this

08:41.330 --> 08:47.240
VM will have you cleaning a machine of some malicious operations and hopefully get a critical assignment

08:47.350 --> 08:54.670
recovered so Billy can graduate high school the other one I built is called Tommy Boy and that will

08:54.670 --> 09:00.790
put you in the hot seat as you attempt to recover a downed web server so that Calahan auto can get back

09:00.790 --> 09:06.590
in business and start selling brake pads again regardless of the VMs you choose.

09:06.670 --> 09:09.190
All of them are free so why not try.

09:09.190 --> 09:10.710
I'm all right.

09:10.960 --> 09:15.230
Anyway the one will focus on for this demo is called pluck.

09:15.250 --> 09:19.110
Now I have already downloaded this into my network and I know it's IP.

09:19.450 --> 09:26.100
So let's start with a quick scan of the device to understand what ports and services are open.

09:26.110 --> 09:34.260
I'm going to do an end map plus tack small s and then capital U and capital T.

09:34.580 --> 09:41.770
And this is going to scan both TCAP and UDP ports and because UDP scans can take a while for the sake

09:41.770 --> 09:51.190
of this Demel I'm going to use the tac tac top TAC ports command to limit the scan to 100 ports and

09:51.190 --> 09:56.610
I'll add TAC V just for the fun of it to gather some more verbose output.

09:56.800 --> 09:58.770
So we've got some interesting ports here.

09:58.810 --> 10:03.490
S-sh h TTP and my sequel.

10:03.490 --> 10:10.450
So let's fire up nikto and just do a basic scan on it with the TAC h command plus the IP

10:14.540 --> 10:17.470
this output looks much more interesting.

10:17.870 --> 10:19.300
Take a look at this.

10:19.400 --> 10:27.380
It appears that this site has a file traversal vulnerability which allows an attacker to view any file

10:27.470 --> 10:28.970
on the host.

10:28.970 --> 10:33.530
What's really nice is they even give us an example page to try.

10:33.550 --> 10:41.670
So let's open up Firefox and then I'm going to go to the web interface of the box and from there I will

10:41.670 --> 10:47.250
append the string we copied out of nikto look at that.

10:47.260 --> 10:55.940
Yikes what we're seeing is the slash ETSI slash password file which is traditionally used to keep track

10:56.000 --> 10:59.300
of every registered user on this system.

10:59.840 --> 11:08.020
So this potentially tells us which users we might want to brute force via S-sh for example or in the

11:08.020 --> 11:11.670
case of this box it reveals that there is a backup user here.

11:11.980 --> 11:14.470
That is just there to make backups easier.

11:14.470 --> 11:21.760
And looking further there is a specific file on the box that looks very interesting and thanks to this

11:21.760 --> 11:27.210
vulnerability we can just pull that file up directly from the web browser.

11:27.220 --> 11:30.780
All we have to do is change the URL path like so

11:33.630 --> 11:35.010
as cool stuff right.

11:35.800 --> 11:37.470
So where do we go from here.

11:37.720 --> 11:41.580
Well unfortunately that would be a completely separate course altogether.

11:41.770 --> 11:47.830
But I hope this little demonstration will whet your appetite for using your network scanning skills

11:48.250 --> 11:54.220
to learn more about a system and then begin to see it from an attacker's perspective so that you better

11:54.220 --> 11:59.390
understand how to attack and defend a network in our next video.

11:59.390 --> 12:05.680
We'll look at some ways we can probe deeper into Web sites to discover hidden files and folders.
