WEBVTT

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


00:00:10.080 --> 00:00:11.610 align:middle line:90%
Fixing exploits.

00:00:11.610 --> 00:00:13.590 align:middle line:84%
In this video, we're
going to be taking a look

00:00:13.590 --> 00:00:18.180 align:middle line:84%
at the process of identifying
a vulnerability on a target

00:00:18.180 --> 00:00:22.170 align:middle line:84%
system or on a service that is
currently running on a target

00:00:22.170 --> 00:00:26.790 align:middle line:84%
system, how to utilize such
exploit to essentially find

00:00:26.790 --> 00:00:28.830 align:middle line:84%
appropriate exploit
code that can be used

00:00:28.830 --> 00:00:30.450 align:middle line:90%
to exploit the vulnerability.

00:00:30.450 --> 00:00:33.640 align:middle line:84%
And more specifically
or most importantly,

00:00:33.640 --> 00:00:36.690 align:middle line:84%
we're going to be taking a look
at how to fix that exploit code

00:00:36.690 --> 00:00:38.280 align:middle line:90%
to ensure that it runs.

00:00:38.280 --> 00:00:40.350 align:middle line:84%
And I'll actually take
you through the process

00:00:40.350 --> 00:00:45.160 align:middle line:84%
of how to read and analyze what
a particular exploit is doing.

00:00:45.160 --> 00:00:47.970 align:middle line:84%
So immediately, we'll just
dive straight into it.

00:00:47.970 --> 00:00:51.900 align:middle line:84%
This particular video has a
lab environment attached to it

00:00:51.900 --> 00:00:54.420 align:middle line:84%
that will be used to showcase
this entire technique,

00:00:54.420 --> 00:00:57.990 align:middle line:84%
so you'll essentially see
the synthesis of everything

00:00:57.990 --> 00:01:00.630 align:middle line:84%
that we've learned so far
and how it essentially

00:01:00.630 --> 00:01:03.480 align:middle line:84%
comes into play to the
point of exploitation

00:01:03.480 --> 00:01:05.770 align:middle line:84%
or gaining access
to a target system.

00:01:05.770 --> 00:01:06.270 align:middle line:90%
All right?

00:01:06.270 --> 00:01:08.550 align:middle line:84%
So I'll see you within
the lab environment.

00:01:08.550 --> 00:01:11.430 align:middle line:90%


00:01:11.430 --> 00:01:14.130 align:middle line:84%
All right, so I'm back
within the lab environment.

00:01:14.130 --> 00:01:17.250 align:middle line:84%
And you will be provided
with the target IP

00:01:17.250 --> 00:01:19.830 align:middle line:84%
address of the system that
we will be gaining access

00:01:19.830 --> 00:01:21.450 align:middle line:90%
to or exploiting.

00:01:21.450 --> 00:01:23.950 align:middle line:84%
And of course, in your case,
it's going to be different.

00:01:23.950 --> 00:01:26.830 align:middle line:84%
So our objective is
to first and foremost,

00:01:26.830 --> 00:01:29.340 align:middle line:84%
identify the vulnerable
service that's

00:01:29.340 --> 00:01:31.710 align:middle line:90%
running on the target system.

00:01:31.710 --> 00:01:34.140 align:middle line:84%
And then furthermore,
we need to identify

00:01:34.140 --> 00:01:36.240 align:middle line:84%
a relevant exploit
that can be used

00:01:36.240 --> 00:01:38.160 align:middle line:90%
to exploit this vulnerability.

00:01:38.160 --> 00:01:40.350 align:middle line:84%
And of course, we're going
to be doing this manually

00:01:40.350 --> 00:01:42.990 align:middle line:90%
with ExploitDB exploits.

00:01:42.990 --> 00:01:46.170 align:middle line:84%
Once we've obtained or
identified the exploit

00:01:46.170 --> 00:01:50.010 align:middle line:84%
that we're going to use, we then
need to copy it and modify it

00:01:50.010 --> 00:01:51.340 align:middle line:90%
in order to make it work.

00:01:51.340 --> 00:01:51.840 align:middle line:90%
All right?

00:01:51.840 --> 00:01:54.660 align:middle line:84%
So I'll just copy the
target IP address.

00:01:54.660 --> 00:01:56.940 align:middle line:84%
And the first step
will involve performing

00:01:56.940 --> 00:01:58.950 align:middle line:84%
an Nmap scan on
the target in order

00:01:58.950 --> 00:02:01.330 align:middle line:84%
to identify what
services are running.

00:02:01.330 --> 00:02:01.830 align:middle line:90%
All right?

00:02:01.830 --> 00:02:05.280 align:middle line:84%
So I'll just type in nmap and
we can form a service version

00:02:05.280 --> 00:02:06.540 align:middle line:90%
detection scan.

00:02:06.540 --> 00:02:09.600 align:middle line:84%
And we'll perform a default
scan in terms of the ports.

00:02:09.600 --> 00:02:12.900 align:middle line:84%
And I'll paste in the
target IP and hit Enter.

