WEBVTT

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


00:00:10.140 --> 00:00:13.260 align:middle line:84%
Welcome to the pivoting
section of this course.

00:00:13.260 --> 00:00:15.270 align:middle line:84%
In this section, we're
going to be focused

00:00:15.270 --> 00:00:19.740 align:middle line:84%
on the process of how to
pivot from a compromised

00:00:19.740 --> 00:00:23.100 align:middle line:84%
system on a client's
network onto other systems

00:00:23.100 --> 00:00:24.510 align:middle line:90%
on the client network.

00:00:24.510 --> 00:00:28.530 align:middle line:84%
Now, this is a phase that
I've mentioned repeatedly

00:00:28.530 --> 00:00:30.910 align:middle line:90%
throughout most of this course.

00:00:30.910 --> 00:00:33.060 align:middle line:84%
And the reason I said
that or the reason

00:00:33.060 --> 00:00:37.050 align:middle line:84%
I mentioned that is primarily
because the local enumeration

00:00:37.050 --> 00:00:40.620 align:middle line:84%
sections of this course
had information or were

00:00:40.620 --> 00:00:44.640 align:middle line:84%
very important or pertinent
to this phase, which, again,

00:00:44.640 --> 00:00:47.370 align:middle line:84%
as I said, involves
moving from one system

00:00:47.370 --> 00:00:51.690 align:middle line:84%
that you have compromised and
using that system as a foothold

00:00:51.690 --> 00:00:56.430 align:middle line:84%
essentially to exploit or to
gain access to other systems

00:00:56.430 --> 00:00:58.450 align:middle line:90%
on the target network.

00:00:58.450 --> 00:00:58.950 align:middle line:90%
All right.

00:00:58.950 --> 00:01:00.850 align:middle line:84%
Now, before we
actually get started,

00:01:00.850 --> 00:01:02.610 align:middle line:84%
we need to understand
what pivoting

00:01:02.610 --> 00:01:04.920 align:middle line:84%
is from a very
high level, and we

00:01:04.920 --> 00:01:07.050 align:middle line:84%
need to get an understanding
of the techniques

00:01:07.050 --> 00:01:10.530 align:middle line:84%
that we will be utilizing
in order to facilitate

00:01:10.530 --> 00:01:12.570 align:middle line:90%
the pivoting process.

00:01:12.570 --> 00:01:15.630 align:middle line:84%
So pivoting is a post
exploitation technique

00:01:15.630 --> 00:01:19.650 align:middle line:84%
that involves utilizing
a compromised host that

00:01:19.650 --> 00:01:21.660 align:middle line:84%
is connected to
multiple networks

00:01:21.660 --> 00:01:24.840 align:middle line:84%
to gain access to systems
within other networks

00:01:24.840 --> 00:01:31.080 align:middle line:84%
or those internal networks that
are the host of the system you

00:01:31.080 --> 00:01:33.370 align:middle line:90%
have compromised is a part of.

00:01:33.370 --> 00:01:36.960 align:middle line:84%
So an example of this would
be if you compromise a Windows

00:01:36.960 --> 00:01:41.160 align:middle line:84%
system that is part
of a network and when

00:01:41.160 --> 00:01:42.960 align:middle line:84%
you're performing
local enumeration,

00:01:42.960 --> 00:01:46.140 align:middle line:84%
you're able to identify
that this system is not just

00:01:46.140 --> 00:01:48.900 align:middle line:84%
part of one network,
but it is a part

00:01:48.900 --> 00:01:52.230 align:middle line:84%
of another internal
network that has

00:01:52.230 --> 00:01:54.660 align:middle line:84%
systems that you
could not previously

00:01:54.660 --> 00:01:55.950 align:middle line:90%
access through the internet.

00:01:55.950 --> 00:01:58.680 align:middle line:84%
So it's an internal
network where you can only

00:01:58.680 --> 00:02:03.030 align:middle line:84%
interact with those systems via
other systems on that network.

00:02:03.030 --> 00:02:04.980 align:middle line:84%
And given the fact
that you've compromised

00:02:04.980 --> 00:02:07.950 align:middle line:84%
one of these systems that
was accessible through

00:02:07.950 --> 00:02:10.289 align:middle line:84%
the internet, you
can now gain access

00:02:10.289 --> 00:02:12.720 align:middle line:84%
to these internal systems
that you previously

00:02:12.720 --> 00:02:14.460 align:middle line:90%
could not access.

00:02:14.460 --> 00:02:17.280 align:middle line:84%
So after gaining
access to one host,

00:02:17.280 --> 00:02:20.820 align:middle line:84%
we can use the compromised
host to exploit other hosts

00:02:20.820 --> 00:02:24.990 align:middle line:84%
on a private internal network or
other hosts on the same network

00:02:24.990 --> 00:02:27.930 align:middle line:84%
that the compromised
system is a part of.

00:02:27.930 --> 00:02:31.260 align:middle line:84%
And, of course, the objective
here is to move from one system

00:02:31.260 --> 00:02:31.900 align:middle line:90%
to another.

00:02:31.900 --> 00:02:35.670 align:middle line:84%
So that's the key point that
I want you to take from here.

00:02:35.670 --> 00:02:38.160 align:middle line:84%
And as I said, pivoting
can be quite confusing

00:02:38.160 --> 00:02:40.920 align:middle line:84%
because you might be
thinking to yourself, well,

00:02:40.920 --> 00:02:42.750 align:middle line:90%
there's really two streams here.

00:02:42.750 --> 00:02:44.590 align:middle line:90%
There's two streams of thought.

00:02:44.590 --> 00:02:47.700 align:middle line:84%
One of which is if you gain
access to a target system

00:02:47.700 --> 00:02:51.120 align:middle line:84%
and you find that it's
only part of one network,

00:02:51.120 --> 00:02:52.950 align:middle line:84%
does that mean that
you can perform--

00:02:52.950 --> 00:02:54.690 align:middle line:84%
that you cannot
perform pivoting?

00:02:54.690 --> 00:02:56.100 align:middle line:90%
No, not at all.

00:02:56.100 --> 00:02:59.490 align:middle line:84%
What you need to do then is
identify the other systems

00:02:59.490 --> 00:03:01.530 align:middle line:84%
that are part of that
network and then pivot

00:03:01.530 --> 00:03:02.770 align:middle line:90%
to those systems.

00:03:02.770 --> 00:03:05.130 align:middle line:84%
Now, as I said,
in some cases, you

00:03:05.130 --> 00:03:08.940 align:middle line:84%
will find that a system that you
have compromised irregardless

00:03:08.940 --> 00:03:12.480 align:middle line:84%
of the operating system is
part of more than one network.

00:03:12.480 --> 00:03:14.520 align:middle line:84%
So it could be part
of one network that

00:03:14.520 --> 00:03:19.140 align:middle line:84%
is DMZ and can be accessed
through the internet

00:03:19.140 --> 00:03:21.150 align:middle line:90%
or via the internet.

00:03:21.150 --> 00:03:25.770 align:middle line:84%
And it is also part of another
internal network of computers

00:03:25.770 --> 00:03:29.550 align:middle line:84%
or systems that is not
accessible via the internet

00:03:29.550 --> 00:03:31.230 align:middle line:90%
or publicly.