00:02:12.900 --> 00:02:15.900 align:middle line:84%
And I'll give this
a couple of seconds.

00:02:15.900 --> 00:02:16.400 align:middle line:90%
All right?

00:02:16.400 --> 00:02:18.680 align:middle line:90%
So the Nmap scan is complete.

00:02:18.680 --> 00:02:21.380 align:middle line:84%
And we have various
services associated

00:02:21.380 --> 00:02:22.530 align:middle line:90%
with a Windows system.

00:02:22.530 --> 00:02:26.300 align:middle line:84%
So it looks like the target is
running a version of Windows.

00:02:26.300 --> 00:02:28.460 align:middle line:84%
We're not really
sure, but we do know

00:02:28.460 --> 00:02:30.200 align:middle line:84%
that it is running
Windows Server,

00:02:30.200 --> 00:02:34.380 align:middle line:84%
although the actual version
or edition is unknown to us.

00:02:34.380 --> 00:02:36.560 align:middle line:84%
We could perform
an operating system

00:02:36.560 --> 00:02:38.970 align:middle line:90%
scan in order to identify that.

00:02:38.970 --> 00:02:42.440 align:middle line:84%
But in this particular scenario,
we don't need to do that.

00:02:42.440 --> 00:02:45.770 align:middle line:84%
If we take a look at the service
that's running on port 80,

00:02:45.770 --> 00:02:49.850 align:middle line:84%
we can see that we have a
service called HttpFileServer

00:02:49.850 --> 00:02:51.530 align:middle line:90%
version 2.3.

00:02:51.530 --> 00:02:53.560 align:middle line:84%
So let's see if we can
actually access this.

00:02:53.560 --> 00:02:55.350 align:middle line:90%
I'm going to open up my browser.

00:02:55.350 --> 00:02:57.650 align:middle line:84%
So I'll open up
Firefox here, and we'll

00:02:57.650 --> 00:02:59.780 align:middle line:90%
navigate to the target IP.

00:02:59.780 --> 00:03:01.170 align:middle line:90%
And that is port 80.

00:03:01.170 --> 00:03:05.090 align:middle line:84%
So we can see that this
indeed is the HttpFileServer.

00:03:05.090 --> 00:03:07.250 align:middle line:84%
And information
pertinent to the service

00:03:07.250 --> 00:03:09.590 align:middle line:84%
is provided right to
VSO server information.

00:03:09.590 --> 00:03:13.760 align:middle line:84%
You can see the name of the
service is HttpFileServer.

00:03:13.760 --> 00:03:18.440 align:middle line:84%
And we really cannot click on
this link because we don't have

00:03:18.440 --> 00:03:21.420 align:middle line:84%
access to the internet
through the lab environment.

00:03:21.420 --> 00:03:23.870 align:middle line:84%
And this is a prime
example or scenario

00:03:23.870 --> 00:03:26.840 align:middle line:84%
where you would essentially
need to utilize the exploit code

00:03:26.840 --> 00:03:28.790 align:middle line:90%
available to you locally.

00:03:28.790 --> 00:03:32.510 align:middle line:84%
What we do know, however,
is that the HttpFileServer,

00:03:32.510 --> 00:03:36.690 align:middle line:84%
also known as HFS, is developed
by a company called Rejetto.

00:03:36.690 --> 00:03:37.190 align:middle line:90%
All right?

00:03:37.190 --> 00:03:39.360 align:middle line:84%
So we can take that
into consideration.

00:03:39.360 --> 00:03:43.550 align:middle line:84%
We have the actual service name
as well as the service version.

00:03:43.550 --> 00:03:47.060 align:middle line:84%
And let's see if we can identify
any vulnerabilities or exploits

00:03:47.060 --> 00:03:49.700 align:middle line:84%
that can be used to exploit
this specific version

00:03:49.700 --> 00:03:51.750 align:middle line:90%
of HttpFileServer.

00:03:51.750 --> 00:03:53.390 align:middle line:84%
So in order to do
that, we are going

00:03:53.390 --> 00:03:55.610 align:middle line:84%
to utilize search
exploit, right?

00:03:55.610 --> 00:03:59.400 align:middle line:84%
And we can essentially
type in HTTP File Server.

00:03:59.400 --> 00:04:00.860 align:middle line:84%
So let's see what
that brings up.

00:04:00.860 --> 00:04:03.080 align:middle line:90%
So HTTP File Server.

00:04:03.080 --> 00:04:05.298 align:middle line:90%
And we can specify 2.3.

00:04:05.298 --> 00:04:05.840 align:middle line:90%
There we are.

00:04:05.840 --> 00:04:10.220 align:middle line:84%
So it looks like we were able
to identify a few exploits here

00:04:10.220 --> 00:04:14.310 align:middle line:84%
pertinent to that specific
version of HttpFileServer.

00:04:14.310 --> 00:04:16.040 align:middle line:84%
And of course, these
are all exploits

00:04:16.040 --> 00:04:18.810 align:middle line:90%
for the Rejetto HttpFileServer.