00:03:31.230 --> 00:03:33.750 align:middle line:84%
So there's two ways
you can go about it,

00:03:33.750 --> 00:03:35.920 align:middle line:84%
and the process will
remain the same.

00:03:35.920 --> 00:03:38.070 align:middle line:84%
The only thing that will
change is the environment

00:03:38.070 --> 00:03:39.270 align:middle line:90%
that you're working on.

00:03:39.270 --> 00:03:42.180 align:middle line:84%
The key pieces of information
and how to obtain them

00:03:42.180 --> 00:03:43.900 align:middle line:84%
have already been
covered in this course.

00:03:43.900 --> 00:03:47.700 align:middle line:84%
So it's going to be relatively
simple to understand.

00:03:47.700 --> 00:03:50.760 align:middle line:84%
Now, for the purpose of
demonstrating pivoting,

00:03:50.760 --> 00:03:54.150 align:middle line:84%
we are going to be utilizing
Meterpreter or the Metasploit

00:03:54.150 --> 00:03:54.960 align:middle line:90%
framework.

00:03:54.960 --> 00:03:56.820 align:middle line:84%
The reason I'm doing
this is primarily

00:03:56.820 --> 00:04:00.570 align:middle line:84%
because the Metasploit framework
and Meterpreter, in particular,

00:04:00.570 --> 00:04:03.720 align:middle line:84%
already have these commands
or tools built into it

00:04:03.720 --> 00:04:06.570 align:middle line:84%
and makes it much
simpler to understand

00:04:06.570 --> 00:04:09.660 align:middle line:84%
in terms of what's
going on and how to do

00:04:09.660 --> 00:04:14.640 align:middle line:84%
or how to set up remote port
forwarding and local port

00:04:14.640 --> 00:04:15.730 align:middle line:90%
forwarding.

00:04:15.730 --> 00:04:18.750 align:middle line:84%
So there's other
techniques and tools

00:04:18.750 --> 00:04:20.339 align:middle line:84%
that you can use
to do this, but we

00:04:20.339 --> 00:04:22.290 align:middle line:84%
are going to be covering
those techniques

00:04:22.290 --> 00:04:26.020 align:middle line:84%
in an advanced certification
that merits that.

00:04:26.020 --> 00:04:27.690 align:middle line:84%
However, for now,
the objective here

00:04:27.690 --> 00:04:29.460 align:middle line:90%
is to explain what's happening.

00:04:29.460 --> 00:04:31.590 align:middle line:84%
Now, in order to
understand pivoting,

00:04:31.590 --> 00:04:33.760 align:middle line:84%
you need to understand
port forwarding.

00:04:33.760 --> 00:04:35.430 align:middle line:90%
So what is port forwarding?

00:04:35.430 --> 00:04:39.210 align:middle line:84%
Port forwarding is the
process of redirecting traffic

00:04:39.210 --> 00:04:42.120 align:middle line:84%
from a specific port
on a target system

00:04:42.120 --> 00:04:45.900 align:middle line:84%
to a specific port on our
system, our local system.

00:04:45.900 --> 00:04:48.670 align:middle line:84%
This can be your penetration
testing distribution.

00:04:48.670 --> 00:04:50.850 align:middle line:84%
It could be your Kali Linux
system, [INAUDIBLE] OS

00:04:50.850 --> 00:04:52.050 align:middle line:90%
whatever.

00:04:52.050 --> 00:04:54.870 align:middle line:84%
What you're trying
to do is say, I

00:04:54.870 --> 00:04:59.670 align:middle line:84%
want you to redirect the
traffic from a specific port

00:04:59.670 --> 00:05:02.400 align:middle line:84%
on a target system that
you'd like to compromise.

00:05:02.400 --> 00:05:04.430 align:middle line:84%
And I want you to
forward that traffic

00:05:04.430 --> 00:05:07.580 align:middle line:84%
to a local port on
our system, so that we

00:05:07.580 --> 00:05:09.830 align:middle line:90%
can access that service.

00:05:09.830 --> 00:05:12.530 align:middle line:84%
So in the context
of pivoting, we

00:05:12.530 --> 00:05:17.000 align:middle line:84%
can forward a remote port on
a previously inaccessible host

00:05:17.000 --> 00:05:19.820 align:middle line:84%
to a local port on
our Kali Linux system,

00:05:19.820 --> 00:05:23.180 align:middle line:84%
so that we can remotely interact
or exploit the service that

00:05:23.180 --> 00:05:24.930 align:middle line:90%
is running on that port.

00:05:24.930 --> 00:05:27.830 align:middle line:84%
Now, this diagram
here, essentially

00:05:27.830 --> 00:05:29.990 align:middle line:90%
visualizes what pivoting is.

00:05:29.990 --> 00:05:33.150 align:middle line:84%
So you can see that this
is our attacker system.

00:05:33.150 --> 00:05:35.360 align:middle line:84%
So in the context of the
lab environment that we

00:05:35.360 --> 00:05:38.420 align:middle line:84%
will be using, this is
our Kali Linux system

00:05:38.420 --> 00:05:40.820 align:middle line:90%
and it has its own IP address.

00:05:40.820 --> 00:05:44.190 align:middle line:84%
Do note that these IP
addresses are just examples.

00:05:44.190 --> 00:05:48.000 align:middle line:84%
This is not the actual IP
specification within the lab.

00:05:48.000 --> 00:05:51.540 align:middle line:84%
I've just set this up
to explain the process.

00:05:51.540 --> 00:05:54.260 align:middle line:84%
So you can see that it
has its own IP address,

00:05:54.260 --> 00:05:56.250 align:middle line:90%
and it is part of the internet.

00:05:56.250 --> 00:06:00.140 align:middle line:84%
Let's say, it's
part of a network.

00:06:00.140 --> 00:06:02.390 align:middle line:84%
It could be the internet,
it could be a local network,

00:06:02.390 --> 00:06:03.650 align:middle line:90%
whatever the case.

00:06:03.650 --> 00:06:06.440 align:middle line:84%
And we gained access
to victim one.

00:06:06.440 --> 00:06:09.650 align:middle line:84%
Now, victim one is a
part of this network

00:06:09.650 --> 00:06:11.870 align:middle line:84%
that the Kali
Linux system is on,

00:06:11.870 --> 00:06:15.420 align:middle line:84%
which means that we can access
victim one without any issues.

00:06:15.420 --> 00:06:18.080 align:middle line:84%
And we'll exploit it
and gain access to it.

00:06:18.080 --> 00:06:20.330 align:middle line:84%
When performing
local enumeration,

00:06:20.330 --> 00:06:23.480 align:middle line:84%
more specifically enumerating
network information,

00:06:23.480 --> 00:06:26.660 align:middle line:84%
we're able to identify that
victim one, in addition

00:06:26.660 --> 00:06:28.250 align:middle line:84%
to being part of
this network, is

00:06:28.250 --> 00:06:34.040 align:middle line:84%
part of an internal network
with its own subnet CIDR here.

00:06:34.040 --> 00:06:38.000 align:middle line:84%
And you can see that it has,
in addition to having one IP

00:06:38.000 --> 00:06:40.790 align:middle line:84%
address for this network,
it has another IP address

00:06:40.790 --> 00:06:41.750 align:middle line:90%
for this network.