00:04:18.810 --> 00:04:21.170 align:middle line:84%
So if we take a look at
this one right over here,

00:04:21.170 --> 00:04:25.820 align:middle line:84%
this affects version 2.3 and
any subversion below that.

00:04:25.820 --> 00:04:28.290 align:middle line:84%
This is remote
command execution.

00:04:28.290 --> 00:04:31.220 align:middle line:84%
And this is a Python
exploit, right?

00:04:31.220 --> 00:04:35.600 align:middle line:84%
It provides us with the actual
path to that exploit locally.

00:04:35.600 --> 00:04:38.570 align:middle line:84%
So even though we don't
have access to the internet,

00:04:38.570 --> 00:04:41.310 align:middle line:84%
we can still
exploit this system.

00:04:41.310 --> 00:04:44.738 align:middle line:84%
So what I'll do is I'll
navigate to the desktop.

00:04:44.738 --> 00:04:46.280 align:middle line:84%
And what I'm going
to do is I'm going

00:04:46.280 --> 00:04:49.100 align:middle line:84%
to utilize searchsploit
to make a copy of that

00:04:49.100 --> 00:04:52.100 align:middle line:84%
exploit within my current
working directory, which

00:04:52.100 --> 00:04:53.570 align:middle line:90%
is the desktop.

00:04:53.570 --> 00:04:55.740 align:middle line:84%
So I'll just specify
the ID there.

00:04:55.740 --> 00:04:58.094 align:middle line:90%
So that is 39161.

00:04:58.094 --> 00:05:00.590 align:middle line:84%
We don't need to
provide the extension.

00:05:00.590 --> 00:05:01.850 align:middle line:90%
I'll hit Enter.

00:05:01.850 --> 00:05:04.370 align:middle line:84%
And a copy of that
exploit has been made.

00:05:04.370 --> 00:05:07.550 align:middle line:84%
Now, this is pretty much the
most important step, right?

00:05:07.550 --> 00:05:08.600 align:middle line:90%
We have the exploit.

00:05:08.600 --> 00:05:09.890 align:middle line:90%
We now need to analyze it.

00:05:09.890 --> 00:05:13.010 align:middle line:84%
Now, you don't really need to
know how to program in Python.

00:05:13.010 --> 00:05:16.580 align:middle line:84%
All you need to know is what's
going on at a very high level.

00:05:16.580 --> 00:05:19.520 align:middle line:84%
And in certain cases or
in certain scenarios,

00:05:19.520 --> 00:05:22.370 align:middle line:84%
most of the exploits are
going to be well-documented

00:05:22.370 --> 00:05:24.410 align:middle line:84%
and will actually
highlight what each step

00:05:24.410 --> 00:05:26.250 align:middle line:90%
or what each function is doing.

00:05:26.250 --> 00:05:28.970 align:middle line:84%
So if we open up
the exploit with Vim

00:05:28.970 --> 00:05:31.070 align:middle line:84%
or any text editor
of your choice,

00:05:31.070 --> 00:05:33.500 align:middle line:90%
I can just open it up like so.

00:05:33.500 --> 00:05:35.780 align:middle line:84%
You can see that this
is a Python exploit.

00:05:35.780 --> 00:05:38.690 align:middle line:84%
It provides you with information
regarding this particular

00:05:38.690 --> 00:05:42.440 align:middle line:84%
exploit, like the exploit title,
a Google Doc to actually find

00:05:42.440 --> 00:05:44.480 align:middle line:84%
vulnerable systems
that are running

00:05:44.480 --> 00:05:49.130 align:middle line:84%
the version of HttpFileServer
when it was made public,

00:05:49.130 --> 00:05:53.370 align:middle line:84%
whether or not it's remote, the
exploit author, software link,

00:05:53.370 --> 00:05:54.260 align:middle line:90%
et cetera.

00:05:54.260 --> 00:05:56.930 align:middle line:84%
And it'll then give
you a description

00:05:56.930 --> 00:06:02.600 align:middle line:84%
as to what this particular
version of HFS or what HFS

00:06:02.600 --> 00:06:03.530 align:middle line:90%
is used for.

00:06:03.530 --> 00:06:05.330 align:middle line:84%
So it says right
away, you can use

00:06:05.330 --> 00:06:07.410 align:middle line:90%
HFS to send and receive files.

00:06:07.410 --> 00:06:11.330 align:middle line:84%
So again, we're learning
more about what HFS is.

00:06:11.330 --> 00:06:13.580 align:middle line:90%
HFS stands for HttpFileServer.

00:06:13.580 --> 00:06:17.570 align:middle line:84%
And HttpFileServer is used
to share files, right?

00:06:17.570 --> 00:06:21.330 align:middle line:84%
And that is facilitated
through a web server.

00:06:21.330 --> 00:06:23.660 align:middle line:84%
So instead of sharing
files via SMB,

00:06:23.660 --> 00:06:27.150 align:middle line:84%
you can also share them
with an HttpFileServer.

00:06:27.150 --> 00:06:27.650 align:middle line:90%
All right?