00:06:41.750 --> 00:06:45.080 align:middle line:84%
So that devices within
this particular network

00:06:45.080 --> 00:06:49.170 align:middle line:84%
can communicate with it and vice
versa for the other network.

00:06:49.170 --> 00:06:51.470 align:middle line:84%
So we can use this
system that we've

00:06:51.470 --> 00:06:55.070 align:middle line:84%
compromised as our foothold
to essentially gain access

00:06:55.070 --> 00:06:56.630 align:middle line:90%
to victim two.

00:06:56.630 --> 00:07:01.280 align:middle line:84%
Now, the important thing to note
here is we cannot access victim

00:07:01.280 --> 00:07:03.950 align:middle line:90%
two via our Kali Linux system.

00:07:03.950 --> 00:07:05.570 align:middle line:84%
We have to use the
system that we've

00:07:05.570 --> 00:07:10.790 align:middle line:84%
compromised as an intermediary
or a jumping point

00:07:10.790 --> 00:07:14.360 align:middle line:84%
to access this other system,
and consequently, exploit

00:07:14.360 --> 00:07:16.500 align:middle line:90%
it, and gain access to it.

00:07:16.500 --> 00:07:18.290 align:middle line:84%
And this is a very
simple example.

00:07:18.290 --> 00:07:20.030 align:middle line:84%
Of course, in a
larger network, you're

00:07:20.030 --> 00:07:22.400 align:middle line:84%
going to have multiple
systems that you can pivot to.

00:07:22.400 --> 00:07:25.490 align:middle line:84%
So you could have victim two,
victim three, victim four, all

00:07:25.490 --> 00:07:27.540 align:middle line:90%
the way to hundreds of systems.

00:07:27.540 --> 00:07:29.870 align:middle line:84%
So this is just
a simple example.

00:07:29.870 --> 00:07:33.980 align:middle line:84%
And in terms of gaining
access to victim two,

00:07:33.980 --> 00:07:36.260 align:middle line:84%
we, of course, going
to need to identify

00:07:36.260 --> 00:07:39.800 align:middle line:84%
what ports are open in
victim two and what services

00:07:39.800 --> 00:07:42.320 align:middle line:90%
are running on those open ports.

00:07:42.320 --> 00:07:44.600 align:middle line:84%
And the way we can
target that port

00:07:44.600 --> 00:07:47.300 align:middle line:84%
or identify what service
is running on that port

00:07:47.300 --> 00:07:49.880 align:middle line:84%
is by performing
port forwarding.

00:07:49.880 --> 00:07:51.530 align:middle line:84%
So port forwarding
will essentially

00:07:51.530 --> 00:07:55.850 align:middle line:84%
allow us to perform or to
forward a port, maybe port 80,

00:07:55.850 --> 00:08:00.510 align:middle line:84%
on victim two onto port 1234
on the Kali Linux system.

00:08:00.510 --> 00:08:03.740 align:middle line:84%
So that we can perform an Nmap
scan on the Kali Linux system

00:08:03.740 --> 00:08:06.290 align:middle line:84%
on port 1234 to
identify the service

00:08:06.290 --> 00:08:09.110 align:middle line:84%
that's running on
port 80 on victim two.

00:08:09.110 --> 00:08:10.820 align:middle line:84%
This may be a little
bit confusing,

00:08:10.820 --> 00:08:13.070 align:middle line:84%
but it will make sense
in a couple of seconds

00:08:13.070 --> 00:08:16.580 align:middle line:84%
when we get started with
the lab environment.

00:08:16.580 --> 00:08:19.850 align:middle line:84%
So this video has a lab
environment attached to it,

00:08:19.850 --> 00:08:23.480 align:middle line:84%
and we're going to be going
through a very simple flow.

00:08:23.480 --> 00:08:26.570 align:middle line:84%
I'm going to showcase the two
target systems and their IP

00:08:26.570 --> 00:08:27.110 align:middle line:90%
addresses.

00:08:27.110 --> 00:08:29.450 align:middle line:84%
And you'll be able to
see that we'll only

00:08:29.450 --> 00:08:33.539 align:middle line:84%
be able to access one IP address
from our Kali Linux system.

00:08:33.539 --> 00:08:35.960 align:middle line:84%
So we'll be exploiting
that system first.

00:08:35.960 --> 00:08:39.500 align:middle line:84%
Once we exploit that
system, we will then

00:08:39.500 --> 00:08:42.679 align:middle line:84%
set up port forwarding
or we'll essentially

00:08:42.679 --> 00:08:44.247 align:middle line:84%
be adding the root
to that system,

00:08:44.247 --> 00:08:45.830 align:middle line:84%
and then we'll set
up port forwarding,

00:08:45.830 --> 00:08:49.130 align:middle line:84%
identify the open ports
on the second system,

00:08:49.130 --> 00:08:51.260 align:middle line:84%
and identify the
vulnerable service that's

00:08:51.260 --> 00:08:54.080 align:middle line:84%
running on one of
those ports, and then

00:08:54.080 --> 00:08:57.030 align:middle line:84%
will exploit it and gain
access to the second system.

00:08:57.030 --> 00:09:00.020 align:middle line:84%
So fire up your lab environment,
and I'll see you there

00:09:00.020 --> 00:09:01.025 align:middle line:90%
in a couple of seconds.

00:09:01.025 --> 00:09:03.750 align:middle line:90%


00:09:03.750 --> 00:09:06.280 align:middle line:84%
So I'm back in the
lab environment.

00:09:06.280 --> 00:09:09.730 align:middle line:84%
And you can see that you'll be
provided with two IP addresses.

00:09:09.730 --> 00:09:13.650 align:middle line:84%
So the IP address for victim
machine one and the IP address

00:09:13.650 --> 00:09:15.270 align:middle line:90%
for victim machine two.

00:09:15.270 --> 00:09:17.460 align:middle line:84%
Now, do note in your
lab environment,

00:09:17.460 --> 00:09:19.890 align:middle line:84%
these IP addresses are
going to be different.

00:09:19.890 --> 00:09:21.810 align:middle line:84%
All you need to
do is just follow

00:09:21.810 --> 00:09:24.570 align:middle line:84%
the process and the
techniques that I'm showcasing

00:09:24.570 --> 00:09:27.690 align:middle line:84%
and make sure to replace
your own lab environment IPs

00:09:27.690 --> 00:09:31.632 align:middle line:84%
when performing this
practical demonstration.

00:09:31.632 --> 00:09:33.340 align:middle line:84%
So let me just show
you what will happen.

00:09:33.340 --> 00:09:35.670 align:middle line:84%
So let's try and ping
victim machine one,

00:09:35.670 --> 00:09:38.400 align:middle line:84%
and let's see whether we can
access it from our Kali Linux

00:09:38.400 --> 00:09:39.130 align:middle line:90%
system.

00:09:39.130 --> 00:09:41.640 align:middle line:84%
So I'll open up a terminal
here, and I'll say ping.

00:09:41.640 --> 00:09:46.060 align:middle line:84%
And I'll paste in the
IP of the target one.

00:09:46.060 --> 00:09:48.060 align:middle line:84%
You can see that we
receive a response, which

00:09:48.060 --> 00:09:49.960 align:middle line:90%
means that the system is up.

00:09:49.960 --> 00:09:51.630 align:middle line:84%
And in addition
to that, it means

00:09:51.630 --> 00:09:54.120 align:middle line:84%
that we can access
this system via

00:09:54.120 --> 00:09:57.330 align:middle line:84%
or we can communicate with
the system via our Kali Linux

00:09:57.330 --> 00:09:58.505 align:middle line:90%
system.

00:09:58.505 --> 00:09:59.880 align:middle line:84%
Now, let's try
and see whether we

00:09:59.880 --> 00:10:03.480 align:middle line:90%
can access victim machine two.

00:10:03.480 --> 00:10:06.180 align:middle line:84%
So I'll copy the IP address
there for victim machine two,

00:10:06.180 --> 00:10:09.270 align:middle line:84%
and I'll say ping,
paste it in there.

00:10:09.270 --> 00:10:10.560 align:middle line:90%
And you can see, what's this?

00:10:10.560 --> 00:10:12.000 align:middle line:90%
We don't get a response.

00:10:12.000 --> 00:10:14.350 align:middle line:90%
That's really weird.

00:10:14.350 --> 00:10:16.300 align:middle line:84%
Why aren't we
getting a response?

00:10:16.300 --> 00:10:21.180 align:middle line:84%
Well, that essentially means
that we cannot access this

00:10:21.180 --> 00:10:23.760 align:middle line:84%
target system from
our Kali Linux system,

00:10:23.760 --> 00:10:27.150 align:middle line:84%
and can only access it
from victim machine one.

00:10:27.150 --> 00:10:30.780 align:middle line:84%
So let's perform an Nmap
scan on victim machine one

00:10:30.780 --> 00:10:34.350 align:middle line:84%
to identify the vulnerable
service that's running on it.

00:10:34.350 --> 00:10:36.660 align:middle line:84%
So I'll open up a
terminal again in here.

00:10:36.660 --> 00:10:39.060 align:middle line:84%
And I'll zoom in so you
can see what's going on.

00:10:39.060 --> 00:10:43.800 align:middle line:84%
And I'll say Nmap sv and I'll
perform or limit the port scan

00:10:43.800 --> 00:10:46.440 align:middle line:84%
to port 80, because
that's the port that

00:10:46.440 --> 00:10:48.540 align:middle line:84%
has the vulnerable
service, and I'll

00:10:48.540 --> 00:10:52.350 align:middle line:84%
paste in the target or
victim one's IP address here.

00:10:52.350 --> 00:10:53.760 align:middle line:90%
So I'll hit Enter.

00:10:53.760 --> 00:10:55.290 align:middle line:84%
We'll give this a
couple of seconds.

00:10:55.290 --> 00:10:58.670 align:middle line:90%


00:10:58.670 --> 00:11:00.800 align:middle line:84%
So the Nmap scan is
complete, and we can

00:11:00.800 --> 00:11:03.200 align:middle line:90%
see that we have port 80 open.

00:11:03.200 --> 00:11:05.390 align:middle line:84%
And the service that's
running on port 80

00:11:05.390 --> 00:11:08.630 align:middle line:84%
is the HTTP file
server version 2.3.

00:11:08.630 --> 00:11:11.660 align:middle line:84%
We can, of course, confirm
this by opening up or accessing

00:11:11.660 --> 00:11:15.500 align:middle line:84%
that port on victim one
through our web browser.

00:11:15.500 --> 00:11:18.770 align:middle line:84%
And you can see, indeed it is
running the HTTP file server

00:11:18.770 --> 00:11:21.950 align:middle line:84%
version 2.3 that is
developed by Rejetto.

00:11:21.950 --> 00:11:25.370 align:middle line:84%
Now, this specific version
of HTTP file server

00:11:25.370 --> 00:11:30.320 align:middle line:84%
is vulnerable to an exploit, and
this exploit is also available

00:11:30.320 --> 00:11:32.570 align:middle line:84%
as a Metasploit
framework exploit module.

00:11:32.570 --> 00:11:34.880 align:middle line:90%
So I'll just say Rejetto.

00:11:34.880 --> 00:11:37.970 align:middle line:84%
So exploit Rejetto and you
can see there is a Metasploit

00:11:37.970 --> 00:11:42.080 align:middle line:84%
framework exploit module
here, remote command execution

00:11:42.080 --> 00:11:43.760 align:middle line:90%
for version 2.3.

00:11:43.760 --> 00:11:47.980 align:middle line:84%
And, of course, we can
open up MSF console now.

00:11:47.980 --> 00:11:49.840 align:middle line:84%
And we'll give this
a couple of seconds.

00:11:49.840 --> 00:11:51.590 align:middle line:84%
We don't really
need our browser.

00:11:51.590 --> 00:11:55.010 align:middle line:84%
So I'll just get
rid of that there.

00:11:55.010 --> 00:12:00.170 align:middle line:84%
And we will say search
Rejetto, there we go.

00:12:00.170 --> 00:12:05.560 align:middle line:84%
And I'll say use 0 and I'm
specifying the module ID.

00:12:05.560 --> 00:12:09.220 align:middle line:84%
And then I'll say set our
hosts or the target IP,

00:12:09.220 --> 00:12:12.730 align:middle line:84%
and I'll specify the IP
address of victim one.

00:12:12.730 --> 00:12:13.720 align:middle line:90%
There we are.

00:12:13.720 --> 00:12:17.130 align:middle line:84%
If I show the additional
options for this module,

00:12:17.130 --> 00:12:21.030 align:middle line:84%
I have the ability of setting
up the payload option.

00:12:21.030 --> 00:12:23.550 align:middle line:84%
So the lhost option and
the lport option, these

00:12:23.550 --> 00:12:24.930 align:middle line:90%
are already set for me.

00:12:24.930 --> 00:12:26.910 align:middle line:84%
And we have already
set the target IP.

00:12:26.910 --> 00:12:29.220 align:middle line:84%
So I can type in
exploit, and this

00:12:29.220 --> 00:12:31.260 align:middle line:84%
will provide us with
a Meterpreter session

00:12:31.260 --> 00:12:33.720 align:middle line:90%
on the target system.

00:12:33.720 --> 00:12:34.510 align:middle line:90%
There we go.

00:12:34.510 --> 00:12:39.000 align:middle line:84%
So we get a Meterpreter
session, and we'll

00:12:39.000 --> 00:12:40.410 align:middle line:90%
give this a couple of seconds.

00:12:40.410 --> 00:12:41.080 align:middle line:90%
There we are.

00:12:41.080 --> 00:12:43.410 align:middle line:84%
And we can perform
some local enumeration.

00:12:43.410 --> 00:12:45.210 align:middle line:90%
So I'll say sysinfo.

00:12:45.210 --> 00:12:48.360 align:middle line:84%
You can see that this
system, victim one,

00:12:48.360 --> 00:12:51.270 align:middle line:84%
and let me just
open up the actual--

00:12:51.270 --> 00:12:54.660 align:middle line:84%
you can see this is victim
machine one is running Windows

00:12:54.660 --> 00:12:58.260 align:middle line:90%
Server 2012 R2 build 9,600.

00:12:58.260 --> 00:13:01.590 align:middle line:84%
It is a 64-bit version
of Windows Server.