00:06:27.650 --> 00:06:29.840 align:middle line:84%
Now, in terms of
the exploit usage,

00:06:29.840 --> 00:06:33.350 align:middle line:84%
you can see that the author has
provided those instructions.

00:06:33.350 --> 00:06:37.100 align:middle line:84%
So we need to run it with
python Exploit.py or the name

00:06:37.100 --> 00:06:39.950 align:middle line:84%
of the exploit itself, the
target IP address as well

00:06:39.950 --> 00:06:41.520 align:middle line:90%
as the target port number.

00:06:41.520 --> 00:06:43.320 align:middle line:84%
So you might be
thinking to yourself,

00:06:43.320 --> 00:06:47.480 align:middle line:84%
well, we can immediately just
run this, and it could work.

00:06:47.480 --> 00:06:48.980 align:middle line:90%
It probably will work.

00:06:48.980 --> 00:06:51.230 align:middle line:84%
So let's actually
try that, right?

00:06:51.230 --> 00:06:52.770 align:middle line:84%
Let's see what
the issue is here.

00:06:52.770 --> 00:06:56.060 align:middle line:84%
So what we'll do is
we'll say python,

00:06:56.060 --> 00:06:59.420 align:middle line:84%
and then we can specify the
actual Python file there.

00:06:59.420 --> 00:07:01.460 align:middle line:84%
The target IP
address, we can obtain

00:07:01.460 --> 00:07:06.500 align:middle line:84%
by copying from the
text or Notepad here.

00:07:06.500 --> 00:07:08.740 align:middle line:84%
So we specify the
target IP address.

00:07:08.740 --> 00:07:12.230 align:middle line:84%
And we know that HttpFileServer
is running on port 80,

00:07:12.230 --> 00:07:14.890 align:middle line:84%
so we can type that
in and hit Enter.

00:07:14.890 --> 00:07:18.190 align:middle line:84%
And we can see that
nothing really happens.

00:07:18.190 --> 00:07:18.700 align:middle line:90%
Well,

00:07:18.700 --> 00:07:20.530 align:middle line:84%
The reason that's
happening is because we

00:07:20.530 --> 00:07:23.570 align:middle line:84%
haven't read or understood
how this exploit works.

00:07:23.570 --> 00:07:26.660 align:middle line:84%
So let's revisit the
exploit once again.

00:07:26.660 --> 00:07:27.160 align:middle line:90%
All right?

00:07:27.160 --> 00:07:29.230 align:middle line:84%
So if we take a
look at the EDB note

00:07:29.230 --> 00:07:31.570 align:middle line:84%
here or the exploit database
note, so it tells us

00:07:31.570 --> 00:07:33.490 align:middle line:84%
you need to be
using a web server

00:07:33.490 --> 00:07:37.180 align:middle line:84%
hosting Netcat or the Netcat
executable for Windows.

00:07:37.180 --> 00:07:40.030 align:middle line:84%
And this is pertinent
because the target is indeed

00:07:40.030 --> 00:07:43.660 align:middle line:84%
running Windows or has a
version of Windows Server set

00:07:43.660 --> 00:07:46.360 align:middle line:84%
up or installed, so
this makes sense.

00:07:46.360 --> 00:07:48.220 align:middle line:84%
And it says that you
may need to run it

00:07:48.220 --> 00:07:50.030 align:middle line:90%
multiple times for success.

00:07:50.030 --> 00:07:52.820 align:middle line:84%
So this is very, very
important information.

00:07:52.820 --> 00:07:54.790 align:middle line:84%
Now, in terms of
what's going on,

00:07:54.790 --> 00:07:58.450 align:middle line:84%
we can see that right
over here, there

00:07:58.450 --> 00:08:03.110 align:middle line:84%
is a variable that stores the
IP address and the local port.

00:08:03.110 --> 00:08:06.560 align:middle line:84%
Now, this already
has an IP specified.

00:08:06.560 --> 00:08:08.710 align:middle line:90%
This is our local IP address.

00:08:08.710 --> 00:08:11.560 align:middle line:84%
And the way this
exploit works is

00:08:11.560 --> 00:08:14.350 align:middle line:84%
that once the
exploit is launched,

00:08:14.350 --> 00:08:17.140 align:middle line:84%
it is then going to
connect to a web server

00:08:17.140 --> 00:08:21.160 align:middle line:84%
that we will set up locally
to host the Netcat executable.

00:08:21.160 --> 00:08:23.380 align:middle line:84%
That Netcat executable
is then going

00:08:23.380 --> 00:08:27.010 align:middle line:84%
to be executed on the target
system that's running Windows.

00:08:27.010 --> 00:08:30.910 align:middle line:84%
And it is going to be used
to connect to our own IP

00:08:30.910 --> 00:08:35.000 align:middle line:84%
address or our Kali Linux IP
address, which in this case,

00:08:35.000 --> 00:08:36.429 align:middle line:90%
we need to specify ourselves.

00:08:36.429 --> 00:08:38.480 align:middle line:84%
So that's the first
thing that we need to do.