00:13:01.590 --> 00:13:03.360 align:middle line:90%
And we say get user ID.

00:13:03.360 --> 00:13:06.360 align:middle line:84%
You can see that we currently
have access to victim one

00:13:06.360 --> 00:13:09.060 align:middle line:84%
as the administrator
user, which means that we

00:13:09.060 --> 00:13:10.830 align:middle line:90%
have an elevated session.

00:13:10.830 --> 00:13:14.400 align:middle line:84%
And that means that we do not
need to elevate our privileges.

00:13:14.400 --> 00:13:17.670 align:middle line:84%
So the next step, of course,
is to type in the IP config

00:13:17.670 --> 00:13:19.680 align:middle line:90%
command as you already remember.

00:13:19.680 --> 00:13:21.820 align:middle line:84%
And if we take a look
at the interfaces,

00:13:21.820 --> 00:13:24.240 align:middle line:84%
we can see that we have the
loopback interface, which

00:13:24.240 --> 00:13:25.060 align:middle line:90%
is fine.

00:13:25.060 --> 00:13:29.430 align:middle line:84%
We also have a Microsoft
ISATAP adapter here.

00:13:29.430 --> 00:13:33.270 align:middle line:84%
And the current interface
that this system is using

00:13:33.270 --> 00:13:36.010 align:middle line:84%
and the network that it is
a part of is the following.

00:13:36.010 --> 00:13:38.580 align:middle line:84%
So this is the AWS
PV network device.

00:13:38.580 --> 00:13:41.790 align:middle line:84%
And this is the IP address of
victim one, which makes sense.

00:13:41.790 --> 00:13:44.190 align:middle line:84%
And this is the
IPv4 netmask, which

00:13:44.190 --> 00:13:47.130 align:middle line:84%
gives us an idea as
to the actual size

00:13:47.130 --> 00:13:48.580 align:middle line:90%
or range of the network.

00:13:48.580 --> 00:13:52.890 align:middle line:84%
In this case, the actual subnet
is limited to, as you can see,

00:13:52.890 --> 00:13:56.310 align:middle line:90%
240 devices or IP addresses.

00:13:56.310 --> 00:13:58.240 align:middle line:90%
This will become very important.

00:13:58.240 --> 00:14:00.270 align:middle line:84%
So what we need
to do now is we've

00:14:00.270 --> 00:14:03.240 align:middle line:84%
identified that it is
only part of one network,

00:14:03.240 --> 00:14:06.250 align:middle line:84%
and this network has
other devices on it.

00:14:06.250 --> 00:14:09.900 align:middle line:84%
So how do we scan for these
other systems on that network?

00:14:09.900 --> 00:14:12.780 align:middle line:84%
Well, we already know
the target IP address

00:14:12.780 --> 00:14:14.370 align:middle line:90%
of victim machine two.

00:14:14.370 --> 00:14:18.300 align:middle line:84%
But before we do that,
we need to add a route.

00:14:18.300 --> 00:14:20.220 align:middle line:84%
Now, the route will
essentially allow

00:14:20.220 --> 00:14:24.660 align:middle line:84%
us to access victim machine
two from victim machine one.

00:14:24.660 --> 00:14:25.970 align:middle line:90%
So how do we add this route?

00:14:25.970 --> 00:14:29.370 align:middle line:84%
Well, we want to add the
route for this entire--

00:14:29.370 --> 00:14:31.680 align:middle line:90%
or for this particular subnet.

00:14:31.680 --> 00:14:36.160 align:middle line:84%
So we can say run autoroute,
and we're specifying the subnet.

00:14:36.160 --> 00:14:37.540 align:middle line:90%
So we specify the subnet.

00:14:37.540 --> 00:14:42.720 align:middle line:84%
So 10.0.29-- and instead of
saying the-- or specifying

00:14:42.720 --> 00:14:47.910 align:middle line:84%
the IP address of the victim
machine one, we say 0.0/20.

00:14:47.910 --> 00:14:51.840 align:middle line:84%
So we're essentially adding a
route to this entire subnet.

00:14:51.840 --> 00:14:54.150 align:middle line:84%
And in your case, make
sure to replace it

00:14:54.150 --> 00:14:57.870 align:middle line:84%
with the actual subnet of
victim machine one in your lab

00:14:57.870 --> 00:14:58.930 align:middle line:90%
environment.

00:14:58.930 --> 00:15:01.583 align:middle line:90%
So I'll hit Enter.

00:15:01.583 --> 00:15:03.000 align:middle line:84%
And you can see
it's going to tell

00:15:03.000 --> 00:15:06.250 align:middle line:84%
you right over here adding
route to that particular subnet.

00:15:06.250 --> 00:15:11.370 align:middle line:84%
And it's added the route, and we
can essentially say autoroute p

00:15:11.370 --> 00:15:13.060 align:middle line:90%
to list all the active routes.

00:15:13.060 --> 00:15:15.540 align:middle line:90%
And I can say autoroute--

00:15:15.540 --> 00:15:18.060 align:middle line:84%
let me just type
that in correctly.

00:15:18.060 --> 00:15:23.310 align:middle line:84%
So autoroute-- let me
just say, run autoroute.

00:15:23.310 --> 00:15:26.470 align:middle line:90%


00:15:26.470 --> 00:15:29.920 align:middle line:84%
And I can then say,
p for example here.

00:15:29.920 --> 00:15:32.330 align:middle line:84%
And this will display
the active routing table.

00:15:32.330 --> 00:15:35.410 align:middle line:84%
So the actual gateway
is session one.

00:15:35.410 --> 00:15:38.530 align:middle line:84%
So what this means is
that when we want--

00:15:38.530 --> 00:15:41.410 align:middle line:84%
we have already added a
route within MSF console,

00:15:41.410 --> 00:15:44.500 align:middle line:84%
and that means that we can
essentially perform a scan

00:15:44.500 --> 00:15:49.030 align:middle line:84%
or access any device on that
subnet from within MSF console.

00:15:49.030 --> 00:15:50.860 align:middle line:84%
So now that we've
added the route,

00:15:50.860 --> 00:15:54.610 align:middle line:84%
the next step, of course, is
to put this Meterpreter session

00:15:54.610 --> 00:15:56.690 align:middle line:90%
in the background.

00:15:56.690 --> 00:16:00.230 align:middle line:84%
And because we can only
access the victim machine two

00:16:00.230 --> 00:16:05.630 align:middle line:84%
from within MSF console, we need
to utilize the in-built port

00:16:05.630 --> 00:16:07.970 align:middle line:84%
scanner, TCP port
scanner module.

00:16:07.970 --> 00:16:11.840 align:middle line:90%
So we'll say search port scan.

00:16:11.840 --> 00:16:14.270 align:middle line:84%
And we are going to be
using this one here.

00:16:14.270 --> 00:16:15.860 align:middle line:90%
So that has an ID of five.

00:16:15.860 --> 00:16:17.600 align:middle line:90%
So I'll say, use five.

00:16:17.600 --> 00:16:21.880 align:middle line:84%
I'll show the options
here, and we can all

00:16:21.880 --> 00:16:23.530 align:middle line:90%
specify the target IP.

00:16:23.530 --> 00:16:25.030 align:middle line:84%
And in this case,
we're going to say