00:08:38.480 --> 00:08:41.470 align:middle line:84%
So how do we identify
our Kali Linux IP?

00:08:41.470 --> 00:08:45.370 align:middle line:84%
We can open up a new terminal
here and type in ifconfig.

00:08:45.370 --> 00:08:48.865 align:middle line:84%
And we are going to be looking
for the interface ethernet 1.

00:08:48.865 --> 00:08:51.290 align:middle line:84%
And that is going to
be our IP address.

00:08:51.290 --> 00:08:52.840 align:middle line:84%
So I'm just going
to copy that there.

00:08:52.840 --> 00:08:56.590 align:middle line:84%
And we can then change
this from the author's IP,

00:08:56.590 --> 00:09:00.260 align:middle line:84%
that they'd not essentially
gotten rid of or changed.

00:09:00.260 --> 00:09:03.610 align:middle line:84%
So we will get rid of that
there and paste ours there.

00:09:03.610 --> 00:09:05.320 align:middle line:84%
And then the local
port, this is going

00:09:05.320 --> 00:09:08.560 align:middle line:84%
to be the port that we will
be listening on with Netcat.

00:09:08.560 --> 00:09:11.060 align:middle line:84%
So we can change this
to whatever we want.

00:09:11.060 --> 00:09:12.640 align:middle line:84%
You can choose to
leave it as is.

00:09:12.640 --> 00:09:15.130 align:middle line:84%
That really isn't
important at this stage.

00:09:15.130 --> 00:09:18.860 align:middle line:84%
I'll change it to 1234 for
the purpose of simplicity.

00:09:18.860 --> 00:09:19.360 align:middle line:90%
All right?

00:09:19.360 --> 00:09:22.270 align:middle line:90%
So let me write the changes.

00:09:22.270 --> 00:09:24.160 align:middle line:84%
And then we have
additional variables

00:09:24.160 --> 00:09:25.960 align:middle line:84%
that contain the
actual Visual Basic

00:09:25.960 --> 00:09:29.470 align:middle line:84%
script that will be
used to execute Netcat

00:09:29.470 --> 00:09:33.290 align:middle line:84%
or to download Netcat, and then
connect to our Netcat listener.

00:09:33.290 --> 00:09:33.790 align:middle line:90%
All right?

00:09:33.790 --> 00:09:37.090 align:middle line:84%
So we really don't need to
change much on that end.

00:09:37.090 --> 00:09:39.820 align:middle line:84%
You can see that really
all that's happening here

00:09:39.820 --> 00:09:44.860 align:middle line:84%
is as I said, it's downloading
the actual Netcat executable

00:09:44.860 --> 00:09:46.000 align:middle line:90%
from our server.

00:09:46.000 --> 00:09:51.310 align:middle line:84%
It then connects to the
Kali Linux IP on the port

00:09:51.310 --> 00:09:54.490 align:middle line:84%
that we have specified here
on our Netcat listener.

00:09:54.490 --> 00:09:56.770 align:middle line:84%
As you can see, this is
what this Visual Basic

00:09:56.770 --> 00:09:58.180 align:middle line:90%
script is doing here.

00:09:58.180 --> 00:10:00.700 align:middle line:84%
And it should then
provide us with a command

00:10:00.700 --> 00:10:05.470 align:middle line:84%
session on the target system
on our Netcat listener.

00:10:05.470 --> 00:10:07.840 align:middle line:84%
So in terms of
modifying the exploit,

00:10:07.840 --> 00:10:10.240 align:middle line:84%
this is pretty much all that
is required at this point.

00:10:10.240 --> 00:10:13.640 align:middle line:84%
Now, as I said, we have an
idea of how this exploit works.

00:10:13.640 --> 00:10:15.080 align:middle line:90%
So let's actually test this out.

00:10:15.080 --> 00:10:16.390 align:middle line:90%
So I'll write and quit.

00:10:16.390 --> 00:10:20.180 align:middle line:84%
And what I'll do is I will
just minimize that there.

00:10:20.180 --> 00:10:23.830 align:middle line:84%
Let me minimize the browser, and
let me get rid of that there.

00:10:23.830 --> 00:10:25.960 align:middle line:84%
So we have our first
terminal, which

00:10:25.960 --> 00:10:28.150 align:middle line:90%
I'll just drag right over here.

00:10:28.150 --> 00:10:30.400 align:middle line:84%
And we then have
our second terminal.

00:10:30.400 --> 00:10:32.380 align:middle line:84%
We'll need a few
terminal instances

00:10:32.380 --> 00:10:33.800 align:middle line:90%
to do what we're going to do.

00:10:33.800 --> 00:10:36.670 align:middle line:84%
So I'll just resize
that a little bit there.

00:10:36.670 --> 00:10:39.550 align:middle line:84%
And I'll also bring
this right over here.

00:10:39.550 --> 00:10:42.940 align:middle line:84%
And this is where we're going
to be launching the exploit.

00:10:42.940 --> 00:10:47.800 align:middle line:84%
Now remember, we still need
to get the Netcat executable.

00:10:47.800 --> 00:10:51.220 align:middle line:84%
Luckily, for us-- let me just
expand that one more time--

00:10:51.220 --> 00:10:53.830 align:middle line:84%
luckily for us,
Kali Linux already

00:10:53.830 --> 00:10:57.280 align:middle line:84%
has the Windows Netcat
executable available.

00:10:57.280 --> 00:10:59.710 align:middle line:84%
So we'll navigate to the
desktop because that's

00:10:59.710 --> 00:11:01.240 align:middle line:90%
where I'm going to copy it to.

00:11:01.240 --> 00:11:06.790 align:middle line:84%
And the Netcat executable is
available under the user shared

00:11:06.790 --> 00:11:09.050 align:middle line:84%
directory, so I can just
copy the executable.

00:11:09.050 --> 00:11:15.340 align:middle line:84%
So /usr/share/windows-resources,
and we're looking for binaries.

00:11:15.340 --> 00:11:19.030 align:middle line:84%
And nc or netcat.exe,
it will copy it

00:11:19.030 --> 00:11:20.660 align:middle line:84%
to our current
working directory,

00:11:20.660 --> 00:11:21.680 align:middle line:90%
which is the desktop.

00:11:21.680 --> 00:11:23.290 align:middle line:90%
So I'll hit Enter.

00:11:23.290 --> 00:11:27.190 align:middle line:84%
If I list out the
contents of the desktop--

00:11:27.190 --> 00:11:31.330 align:middle line:84%
there we are-- you can see
that we have the Netcat or exe

00:11:31.330 --> 00:11:35.350 align:middle line:84%
executable as well as the
Python exploit, right?

00:11:35.350 --> 00:11:38.200 align:middle line:84%
So we have all of that
information specified now.

00:11:38.200 --> 00:11:39.850 align:middle line:84%
So I'll just
minimize that again.

00:11:39.850 --> 00:11:42.850 align:middle line:84%
I just wanted to make sure
that you saw what was going on.

00:11:42.850 --> 00:11:45.310 align:middle line:84%
And I'll just drag
this right over here.

00:11:45.310 --> 00:11:48.580 align:middle line:84%
And I think that's
fine as it is.

00:11:48.580 --> 00:11:52.000 align:middle line:84%
I think I'll resize it a little
bit here so that it matches

00:11:52.000 --> 00:11:53.620 align:middle line:84%
in terms of the
tiles, but I think

00:11:53.620 --> 00:11:55.780 align:middle line:84%
that's perfectly
fine at this point.

00:11:55.780 --> 00:11:58.250 align:middle line:84%
OK, so let me just
resize that there.

00:11:58.250 --> 00:12:01.150 align:middle line:84%
And we're going to
need three Windows.

00:12:01.150 --> 00:12:03.460 align:middle line:84%
One of them will be
exploiting or will

00:12:03.460 --> 00:12:07.550 align:middle line:84%
be running the exploit
itself as we did previously.

00:12:07.550 --> 00:12:09.760 align:middle line:84%
The next terminal
is where we will

00:12:09.760 --> 00:12:14.120 align:middle line:84%
be setting up our web server
to host the Netcat executable.

00:12:14.120 --> 00:12:14.620 align:middle line:90%
All right?

00:12:14.620 --> 00:12:18.580 align:middle line:84%
So in order to do this, we will
be utilizing the Python module

00:12:18.580 --> 00:12:20.680 align:middle line:90%
SimpleHTTPServer.

00:12:20.680 --> 00:12:26.250 align:middle line:84%
So I'll say python
-m SimpleHTTPServer.

00:12:26.250 --> 00:12:28.890 align:middle line:90%


00:12:28.890 --> 00:12:34.470 align:middle line:84%
And will host the contents
of the desktop directory

00:12:34.470 --> 00:12:35.730 align:middle line:90%
on port 80.

00:12:35.730 --> 00:12:39.300 align:middle line:84%
And of course, this is going to
be available via our Kali Linux

00:12:39.300 --> 00:12:39.900 align:middle line:90%
IP.

00:12:39.900 --> 00:12:41.850 align:middle line:90%
So I'll hit Enter.

00:12:41.850 --> 00:12:46.470 align:middle line:84%
As you can see, it says
serving HTTP on the Linux IP

00:12:46.470 --> 00:12:47.950 align:middle line:90%
on port 80.

00:12:47.950 --> 00:12:54.420 align:middle line:84%
So now that is done, we then
need to open up a new terminal

00:12:54.420 --> 00:12:55.650 align:middle line:90%
session here.

00:12:55.650 --> 00:12:57.780 align:middle line:84%
And this is where
our Netcat listener

00:12:57.780 --> 00:12:59.250 align:middle line:84%
is going to be
running, and this is

00:12:59.250 --> 00:13:01.960 align:middle line:84%
where we'll obtain our
command shell session.

00:13:01.960 --> 00:13:02.460 align:middle line:90%
All right?

00:13:02.460 --> 00:13:06.300 align:middle line:84%
So let me just resize
that so that it actually