00:16:25.030 --> 00:16:28.000 align:middle line:84%
we want to scan the
following right over here.

00:16:28.000 --> 00:16:30.250 align:middle line:84%
And you can obviously
tell that this device

00:16:30.250 --> 00:16:35.020 align:middle line:84%
is part of the same subnet
that victim machine one is on.

00:16:35.020 --> 00:16:37.330 align:middle line:84%
So you can see that
victim machine one has

00:16:37.330 --> 00:16:41.710 align:middle line:90%
an IP address of 10.0.29.148.

00:16:41.710 --> 00:16:45.610 align:middle line:90%
Victim machine two, 10.0.29.96.

00:16:45.610 --> 00:16:49.900 align:middle line:84%
However, it can only be accessed
from victim machine one.

00:16:49.900 --> 00:16:52.180 align:middle line:84%
So we'll just copy
that there, and I'll

00:16:52.180 --> 00:16:54.430 align:middle line:84%
say set our hosts because
we want to perform

00:16:54.430 --> 00:16:56.495 align:middle line:90%
a scan on victim machine two.

00:16:56.495 --> 00:16:58.120 align:middle line:84%
Now, and because
we've added the route,

00:16:58.120 --> 00:17:02.020 align:middle line:84%
we can actually communicate with
it through victim machine one.

00:17:02.020 --> 00:17:04.510 align:middle line:84%
And we are going to
set the port range.

00:17:04.510 --> 00:17:08.170 align:middle line:84%
So ports, we'll set
that to 1 to 100,

00:17:08.170 --> 00:17:10.569 align:middle line:84%
and I'll just type
in exploit or run.

00:17:10.569 --> 00:17:13.990 align:middle line:84%
And this will discover the open
ports on victim machine two.

00:17:13.990 --> 00:17:16.180 align:middle line:84%
And remember, the scanning
is being performed

00:17:16.180 --> 00:17:18.220 align:middle line:90%
through victim machine one.

00:17:18.220 --> 00:17:19.910 align:middle line:90%
Because we cannot do this.

00:17:19.910 --> 00:17:23.560 align:middle line:84%
We cannot access victim machine
two through our Kali Linux

00:17:23.560 --> 00:17:24.470 align:middle line:90%
system.

00:17:24.470 --> 00:17:27.099 align:middle line:84%
So you can see that
on victim machine two,

00:17:27.099 --> 00:17:32.320 align:middle line:84%
the only port that's open is
TCP port 80, which is presumably

00:17:32.320 --> 00:17:34.280 align:middle line:90%
hosting a web server.

00:17:34.280 --> 00:17:38.410 align:middle line:84%
So the next step now is to
identify the exact service

00:17:38.410 --> 00:17:42.550 align:middle line:84%
version that is running on
port 80 on victim machine two.

00:17:42.550 --> 00:17:45.850 align:middle line:84%
Now, unfortunately,
we can utilize

00:17:45.850 --> 00:17:48.160 align:middle line:84%
a couple of Metasploit
modules to do this,

00:17:48.160 --> 00:17:51.530 align:middle line:84%
to enumerate the exact service
version that's running.

00:17:51.530 --> 00:17:54.580 align:middle line:84%
However, it'll be much better
if we can perform it with Nmap

00:17:54.580 --> 00:17:56.350 align:middle line:90%
to get an accurate idea.

00:17:56.350 --> 00:18:00.790 align:middle line:84%
And given the fact that we
cannot run Nmap from within MSF

00:18:00.790 --> 00:18:01.300 align:middle line:90%
console.

00:18:01.300 --> 00:18:04.870 align:middle line:84%
And Nmap is a separate tool
from the Metasploit framework,

00:18:04.870 --> 00:18:06.700 align:middle line:84%
we need to perform
port forwarding

00:18:06.700 --> 00:18:11.800 align:middle line:84%
or rather we need to forward
this particular remote port 80

00:18:11.800 --> 00:18:14.560 align:middle line:84%
to our Kali Linux
system on port--

00:18:14.560 --> 00:18:15.970 align:middle line:90%
whatever port we specify.

00:18:15.970 --> 00:18:18.460 align:middle line:84%
And in this case,
we'll use port 1234

00:18:18.460 --> 00:18:20.270 align:middle line:90%
for the sake of simplicity.

00:18:20.270 --> 00:18:21.970 align:middle line:84%
So if I list out
my sessions, I'll

00:18:21.970 --> 00:18:25.540 align:middle line:84%
go back to our session
on victim machine one.

00:18:25.540 --> 00:18:28.540 align:middle line:84%
So sessions one and to
perform the port forwarding,

00:18:28.540 --> 00:18:30.760 align:middle line:90%
I'm going to say port forward.

00:18:30.760 --> 00:18:32.980 align:middle line:90%
So port fwd.

00:18:32.980 --> 00:18:36.550 align:middle line:84%
And I'm going to say
add, so I'm adding a--

00:18:36.550 --> 00:18:38.060 align:middle line:90%
I'm performing port forwarding.

00:18:38.060 --> 00:18:42.040 align:middle line:84%
So first, we want to specify the
local port, which in this case,

00:18:42.040 --> 00:18:43.930 align:middle line:90%
is port 1234.

00:18:43.930 --> 00:18:50.770 align:middle line:84%
And we then specify the
remote port, which is port 80.

00:18:50.770 --> 00:18:54.880 align:middle line:84%
And the remote system that we're
performing the port forwarding

00:18:54.880 --> 00:18:57.190 align:middle line:84%
on right and in
this case, we want

00:18:57.190 --> 00:19:00.040 align:middle line:84%
to specify the IP address
of the victim machine

00:19:00.040 --> 00:19:02.830 align:middle line:84%
two, because that's
the system and the port

00:19:02.830 --> 00:19:05.440 align:middle line:84%
that we essentially performing
port forwarding for.

00:19:05.440 --> 00:19:07.240 align:middle line:84%
So we're essentially
saying I want

00:19:07.240 --> 00:19:09.260 align:middle line:90%
you to add the following port.

00:19:09.260 --> 00:19:10.790 align:middle line:90%
So this is the local port 120--

00:19:10.790 --> 00:19:12.640 align:middle line:90%
1234.

00:19:12.640 --> 00:19:15.850 align:middle line:84%
And we are forwarding port
80 on victim machine two

00:19:15.850 --> 00:19:19.130 align:middle line:84%
to port 1234 on the
Kali Linux system.

00:19:19.130 --> 00:19:22.270 align:middle line:84%
So that means we will be able
to access the service that's

00:19:22.270 --> 00:19:25.300 align:middle line:84%
running on victim
machine two on port 80

00:19:25.300 --> 00:19:28.480 align:middle line:84%
on our Kali Linux
system on port 1234.

00:19:28.480 --> 00:19:30.310 align:middle line:84%
And if we hit Enter,
you can see it's

00:19:30.310 --> 00:19:33.140 align:middle line:84%
going to tell you that the
local TCP relay is created.

00:19:33.140 --> 00:19:39.550 align:middle line:84%
So the local port 1234 on our
Kali Linux system to the remote

00:19:39.550 --> 00:19:42.670 align:middle line:84%
or to victim machine
two on port 80.

00:19:42.670 --> 00:19:46.090 align:middle line:84%
Now that is done, we can
open up a new tab here.