00:13:06.300 --> 00:13:09.030 align:middle line:84%
fits in properly with what
we'll be doing because it's

00:13:09.030 --> 00:13:11.850 align:middle line:84%
very important that you actually
see all of these Windows

00:13:11.850 --> 00:13:14.260 align:middle line:84%
and what output is
being generated.

00:13:14.260 --> 00:13:16.288 align:middle line:84%
So I'll just zoom
in this window here.

00:13:16.288 --> 00:13:16.830 align:middle line:90%
There we are.

00:13:16.830 --> 00:13:17.850 align:middle line:90%
Fantastic.

00:13:17.850 --> 00:13:20.130 align:middle line:84%
And we can set up
our Netcat listener.

00:13:20.130 --> 00:13:23.250 align:middle line:90%
So we'll say nc -nvlp 1234.

00:13:23.250 --> 00:13:25.620 align:middle line:84%
So remember, the
port that we're going

00:13:25.620 --> 00:13:29.680 align:middle line:84%
to be listening on, we specified
within the exploit file here.

00:13:29.680 --> 00:13:31.740 align:middle line:84%
So again, if I just
open it up, you

00:13:31.740 --> 00:13:34.740 align:middle line:84%
can see we specified
the Kali Linux IP here.

00:13:34.740 --> 00:13:37.200 align:middle line:84%
And of course, in your case,
it's going to be different.

00:13:37.200 --> 00:13:41.520 align:middle line:84%
And the port that we're going
to be listening on is 1234.

00:13:41.520 --> 00:13:43.540 align:middle line:90%
So we can then quit.

00:13:43.540 --> 00:13:46.630 align:middle line:84%
I'll just quit from the
actual exploit file itself.

00:13:46.630 --> 00:13:48.600 align:middle line:90%
And we can set up our listener.

00:13:48.600 --> 00:13:49.900 align:middle line:90%
There we go.

00:13:49.900 --> 00:13:53.370 align:middle line:84%
And within this terminal,
we can now execute or launch

00:13:53.370 --> 00:13:54.450 align:middle line:90%
the actual exploit.

00:13:54.450 --> 00:13:56.730 align:middle line:90%
So we'll say python.

00:13:56.730 --> 00:13:58.200 align:middle line:84%
And we can use the
previous command

00:13:58.200 --> 00:13:59.415 align:middle line:84%
because we had
run it previously.

00:13:59.415 --> 00:14:00.030 align:middle line:90%
There we are.

00:14:00.030 --> 00:14:04.380 align:middle line:84%
So python, the exploit
file itself, the target IP

00:14:04.380 --> 00:14:09.450 align:middle line:84%
address, and the port on which
HTTP file server is running.

00:14:09.450 --> 00:14:11.482 align:middle line:90%
So I'll hit Enter.

00:14:11.482 --> 00:14:13.440 align:middle line:84%
And you'll see nothing
will happen, but give it

00:14:13.440 --> 00:14:14.520 align:middle line:90%
a few seconds.

00:14:14.520 --> 00:14:16.570 align:middle line:84%
On the web server
that we set up,

00:14:16.570 --> 00:14:19.860 align:middle line:84%
you should see a few GET
requests that will essentially

00:14:19.860 --> 00:14:23.170 align:middle line:84%
download the Netcat executable
as you can see there.

00:14:23.170 --> 00:14:25.830 align:middle line:84%
So it downloads the
Netcat executable.

00:14:25.830 --> 00:14:28.500 align:middle line:84%
And we should then
receive a reverse shell

00:14:28.500 --> 00:14:30.060 align:middle line:90%
on our Netcat listener.

00:14:30.060 --> 00:14:32.670 align:middle line:84%
However, in this case,
we can see that we don't.

00:14:32.670 --> 00:14:34.110 align:middle line:84%
And again, that
was something that

00:14:34.110 --> 00:14:36.420 align:middle line:84%
was highlighted within
the exploit itself,

00:14:36.420 --> 00:14:38.860 align:middle line:84%
that we may need to run
it more than one time.

00:14:38.860 --> 00:14:39.360 align:middle line:90%
All right?

00:14:39.360 --> 00:14:41.250 align:middle line:90%
So let's do that again.

00:14:41.250 --> 00:14:43.410 align:middle line:84%
And let's see if we get
a command shell session.

00:14:43.410 --> 00:14:44.730 align:middle line:90%
And indeed, we do.

00:14:44.730 --> 00:14:46.380 align:middle line:84%
Right away, you
can see connection

00:14:46.380 --> 00:14:47.820 align:middle line:90%
from the target system.

00:14:47.820 --> 00:14:50.440 align:middle line:84%
And we have a command prompt
session on the target.

00:14:50.440 --> 00:14:54.430 align:middle line:84%
So again, I can say
whoami, for example.

00:14:54.430 --> 00:14:58.028 align:middle line:84%
And let's give that
a couple of seconds.

00:14:58.028 --> 00:14:58.570 align:middle line:90%
There we are.