00:19:46.090 --> 00:19:49.210 align:middle line:84%
And because that port is
forwarded to port 1234

00:19:49.210 --> 00:19:52.990 align:middle line:84%
on our the Kali Linux
system, we can say Nmap sv

00:19:52.990 --> 00:19:55.510 align:middle line:90%
for service version detection.

00:19:55.510 --> 00:19:58.343 align:middle line:84%
And the port that we
want to scan is 1234.

00:19:58.343 --> 00:20:00.760 align:middle line:84%
And because we are doing this
on our calendar next system,

00:20:00.760 --> 00:20:02.650 align:middle line:90%
we can simply say local host.

00:20:02.650 --> 00:20:04.210 align:middle line:84%
And the reason we
are doing this is

00:20:04.210 --> 00:20:07.510 align:middle line:84%
to identify the exact
service that's running.

00:20:07.510 --> 00:20:09.640 align:middle line:90%
So I'll hit Enter here.

00:20:09.640 --> 00:20:11.740 align:middle line:84%
And in a couple of
seconds, it should tell us

00:20:11.740 --> 00:20:17.465 align:middle line:84%
what service is running on
port 80 on victim machine two.

00:20:17.465 --> 00:20:19.090 align:middle line:84%
So we'll give this
a couple of seconds.

00:20:19.090 --> 00:20:22.310 align:middle line:90%


00:20:22.310 --> 00:20:23.690 align:middle line:90%
The Nmap scan is complete.

00:20:23.690 --> 00:20:26.420 align:middle line:84%
And you can see that
through our port forwarding,

00:20:26.420 --> 00:20:30.140 align:middle line:84%
it's able to identify that
victim machine two has

00:20:30.140 --> 00:20:34.280 align:middle line:84%
the bad blue service
running on port 80,

00:20:34.280 --> 00:20:36.710 align:middle line:84%
and this is bad
blue version 2.7.

00:20:36.710 --> 00:20:40.020 align:middle line:84%
So that's really why we
performed port forwarding.

00:20:40.020 --> 00:20:41.750 align:middle line:84%
So now, that we've
identified that,

00:20:41.750 --> 00:20:44.030 align:middle line:84%
we can actually exploit
victim machine two

00:20:44.030 --> 00:20:45.920 align:middle line:90%
from within MSF console.

00:20:45.920 --> 00:20:49.930 align:middle line:84%
So I'll put this
in the background.

00:20:49.930 --> 00:20:52.150 align:middle line:84%
And we will search for
the bad blue exploit

00:20:52.150 --> 00:20:54.010 align:middle line:90%
module for version 2.7.

00:20:54.010 --> 00:20:56.660 align:middle line:84%
So search bad blue, and
this is the one here.

00:20:56.660 --> 00:20:59.500 align:middle line:84%
So that is the bad blue
pass through overflow

00:20:59.500 --> 00:21:01.030 align:middle line:90%
for version 2.7.

00:21:01.030 --> 00:21:05.540 align:middle line:84%
So I'll say use 1, and I'll
just show the options here.

00:21:05.540 --> 00:21:08.020 align:middle line:84%
And there's a few things
that we need to customize.

00:21:08.020 --> 00:21:13.660 align:middle line:84%
So firstly, we actually need
to set up the payload options.

00:21:13.660 --> 00:21:17.680 align:middle line:84%
And we are not going to be
using a reverse TCP payload.

00:21:17.680 --> 00:21:19.390 align:middle line:84%
Instead, going to
be using the bind

00:21:19.390 --> 00:21:25.060 align:middle line:84%
TCP Meterpreter payload,
so I will say set payload.

00:21:25.060 --> 00:21:27.430 align:middle line:84%
So I'll just say
set payload to--

00:21:27.430 --> 00:21:29.890 align:middle line:84%
or I can just type
it in lowercase case.

00:21:29.890 --> 00:21:34.960 align:middle line:84%
So set payload to exploit, or
rather in this case, Windows,

00:21:34.960 --> 00:21:38.025 align:middle line:90%
Meterpreter, find TCP.

00:21:38.025 --> 00:21:40.570 align:middle line:90%


00:21:40.570 --> 00:21:41.650 align:middle line:90%
There we are.

00:21:41.650 --> 00:21:43.660 align:middle line:84%
And we want to
set the target IP.

00:21:43.660 --> 00:21:46.930 align:middle line:84%
So set our host to the IP
address of victim machine two

00:21:46.930 --> 00:21:48.760 align:middle line:84%
because we can
communicate with it

00:21:48.760 --> 00:21:52.120 align:middle line:84%
through or from
within MSF console

00:21:52.120 --> 00:21:54.100 align:middle line:90%
through victim machine one.

00:21:54.100 --> 00:21:55.570 align:middle line:90%
So I'll paste it in there.

00:21:55.570 --> 00:21:59.603 align:middle line:84%
Set the target IP,
and I'll hit exploit.

00:21:59.603 --> 00:22:01.270 align:middle line:84%
And we'll give this
a couple of seconds.

00:22:01.270 --> 00:22:05.310 align:middle line:90%


00:22:05.310 --> 00:22:07.020 align:middle line:84%
As you can see, it's
sending the stage,

00:22:07.020 --> 00:22:10.800 align:middle line:84%
and we receive a Meterpreter
session on victim machine two

00:22:10.800 --> 00:22:14.680 align:middle line:84%
as denoted by the
IP addresses here.

00:22:14.680 --> 00:22:17.220 align:middle line:84%
So we can say
sysinfo, and you can

00:22:17.220 --> 00:22:19.410 align:middle line:84%
see this is a different
operating system that's

00:22:19.410 --> 00:22:20.760 align:middle line:90%
running on victim machine two.

00:22:20.760 --> 00:22:25.560 align:middle line:84%
So Windows Server
2016, build 17763,

00:22:25.560 --> 00:22:29.250 align:middle line:84%
and it's a 64-bit version
of Windows Server 2016.

00:22:29.250 --> 00:22:31.180 align:middle line:90%
We can then say get user ID.

00:22:31.180 --> 00:22:33.510 align:middle line:84%
And we also have access
to victim machine two

00:22:33.510 --> 00:22:35.560 align:middle line:90%
as the administrator user.

00:22:35.560 --> 00:22:38.400 align:middle line:84%
So that is how to
perform pivoting.

00:22:38.400 --> 00:22:40.680 align:middle line:84%
And if I put this
in the background,

00:22:40.680 --> 00:22:43.050 align:middle line:84%
you can see that if I
list out my sessions

00:22:43.050 --> 00:22:45.960 align:middle line:84%
these are sessions
on different systems.

00:22:45.960 --> 00:22:47.640 align:middle line:90%
So you can see that--

00:22:47.640 --> 00:22:50.590 align:middle line:84%
you can actually tell that
from the IP addresses.

00:22:50.590 --> 00:22:55.050 align:middle line:84%
So you can see right over
here that these are the IP

00:22:55.050 --> 00:22:58.290 align:middle line:84%
addresses, and this is
victim machine one and victim

00:22:58.290 --> 00:22:59.980 align:middle line:90%
machine two.

00:22:59.980 --> 00:23:02.510 align:middle line:84%
So just to summarize
what we've done,

00:23:02.510 --> 00:23:05.890 align:middle line:84%
we firstly gained access
to victim machine one,