00:14:58.570 --> 00:15:00.810 align:middle line:84%
We can see that we have
administrative access

00:15:00.810 --> 00:15:03.870 align:middle line:84%
on the target system, which
indeed is running Windows.

00:15:03.870 --> 00:15:07.590 align:middle line:84%
So again, we can learn more
about it by saying systeminfo.

00:15:07.590 --> 00:15:09.430 align:middle line:84%
And this command
usually takes a while,

00:15:09.430 --> 00:15:11.235 align:middle line:84%
so I'll just give this
a couple of seconds.

00:15:11.235 --> 00:15:17.740 align:middle line:90%


00:15:17.740 --> 00:15:20.830 align:middle line:84%
All right, so the output
is displayed here.

00:15:20.830 --> 00:15:22.330 align:middle line:84%
So let's see what
version of Windows

00:15:22.330 --> 00:15:23.812 align:middle line:90%
is running on the target system.

00:15:23.812 --> 00:15:25.270 align:middle line:84%
I'm just going to
scroll to the top

00:15:25.270 --> 00:15:26.980 align:middle line:84%
here where the
output was displayed.

00:15:26.980 --> 00:15:30.490 align:middle line:84%
We can see that the target is
running Windows Server 2012 R2

00:15:30.490 --> 00:15:31.430 align:middle line:90%
standard.

00:15:31.430 --> 00:15:34.690 align:middle line:84%
And again, we've been able
to gain access to the target

00:15:34.690 --> 00:15:40.270 align:middle line:84%
system through the use of
a publicly available piece

00:15:40.270 --> 00:15:41.440 align:middle line:90%
of exploit code.

00:15:41.440 --> 00:15:45.310 align:middle line:84%
And we did not rely on utilizing
the Metasploit framework.

00:15:45.310 --> 00:15:47.200 align:middle line:84%
The reason I'm saying
that is because there

00:15:47.200 --> 00:15:49.630 align:middle line:84%
is a Metasploit
module available that

00:15:49.630 --> 00:15:51.250 align:middle line:90%
automates this entire process.

00:15:51.250 --> 00:15:54.310 align:middle line:84%
But this is very important in
the context of a penetration

00:15:54.310 --> 00:16:00.070 align:middle line:84%
tester because you should be
able to utilize exploit code

00:16:00.070 --> 00:16:03.640 align:middle line:84%
that's available online
or in this case, available

00:16:03.640 --> 00:16:04.480 align:middle line:90%
on Kali Linux.

00:16:04.480 --> 00:16:07.990 align:middle line:84%
You should be able to modify
it based on your own parameters

00:16:07.990 --> 00:16:09.070 align:middle line:90%
and environment.

00:16:09.070 --> 00:16:11.800 align:middle line:84%
And in terms of
executing it, as you saw,

00:16:11.800 --> 00:16:13.900 align:middle line:84%
we needed to run it
more than one time.

00:16:13.900 --> 00:16:16.300 align:middle line:84%
Again, this is very important
because it gives you

00:16:16.300 --> 00:16:21.910 align:middle line:84%
a holistic view of exploitation
rather than just relying

00:16:21.910 --> 00:16:25.820 align:middle line:84%
on an automated exploitation
framework like Metasploit.

00:16:25.820 --> 00:16:26.320 align:middle line:90%
All right?

00:16:26.320 --> 00:16:29.410 align:middle line:84%
So that is going to conclude
the practical demonstration

00:16:29.410 --> 00:16:32.410 align:middle line:90%
side of this video.

00:16:32.410 --> 00:16:35.100 align:middle line:84%
In the next video, we will
be exploring the process

00:16:35.100 --> 00:16:36.690 align:middle line:90%
of compiling exploits.

00:16:36.690 --> 00:16:38.250 align:middle line:84%
And we're going to
be taking a look

00:16:38.250 --> 00:16:41.820 align:middle line:84%
at how to compile both Windows
exploits as well as Linux

00:16:41.820 --> 00:16:43.140 align:middle line:90%
exploits.

00:16:43.140 --> 00:16:45.450 align:middle line:84%
And the reason for
this is primarily

00:16:45.450 --> 00:16:48.600 align:middle line:84%
because in certain cases,
the actual exploits

00:16:48.600 --> 00:16:52.920 align:middle line:84%
available on ExploitDB might
be in a language like C that

00:16:52.920 --> 00:16:55.410 align:middle line:84%
requires them to be
compiled into a binary,

00:16:55.410 --> 00:16:58.500 align:middle line:84%
and then executed, as
opposed to the example

00:16:58.500 --> 00:17:02.220 align:middle line:84%
that we just saw during the
practical demonstration, where

00:17:02.220 --> 00:17:04.869 align:middle line:84%
the exploit that we used
was a Python script.

00:17:04.869 --> 00:17:07.530 align:middle line:84%
So again, this is also
something that's very important.

00:17:07.530 --> 00:17:10.500 align:middle line:84%
And I'll see you
in the next video.

00:17:10.500 --> 00:17:11.000 align:middle line:90%