00:23:05.890 --> 00:23:09.520 align:middle line:84%
which we could access
through our Kali Linux system

00:23:09.520 --> 00:23:10.870 align:middle line:90%
without any issues.

00:23:10.870 --> 00:23:14.110 align:middle line:84%
Once we gain access
to victim machine one,

00:23:14.110 --> 00:23:18.850 align:middle line:84%
we essentially added a
route and we added a route

00:23:18.850 --> 00:23:21.520 align:middle line:90%
to the subnet of the network.

00:23:21.520 --> 00:23:24.160 align:middle line:84%
That victim machine one
and victim machine two

00:23:24.160 --> 00:23:28.960 align:middle line:84%
are a part of, and that allowed
us to access or to communicate

00:23:28.960 --> 00:23:31.690 align:middle line:84%
with victim machine two
through victim machine

00:23:31.690 --> 00:23:35.530 align:middle line:90%
one within MSF console.

00:23:35.530 --> 00:23:37.420 align:middle line:84%
Once we were able
to do that, we were

00:23:37.420 --> 00:23:40.870 align:middle line:84%
able to identify the open
ports on victim machine two.

00:23:40.870 --> 00:23:44.620 align:middle line:84%
However, in order to identify
the service version that

00:23:44.620 --> 00:23:47.200 align:middle line:84%
is running on port 80
on victim machine two,

00:23:47.200 --> 00:23:50.500 align:middle line:84%
we needed to forward
that remote port

00:23:50.500 --> 00:23:54.230 align:middle line:84%
onto a local port on
our Kali Linux system.

00:23:54.230 --> 00:23:56.140 align:middle line:84%
So that we can
perform an Nmap scan

00:23:56.140 --> 00:23:59.350 align:middle line:84%
to identify the exact service
version, which we did.

00:23:59.350 --> 00:24:02.020 align:middle line:84%
We then performed the
Nmap scan and identify

00:24:02.020 --> 00:24:07.090 align:middle line:84%
that bad blue is running on
port 80 on victim machine two.

00:24:07.090 --> 00:24:10.960 align:middle line:84%
And then utilize that
exploit module to gain access

00:24:10.960 --> 00:24:13.900 align:middle line:84%
to victim machine two or to
exploit the bad blue service

00:24:13.900 --> 00:24:16.330 align:middle line:84%
running on port 80
on victim machine two

00:24:16.330 --> 00:24:18.940 align:middle line:90%
through victim machine one.

00:24:18.940 --> 00:24:22.030 align:middle line:84%
So that concludes the
practical demonstration side

00:24:22.030 --> 00:24:24.640 align:middle line:90%
of this video.

00:24:24.640 --> 00:24:27.610 align:middle line:84%
So you should now have an
understanding of the pivoting

00:24:27.610 --> 00:24:30.400 align:middle line:84%
process, and how it
can be performed,

00:24:30.400 --> 00:24:32.170 align:middle line:90%
how to perform port forwarding.

00:24:32.170 --> 00:24:33.790 align:middle line:84%
And, of course,
in this video, we

00:24:33.790 --> 00:24:35.530 align:middle line:84%
focus primarily
on how to do this

00:24:35.530 --> 00:24:37.940 align:middle line:84%
through the use of the
Metasploit framework.

00:24:37.940 --> 00:24:40.240 align:middle line:84%
And again, that's a
good starting point.

00:24:40.240 --> 00:24:42.070 align:middle line:84%
And this will give
you an understanding

00:24:42.070 --> 00:24:44.420 align:middle line:90%
of what pivoting entails.

00:24:44.420 --> 00:24:47.690 align:middle line:84%
Now, the great thing about
this particular section,

00:24:47.690 --> 00:24:50.470 align:middle line:84%
which we have actually
come to a conclusion on,

00:24:50.470 --> 00:24:55.390 align:middle line:84%
is the fact that once you
gain access to another system,

00:24:55.390 --> 00:24:57.430 align:middle line:84%
once you pivot onto
another system,

00:24:57.430 --> 00:25:00.340 align:middle line:84%
you essentially go through
the entire post exploitation

00:25:00.340 --> 00:25:00.940 align:middle line:90%
phase again.

00:25:00.940 --> 00:25:04.390 align:middle line:84%
So when we compromise
victim machine two,

00:25:04.390 --> 00:25:07.210 align:middle line:84%
we would essentially need to
perform local enumeration.

00:25:07.210 --> 00:25:10.060 align:middle line:84%
We could also automate
it if we needed

00:25:10.060 --> 00:25:13.030 align:middle line:84%
to elevate our privileges,
we could do that.

00:25:13.030 --> 00:25:15.220 align:middle line:84%
If we wanted to transfer
files, we could also

00:25:15.220 --> 00:25:16.640 align:middle line:90%
do that et cetera, et cetera.

00:25:16.640 --> 00:25:20.470 align:middle line:84%
So that's the great thing about
the pivoting phase of post

00:25:20.470 --> 00:25:23.710 align:middle line:84%
exploitation that I really
like is that from that point

00:25:23.710 --> 00:25:26.780 align:middle line:84%
onwards, once you gain
access to another system,

00:25:26.780 --> 00:25:32.650 align:middle line:84%
you then go through the post
exploitation phases again.

00:25:32.650 --> 00:25:34.300 align:middle line:84%
And that process
repeats once you

00:25:34.300 --> 00:25:37.700 align:middle line:84%
gain access to another system,
and another system, et cetera,

00:25:37.700 --> 00:25:38.450 align:middle line:90%
et cetera.

00:25:38.450 --> 00:25:40.330 align:middle line:84%
So now, that we have
explored pivoting,

00:25:40.330 --> 00:25:43.190 align:middle line:84%
we're going to move on to the
final section of this course,

00:25:43.190 --> 00:25:46.270 align:middle line:84%
which will cover the process
of how to clear your tracks

00:25:46.270 --> 00:25:50.170 align:middle line:84%
and artifacts from the
exploitation and post

00:25:50.170 --> 00:25:53.800 align:middle line:84%
exploitation phase once
you're done on the system

00:25:53.800 --> 00:25:56.620 align:middle line:84%
that you have compromised, how
to get rid of all the tracks.

00:25:56.620 --> 00:26:00.730 align:middle line:84%
And this is not just pertinent
to avoiding detection.

00:26:00.730 --> 00:26:03.880 align:middle line:84%
It is also pertinent to
the rules of engagement

00:26:03.880 --> 00:26:06.040 align:middle line:84%
that you agreed upon
with your client

00:26:06.040 --> 00:26:08.010 align:middle line:84%
before you began the
penetration test.

00:26:08.010 --> 00:26:11.560 align:middle line:84%
So I'll be going through
a few important factors

00:26:11.560 --> 00:26:14.470 align:middle line:84%
that you need to take into
consideration regarding how

00:26:14.470 --> 00:26:18.580 align:middle line:84%
to clear any artifacts or
remnants that you created

00:26:18.580 --> 00:26:22.420 align:middle line:84%
on the target systems during
the post exploitation phase.

00:26:22.420 --> 00:26:26.500 align:middle line:84%
With that being said, I'll be
seeing you in the next video.

00:26:26.500 --> 00:26:27.000 align:middle line:90%