WEBVTT

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


00:00:09.810 --> 00:00:11.550 align:middle line:90%
Pass-the-Hash Attacks.

00:00:11.550 --> 00:00:14.460 align:middle line:84%
All right, so we've
obtained NTLM hashes.

00:00:14.460 --> 00:00:17.530 align:middle line:84%
What can we do with them
apart from cracking them,

00:00:17.530 --> 00:00:19.330 align:middle line:84%
which we will cover
in another course?

00:00:19.330 --> 00:00:23.145 align:middle line:84%
But for now, what can we
do as a penetration test

00:00:23.145 --> 00:00:24.240 align:middle line:90%
with these hashes?

00:00:24.240 --> 00:00:27.090 align:middle line:84%
Well, what we can
do is we can perform

00:00:27.090 --> 00:00:29.940 align:middle line:84%
what is known as a
pass-the-hash attack.

00:00:29.940 --> 00:00:33.540 align:middle line:84%
So what is a
pass-the-hash attack?

00:00:33.540 --> 00:00:36.480 align:middle line:84%
Well, pass-the-hash is
an exploitation technique

00:00:36.480 --> 00:00:39.030 align:middle line:84%
that involves
capturing or harvesting

00:00:39.030 --> 00:00:41.910 align:middle line:84%
NTLM hashes or
clear-text passwords

00:00:41.910 --> 00:00:44.010 align:middle line:84%
and utilizing them
to authenticate

00:00:44.010 --> 00:00:47.760 align:middle line:84%
with the target
legitimately via SMB.

00:00:47.760 --> 00:00:51.780 align:middle line:84%
So in order to do this, we
can utilize various tools,

00:00:51.780 --> 00:00:53.925 align:middle line:84%
and of course, I'm not
going to be going over

00:00:53.925 --> 00:00:57.420 align:middle line:84%
a list of all the tools you can
perform a pass-the-hash attack

00:00:57.420 --> 00:01:02.070 align:middle line:84%
with, but one of the great
ones is the Metasploit PsExec

00:01:02.070 --> 00:01:05.160 align:middle line:90%
module as well as Crackmapexec.

00:01:05.160 --> 00:01:08.640 align:middle line:84%
So I'll be demonstrating
how we can use our hashes

00:01:08.640 --> 00:01:10.860 align:middle line:84%
or the NTLM hashes
that we extracted

00:01:10.860 --> 00:01:14.400 align:middle line:84%
from the previous video in order
to authenticate with the target

00:01:14.400 --> 00:01:16.345 align:middle line:90%
legitimately via SMB.

00:01:16.345 --> 00:01:17.970 align:middle line:84%
All right, so it's
going to be awesome.

00:01:17.970 --> 00:01:19.830 align:middle line:84%
So this technique
will essentially

00:01:19.830 --> 00:01:22.290 align:middle line:84%
allow us to obtain
access to the target

00:01:22.290 --> 00:01:24.600 align:middle line:84%
system via legitimate
credentials

00:01:24.600 --> 00:01:27.670 align:middle line:84%
as opposed to obtaining access
via service exploitation.

00:01:27.670 --> 00:01:30.690 align:middle line:90%
So, in this case, and in--

00:01:30.690 --> 00:01:34.290 align:middle line:84%
as you will see, during the
actual practical demonstration,

00:01:34.290 --> 00:01:37.140 align:middle line:84%
having a hash can
be just as useful

00:01:37.140 --> 00:01:38.940 align:middle line:90%
as having a clear-text password.

00:01:38.940 --> 00:01:41.470 align:middle line:84%
And of course, a clear-text
password is much more useful.

00:01:41.470 --> 00:01:43.320 align:middle line:84%
But if you have a
hash, you can still

00:01:43.320 --> 00:01:46.560 align:middle line:84%
utilize that particular hash
to gain access to the target

00:01:46.560 --> 00:01:48.190 align:middle line:90%
system whenever you want.

00:01:48.190 --> 00:01:50.490 align:middle line:84%
So you might be asking
yourself a question.

00:01:50.490 --> 00:01:52.510 align:middle line:90%
Well, why is this important?

00:01:52.510 --> 00:01:55.140 align:middle line:84%
If I've already obtained
administrative access

00:01:55.140 --> 00:01:57.630 align:middle line:84%
on a target system
on a Windows target,

00:01:57.630 --> 00:02:00.060 align:middle line:84%
why would I need to
authenticate again and then

00:02:00.060 --> 00:02:02.850 align:middle line:84%
gain access to the same
meterpreter session

00:02:02.850 --> 00:02:05.670 align:middle line:84%
or reverse shell with
administrative access?

00:02:05.670 --> 00:02:08.130 align:middle line:84%
Well, the reason for
that is fairly simple.

00:02:08.130 --> 00:02:10.830 align:middle line:84%
Well, let's say the
actual vulnerable service

00:02:10.830 --> 00:02:13.440 align:middle line:84%
that you have exploited
in order to gain access

00:02:13.440 --> 00:02:16.350 align:middle line:84%
to the target in the
first place is patched,

00:02:16.350 --> 00:02:18.630 align:middle line:84%
or that service is
completely disabled,

00:02:18.630 --> 00:02:21.360 align:middle line:84%
or a firewall rule
has been enabled,

00:02:21.360 --> 00:02:24.060 align:middle line:84%
therefore preventing
you from connecting

00:02:24.060 --> 00:02:26.910 align:middle line:84%
to that particular port or
from exploiting that service.

00:02:26.910 --> 00:02:28.420 align:middle line:90%
Well, what do you do then?

00:02:28.420 --> 00:02:31.620 align:middle line:84%
Well, if you had got the
actual administrator hash,

00:02:31.620 --> 00:02:33.990 align:middle line:84%
you can use that same
hash to gain access

00:02:33.990 --> 00:02:36.390 align:middle line:84%
to the target system
irregardless of

00:02:36.390 --> 00:02:38.640 align:middle line:84%
whether or not the actual
vulnerable service has

00:02:38.640 --> 00:02:39.420 align:middle line:90%
been patched.

00:02:39.420 --> 00:02:42.000 align:middle line:84%
And this, again, is
a form of persistence

00:02:42.000 --> 00:02:45.180 align:middle line:84%
that, again, will help you
maintain access to a target

00:02:45.180 --> 00:02:48.930 align:middle line:84%
system even if the original
vulnerable service has been

00:02:48.930 --> 00:02:50.650 align:middle line:90%
patched or has been disabled.

00:02:50.650 --> 00:02:51.150 align:middle line:90%
All right.

00:02:51.150 --> 00:02:53.220 align:middle line:84%
So now that we know what
we're going to be doing

00:02:53.220 --> 00:02:56.580 align:middle line:84%
or what the pass-the-hash
attack entails let's

00:02:56.580 --> 00:02:59.393 align:middle line:84%
continue from where we left
off in the previous video.

00:02:59.393 --> 00:03:01.560 align:middle line:84%
So we're going to be using
the same lab environment.

00:03:01.560 --> 00:03:03.240 align:middle line:84%
It should be attached
to this video.

00:03:03.240 --> 00:03:06.450 align:middle line:84%
And we're going to start off by
exploiting the BadBlue service.

00:03:06.450 --> 00:03:07.920 align:middle line:84%
And then, once
we've gained access,

00:03:07.920 --> 00:03:10.530 align:middle line:84%
we'll dump the hashes
again with Kiwi,

00:03:10.530 --> 00:03:12.120 align:middle line:84%
and we'll then
take a look at how

00:03:12.120 --> 00:03:14.820 align:middle line:84%
to use the hashes to perform
a pass-the-hash attack.

00:03:14.820 --> 00:03:15.360 align:middle line:90%
All right.

00:03:15.360 --> 00:03:18.610 align:middle line:84%
So let's switch over
into the lab environment,

00:03:18.610 --> 00:03:20.600 align:middle line:90%
and I'll see you there.

00:03:20.600 --> 00:03:21.100 align:middle line:90%
All right.

00:03:21.100 --> 00:03:23.000 align:middle line:84%
So I'm back within
the lab environment.

00:03:23.000 --> 00:03:25.272 align:middle line:84%
And of course, you'll be
provided with the target IP,

00:03:25.272 --> 00:03:26.480 align:middle line:90%
which I'm just going to copy.

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

00:03:29.030 --> 00:03:31.720 align:middle line:84%
So given that we know what
service we're exploiting,

00:03:31.720 --> 00:03:34.720 align:middle line:84%
we can automatically
just open up MSF console.

00:03:34.720 --> 00:03:36.700 align:middle line:84%
So I'm just going to
open up a terminal here,

00:03:36.700 --> 00:03:37.600 align:middle line:90%
and I'll zoom in.

00:03:37.600 --> 00:03:45.400 align:middle line:84%
So we'll say service postgresql
start and msfconsole.

00:03:45.400 --> 00:03:48.040 align:middle line:84%
And we can then search for
the BadBlue exploit module,

00:03:48.040 --> 00:03:51.520 align:middle line:84%
and we can essentially gain
access to the target system

00:03:51.520 --> 00:03:52.440 align:middle line:90%
relatively easily.

00:03:52.440 --> 00:03:55.718 align:middle line:84%
So we'll give this a couple
of seconds to start up.

00:03:55.718 --> 00:03:56.260 align:middle line:90%
There we are.

00:03:56.260 --> 00:04:00.110 align:middle line:90%
So I'll search for BadBlue.

00:04:00.110 --> 00:04:02.366 align:middle line:90%
There we go, and we'll use the--

00:04:02.366 --> 00:04:04.640 align:middle line:84%
this particular exploit
module right over here

00:04:04.640 --> 00:04:06.810 align:middle line:90%
as we did in the previous video.

00:04:06.810 --> 00:04:08.240 align:middle line:84%
We'll leave the
default payload as

00:04:08.240 --> 00:04:12.080 align:middle line:84%
windows/meterpreter/reverse_tcp,
and we can then set up

00:04:12.080 --> 00:04:12.920 align:middle line:90%
the target IP.

00:04:12.920 --> 00:04:16.579 align:middle line:84%
So I'm going to say set
RHOSTS to the target IP.

00:04:16.579 --> 00:04:19.010 align:middle line:84%
And of course, you can also
configure your meterpreter

00:04:19.010 --> 00:04:19.880 align:middle line:90%
payload options.

00:04:19.880 --> 00:04:21.920 align:middle line:84%
In this case, they
are automatically

00:04:21.920 --> 00:04:23.005 align:middle line:90%
configured in my case.

00:04:23.005 --> 00:04:24.830 align:middle line:84%
So I'm just going
to hit Exploit,

00:04:24.830 --> 00:04:27.170 align:middle line:84%
and we should obtain
a meterpreter session

00:04:27.170 --> 00:04:28.415 align:middle line:90%
on a target system.

00:04:28.415 --> 00:04:31.770 align:middle line:90%


00:04:31.770 --> 00:04:32.270 align:middle line:90%
All right.

00:04:32.270 --> 00:04:34.820 align:middle line:84%
So now that I've obtained
a meterpreter session,

00:04:34.820 --> 00:04:38.960 align:middle line:84%
what I can do is I can search
for the LSASS process again,

00:04:38.960 --> 00:04:40.280 align:middle line:90%
so pgrep lsass.

00:04:40.280 --> 00:04:42.570 align:middle line:84%
And I can migrate
to the process ID.

00:04:42.570 --> 00:04:47.920 align:middle line:84%
So 780, so migrate 780, and we
should have NT AUTHORITY SYSTEM

00:04:47.920 --> 00:04:50.768 align:middle line:84%
privileges, so we
can say get user ID.

00:04:50.768 --> 00:04:51.310 align:middle line:90%
There we are.

00:04:51.310 --> 00:04:51.880 align:middle line:90%
Fantastic.

00:04:51.880 --> 00:04:56.680 align:middle line:84%
So I'll now load Kiwi
again, so load kiwi.

00:04:56.680 --> 00:04:59.410 align:middle line:84%
And then, we can
say lsa_dump_sam

00:04:59.410 --> 00:05:02.380 align:middle line:84%
to get the administrator
NTLM credentials.

00:05:02.380 --> 00:05:03.595 align:middle line:90%
So there we are.

00:05:03.595 --> 00:05:07.460 align:middle line:84%
You can see that we get the
administrator NTLM hash there.

00:05:07.460 --> 00:05:09.550 align:middle line:84%
So I'm just going to
copy that, and I'm

00:05:09.550 --> 00:05:11.068 align:middle line:84%
going to put it
into a text file.

00:05:11.068 --> 00:05:12.610 align:middle line:84%
So I'll create a
new text file there,

00:05:12.610 --> 00:05:15.820 align:middle line:84%
and I'm just going to say
admin, or administrator.

00:05:15.820 --> 00:05:18.320 align:middle line:84%
Let me make sure I've got
that specified correctly.

00:05:18.320 --> 00:05:21.280 align:middle line:84%
So administrator, paste
in the hash there.

00:05:21.280 --> 00:05:25.180 align:middle line:84%
And we can also take in
the student NTLM hash

00:05:25.180 --> 00:05:26.920 align:middle line:84%
because I'll show
you that this works

00:05:26.920 --> 00:05:29.680 align:middle line:84%
irregardless of what
the user NTLM hashes

00:05:29.680 --> 00:05:30.800 align:middle line:90%
you're trying to use.

00:05:30.800 --> 00:05:37.620 align:middle line:84%
So we can say student, and we
can then paste that in there.

00:05:37.620 --> 00:05:40.290 align:middle line:84%
All right, and of course, you
can get the same NTLM hashes

00:05:40.290 --> 00:05:43.800 align:middle line:84%
if you had used the
Mimikatz executable.

00:05:43.800 --> 00:05:46.010 align:middle line:84%
So let's take a look at
the first technique, which

00:05:46.010 --> 00:05:49.250 align:middle line:84%
is how to essentially perform
a pass-the-hash attack

00:05:49.250 --> 00:05:52.200 align:middle line:84%
with the PsExec
Metasploit module.

00:05:52.200 --> 00:05:54.210 align:middle line:84%
Now, in order to
use this module,

00:05:54.210 --> 00:05:57.170 align:middle line:84%
you will require the
LM hash in addition

00:05:57.170 --> 00:05:59.630 align:middle line:90%
to the NTLM or the NT hash.

00:05:59.630 --> 00:06:03.810 align:middle line:84%
And a quick way of getting that
is just typing in hashdump.

00:06:03.810 --> 00:06:05.420 align:middle line:84%
So if I type in
hashdump, you can

00:06:05.420 --> 00:06:08.700 align:middle line:84%
see that you'll get the
actual hash specified here,

00:06:08.700 --> 00:06:11.240 align:middle line:84%
so administrator
user, then the SID.

00:06:11.240 --> 00:06:14.570 align:middle line:84%
And this is the LM hash, and
it's the same for every user,

00:06:14.570 --> 00:06:15.920 align:middle line:90%
as you can see here.

00:06:15.920 --> 00:06:18.710 align:middle line:84%
And then the NTLM
hash or the NT hash

00:06:18.710 --> 00:06:20.700 align:middle line:84%
is going to mirror
the same one here.

00:06:20.700 --> 00:06:23.270 align:middle line:90%
So you can see e3c61.

00:06:23.270 --> 00:06:28.100 align:middle line:84%
So we want to copy this
particular hash here

00:06:28.100 --> 00:06:32.150 align:middle line:84%
as that particular module, or
the Metasploit PsExec module

00:06:32.150 --> 00:06:35.870 align:middle line:84%
requires you to specify
the LM hash in addition

00:06:35.870 --> 00:06:37.680 align:middle line:90%
to the NT hash itself.

00:06:37.680 --> 00:06:40.790 align:middle line:84%
So I'll also just copy
and paste that in there,

00:06:40.790 --> 00:06:44.090 align:middle line:84%
and I'll put this meterpreter
session in the background using

00:06:44.090 --> 00:06:45.650 align:middle line:90%
Control-NZ.

00:06:45.650 --> 00:06:46.470 align:middle line:90%
There we are.

00:06:46.470 --> 00:06:47.940 align:middle line:84%
And we can search
for the module,

00:06:47.940 --> 00:06:50.210 align:middle line:90%
so we can just say psexec.

00:06:50.210 --> 00:06:52.890 align:middle line:84%
And the module we're looking
for is this one right over here,

00:06:52.890 --> 00:06:55.700 align:middle line:90%
so exploit/windows/smb/psexec.

00:06:55.700 --> 00:06:58.520 align:middle line:84%
This is Microsoft Windows
authenticated user code

00:06:58.520 --> 00:06:59.160 align:middle line:90%
execution.

00:06:59.160 --> 00:07:01.490 align:middle line:84%
Remember, that's the keyword
there, "authenticated,"

00:07:01.490 --> 00:07:03.470 align:middle line:84%
in that you will
need credentials

00:07:03.470 --> 00:07:05.250 align:middle line:90%
to use this particular module.

00:07:05.250 --> 00:07:10.010 align:middle line:84%
So I'll say Copy, and I'll
say, use, paste that in there.

00:07:10.010 --> 00:07:11.780 align:middle line:84%
And I'll leave the
default payload

00:07:11.780 --> 00:07:13.790 align:middle line:84%
as
windows/meterpreter/reverse_tcp.

00:07:13.790 --> 00:07:17.480 align:middle line:84%
You can change that to the
64-bit meterpreter module

00:07:17.480 --> 00:07:18.920 align:middle line:90%
if you want.

00:07:18.920 --> 00:07:21.453 align:middle line:84%
Then I'm going to copy the
target IP as I need it again.

00:07:21.453 --> 00:07:23.120 align:middle line:84%
So I'll just clear
out the options here,

00:07:23.120 --> 00:07:25.490 align:middle line:90%
and I'll say show options.

00:07:25.490 --> 00:07:28.010 align:middle line:84%
And we can specify
the payload options.

00:07:28.010 --> 00:07:30.920 align:middle line:84%
This is very important
because our current session

00:07:30.920 --> 00:07:35.650 align:middle line:84%
is utilizing port 4.4.4.4, so we
need to change the LPORT option

00:07:35.650 --> 00:07:36.150 align:middle line:90%
here.

00:07:36.150 --> 00:07:40.610 align:middle line:84%
So I'm going to say set LPORT
to maybe 4.4.2.2, something

00:07:40.610 --> 00:07:42.710 align:middle line:84%
different because this
is going to provide us

00:07:42.710 --> 00:07:44.660 align:middle line:84%
with another
meterpreter session.

00:07:44.660 --> 00:07:47.270 align:middle line:84%
And then, of course, you
can specify the target IP.

00:07:47.270 --> 00:07:51.840 align:middle line:84%
So I'll say set RHOSTS
target IP right over there.

00:07:51.840 --> 00:07:55.520 align:middle line:84%
And now, you can see this
particular module allows

00:07:55.520 --> 00:07:58.100 align:middle line:84%
you to set up the
SMBDomain if the target

00:07:58.100 --> 00:07:59.780 align:middle line:90%
system is part of a domain.

00:07:59.780 --> 00:08:02.960 align:middle line:84%
In this case, the target
system is not part of a domain.

00:08:02.960 --> 00:08:05.430 align:middle line:84%
You then have the SMBUser,
which, in this case,

00:08:05.430 --> 00:08:07.520 align:middle line:84%
we will specify
as administrator,

00:08:07.520 --> 00:08:09.020 align:middle line:90%
and then the SMBPass.

00:08:09.020 --> 00:08:12.920 align:middle line:84%
Here, you can specify clear-text
credentials or the actual hash.

00:08:12.920 --> 00:08:17.630 align:middle line:84%
So I'll say-- we'll start
off by saying set SMBUser,

00:08:17.630 --> 00:08:20.850 align:middle line:90%
and that is administrator.

00:08:20.850 --> 00:08:25.500 align:middle line:84%
And then, we can set the
SMBPass as the password hash.

00:08:25.500 --> 00:08:29.340 align:middle line:84%
Of course, that is going to
be both the LM and NTLM hash.

00:08:29.340 --> 00:08:32.580 align:middle line:84%
And again, this is just
for this particular module

00:08:32.580 --> 00:08:35.309 align:middle line:84%
as it is quite problematic
or might give you errors

00:08:35.309 --> 00:08:38.850 align:middle line:84%
if you only paste in the NT or
the NTLM hash or the NT hash,

00:08:38.850 --> 00:08:39.880 align:middle line:90%
if you will.

00:08:39.880 --> 00:08:41.610 align:middle line:90%
So I'll hit Enter.

00:08:41.610 --> 00:08:45.060 align:middle line:84%
And if everything goes
OK, we can hit Exploit,

00:08:45.060 --> 00:08:47.920 align:middle line:84%
and we should get a
meterpreter session.

00:08:47.920 --> 00:08:48.420 align:middle line:90%
All right.

00:08:48.420 --> 00:08:49.170 align:middle line:90%
So I'll hit Enter.

00:08:49.170 --> 00:08:53.090 align:middle line:90%


00:08:53.090 --> 00:08:53.590 align:middle line:90%
All right.

00:08:53.590 --> 00:08:55.180 align:middle line:84%
So you can see
right over here, it

00:08:55.180 --> 00:08:56.800 align:middle line:84%
tells us connecting
to the server,

00:08:56.800 --> 00:08:59.470 align:middle line:84%
authenticating to the
target as administrator,

00:08:59.470 --> 00:09:01.630 align:middle line:84%
and authentication
is successful.

00:09:01.630 --> 00:09:04.300 align:middle line:84%
Is then going to say selecting
the PowerShell target,

00:09:04.300 --> 00:09:08.800 align:middle line:84%
executing the payload, service
start timed out, OK, et cetera.

00:09:08.800 --> 00:09:11.770 align:middle line:84%
And the reason we didn't
get a meterpreter session,

00:09:11.770 --> 00:09:13.690 align:middle line:84%
as you can see
here, is because we

00:09:13.690 --> 00:09:14.980 align:middle line:90%
need to configure the target.

00:09:14.980 --> 00:09:19.600 align:middle line:84%
So I'm going to say set target,
and we can specify a target

00:09:19.600 --> 00:09:21.150 align:middle line:90%
based on our own requirement.

00:09:21.150 --> 00:09:23.750 align:middle line:84%
So we can also utilize a
command shell if we want.

00:09:23.750 --> 00:09:27.070 align:middle line:84%
So we can say set target command
and then hit Exploit again.

00:09:27.070 --> 00:09:43.988 align:middle line:90%


00:09:43.988 --> 00:09:45.530 align:middle line:84%
All right, and in
this case, we still

00:09:45.530 --> 00:09:47.220 align:middle line:90%
don't get any session here.

00:09:47.220 --> 00:09:50.130 align:middle line:84%
So let's just show the
options one more time.

00:09:50.130 --> 00:09:51.920 align:middle line:84%
And let's see what
we can configure

00:09:51.920 --> 00:09:54.560 align:middle line:84%
to ensure that we get
a meterpreter session.

00:09:54.560 --> 00:09:59.310 align:middle line:84%
So we don't need to specify
anything additional here.

00:09:59.310 --> 00:10:01.910 align:middle line:84%
However, I think we need to
configure the target because it

00:10:01.910 --> 00:10:05.660 align:middle line:84%
looks like using a command
shell is not working.

00:10:05.660 --> 00:10:08.570 align:middle line:84%
So we can also try the
native upload functionality

00:10:08.570 --> 00:10:12.170 align:middle line:84%
to upload the actual
meterpreter payload.

00:10:12.170 --> 00:10:15.245 align:middle line:84%
So I'll set that, and
we can hit Exploit.

00:10:15.245 --> 00:10:17.720 align:middle line:90%


00:10:17.720 --> 00:10:18.220 align:middle line:90%
All right.

00:10:18.220 --> 00:10:21.260 align:middle line:84%
So that looks like it works,
as you can see right over here.

00:10:21.260 --> 00:10:22.660 align:middle line:84%
As I said, this
particular module

00:10:22.660 --> 00:10:25.490 align:middle line:84%
needs a little bit of
tweaking and testing.

00:10:25.490 --> 00:10:27.850 align:middle line:84%
So we authenticate
as the administrator,

00:10:27.850 --> 00:10:30.220 align:middle line:84%
and you can see that
it uploads the payload,

00:10:30.220 --> 00:10:32.200 align:middle line:90%
and it'll then execute it.

00:10:32.200 --> 00:10:34.540 align:middle line:84%
And we then see it
says sending stage.

00:10:34.540 --> 00:10:37.330 align:middle line:84%
Service started successfully
meterpreter session.

00:10:37.330 --> 00:10:42.450 align:middle line:84%
Sysinfo get user ID
NT AUTHORITY SYSTEM.

00:10:42.450 --> 00:10:45.960 align:middle line:84%
And that is essentially how to
perform a pass-the-hack attack.

00:10:45.960 --> 00:10:48.240 align:middle line:84%
And as you have seen,
we have done this

00:10:48.240 --> 00:10:51.180 align:middle line:84%
all through the use
of a hash that we

00:10:51.180 --> 00:10:53.620 align:middle line:84%
were able to extract
relatively easily.

00:10:53.620 --> 00:10:55.570 align:middle line:84%
Now, you might be saying
to yourself, well,

00:10:55.570 --> 00:10:58.300 align:middle line:84%
I really, really don't
see the sense in this.

00:10:58.300 --> 00:10:59.650 align:middle line:90%
Well, let's try this again.

00:10:59.650 --> 00:11:01.720 align:middle line:84%
So I'm just going to
exit from this session.

00:11:01.720 --> 00:11:03.240 align:middle line:84%
And if I list out
my sessions, you

00:11:03.240 --> 00:11:06.300 align:middle line:84%
can see I have my initial
session where I performed

00:11:06.300 --> 00:11:09.430 align:middle line:90%
the actual hash dumping from.

00:11:09.430 --> 00:11:11.070 align:middle line:84%
So I'll just kill
that just to show you

00:11:11.070 --> 00:11:12.195 align:middle line:90%
that this does indeed work.

00:11:12.195 --> 00:11:14.160 align:middle line:90%
So I'll say sessions kill.

00:11:14.160 --> 00:11:17.070 align:middle line:84%
So now, I have no access
on the target system.

00:11:17.070 --> 00:11:20.820 align:middle line:84%
And the only thing I have or
the only information I have

00:11:20.820 --> 00:11:23.640 align:middle line:84%
is the account username,
which in this case,

00:11:23.640 --> 00:11:28.020 align:middle line:84%
is the administrator account
and the actual NTLM hash.

00:11:28.020 --> 00:11:31.050 align:middle line:84%
So again, I'll just
hit Exploit, and you'll

00:11:31.050 --> 00:11:33.270 align:middle line:84%
see that it will work
irregardless of whether or not

00:11:33.270 --> 00:11:35.200 align:middle line:84%
I had previous access,
and there you go.

00:11:35.200 --> 00:11:37.920 align:middle line:84%
So this is an extremely
powerful technique.

00:11:37.920 --> 00:11:40.590 align:middle line:84%
And as I said, it's a--
it really is powerful

00:11:40.590 --> 00:11:44.370 align:middle line:84%
because it provides you with
an alternate method of vector

00:11:44.370 --> 00:11:47.520 align:middle line:84%
of accessing the system
that doesn't rely

00:11:47.520 --> 00:11:50.160 align:middle line:84%
on a vulnerable service
or the exploitation

00:11:50.160 --> 00:11:51.820 align:middle line:90%
of a vulnerable service.

00:11:51.820 --> 00:11:52.320 align:middle line:90%
All right.

00:11:52.320 --> 00:11:54.840 align:middle line:84%
So you can see that we
have gained access again,

00:11:54.840 --> 00:11:58.620 align:middle line:84%
and that is how to utilize
the Metasploit PsExec

00:11:58.620 --> 00:12:00.840 align:middle line:84%
module to perform a
pass-the-hash attack.

00:12:00.840 --> 00:12:05.760 align:middle line:84%
Now, you can also utilize other
tools like PsExec or the PsExec

00:12:05.760 --> 00:12:08.130 align:middle line:90%
Python script, or Crackmapexec.

00:12:08.130 --> 00:12:09.870 align:middle line:84%
And in this particular
lab, I've had

00:12:09.870 --> 00:12:12.720 align:middle line:84%
a few issues with Crack
Map, but again, it still

00:12:12.720 --> 00:12:14.790 align:middle line:90%
works just fine.

00:12:14.790 --> 00:12:17.790 align:middle line:84%
And all we need to do, again,
I'll just open up a new tab,

00:12:17.790 --> 00:12:19.740 align:middle line:90%
and we can say crackmapexec.

00:12:19.740 --> 00:12:21.810 align:middle line:90%
We say we are working with smb.

00:12:21.810 --> 00:12:25.440 align:middle line:84%
We then specify the
target IP address.

00:12:25.440 --> 00:12:29.160 align:middle line:84%
There we are, and
that is specified.

00:12:29.160 --> 00:12:32.370 align:middle line:84%
We then specify-- sorry, let
me just type that in again.

00:12:32.370 --> 00:12:37.590 align:middle line:90%
So crackmapexec smb.

00:12:37.590 --> 00:12:40.230 align:middle line:84%
And I'll just copy the
target IP correctly

00:12:40.230 --> 00:12:43.840 align:middle line:84%
because the space automatically
creates a new line there.

00:12:43.840 --> 00:12:45.960 align:middle line:84%
So I'll paste that in
there, and we can then

00:12:45.960 --> 00:12:51.350 align:middle line:84%
specify the username, which
in this case is administrator,

00:12:51.350 --> 00:12:54.110 align:middle line:84%
and the password,
which, in this case,

00:12:54.110 --> 00:12:56.780 align:middle line:84%
is just going to be the
hash, the NTLM hash alone.

00:12:56.780 --> 00:12:59.000 align:middle line:84%
We don't need to
specify the LM hash.

00:12:59.000 --> 00:13:01.280 align:middle line:84%
We can put this
in double-quotes,

00:13:01.280 --> 00:13:03.410 align:middle line:84%
and I'll just go
back to my text file.

00:13:03.410 --> 00:13:07.440 align:middle line:84%
And I'll just copy the
administrator NTLM hash there.

00:13:07.440 --> 00:13:08.240 align:middle line:90%
There we go.

00:13:08.240 --> 00:13:12.300 align:middle line:84%
Paste that in there,
and I'll actually

00:13:12.300 --> 00:13:17.130 align:middle line:84%
close the quotation marks,
and we can then hit Enter.

00:13:17.130 --> 00:13:19.565 align:middle line:90%
And yeah, so that isn't working.

00:13:19.565 --> 00:13:20.940 align:middle line:84%
And the reason
that isn't working

00:13:20.940 --> 00:13:23.100 align:middle line:84%
is because I specified the
password option instead

00:13:23.100 --> 00:13:26.010 align:middle line:84%
of the hash option,
which is done by saying

00:13:26.010 --> 00:13:30.730 align:middle line:84%
or by specifying hyphen capital
H. I can hit Enter again.

00:13:30.730 --> 00:13:32.190 align:middle line:84%
And as you can see
right over here,

00:13:32.190 --> 00:13:34.390 align:middle line:84%
it authenticates
with the target.

00:13:34.390 --> 00:13:36.810 align:middle line:84%
And you can see it tells
us right over that system

00:13:36.810 --> 00:13:37.350 align:middle line:90%
is Pwn3d.

00:13:37.350 --> 00:13:40.750 align:middle line:84%
So we can try and execute
a few commands on it.

00:13:40.750 --> 00:13:44.860 align:middle line:84%
So I'll just say -x
as we did previously.

00:13:44.860 --> 00:13:46.670 align:middle line:84%
And within the
quotation marks, I

00:13:46.670 --> 00:13:48.205 align:middle line:84%
can say something
like "ipconfig."

00:13:48.205 --> 00:13:49.830 align:middle line:84%
Now, as I said, in
this particular lab,

00:13:49.830 --> 00:13:53.190 align:middle line:84%
the Crackmapexec
script has a few issues

00:13:53.190 --> 00:13:54.960 align:middle line:90%
with some Python dependencies.

00:13:54.960 --> 00:13:57.630 align:middle line:84%
So it will give me a few
errors, but I'll hit Enter.

00:13:57.630 --> 00:14:00.840 align:middle line:90%


00:14:00.840 --> 00:14:03.365 align:middle line:84%
All right, so don't worry
about these Python errors.

00:14:03.365 --> 00:14:04.740 align:middle line:84%
All you need to
do is take a look

00:14:04.740 --> 00:14:06.910 align:middle line:84%
at the output for the
command that we specified.

00:14:06.910 --> 00:14:08.610 align:middle line:84%
So you can see
executed the command,

00:14:08.610 --> 00:14:11.160 align:middle line:84%
and it provides us with the
output pertinent to the command

00:14:11.160 --> 00:14:12.270 align:middle line:90%
that we specified.

00:14:12.270 --> 00:14:14.190 align:middle line:84%
And in this case, we
wanted to know more

00:14:14.190 --> 00:14:16.540 align:middle line:84%
about the actual
network interfaces.

00:14:16.540 --> 00:14:19.350 align:middle line:84%
So you can see we get
the ethernet adapter,

00:14:19.350 --> 00:14:21.810 align:middle line:84%
the IPv4 address, the
subnet mask, et cetera.

00:14:21.810 --> 00:14:24.310 align:middle line:84%
And of course, you can also
run other types of commands.

00:14:24.310 --> 00:14:25.800 align:middle line:84%
So I'll just
terminate that again.

00:14:25.800 --> 00:14:28.860 align:middle line:90%
And I can also say, who am I?

00:14:28.860 --> 00:14:33.520 align:middle line:90%


00:14:33.520 --> 00:14:36.070 align:middle line:84%
And of course, we'll
get the errors again.

00:14:36.070 --> 00:14:38.530 align:middle line:84%
There we are-- attack
defense administrator.

00:14:38.530 --> 00:14:41.290 align:middle line:84%
All right, and of course, I'll
just run one more command just

00:14:41.290 --> 00:14:42.950 align:middle line:84%
to show you that,
indeed it does work.

00:14:42.950 --> 00:14:46.870 align:middle line:84%
So if I wanted to change the
password of a particular user,

00:14:46.870 --> 00:14:49.630 align:middle line:84%
maybe I wanted to
change the password.

00:14:49.630 --> 00:14:52.600 align:middle line:84%
I can say net user
administrator,

00:14:52.600 --> 00:14:54.620 align:middle line:84%
and then I can specify
the new password.

00:14:54.620 --> 00:14:56.238 align:middle line:90%
So I can see a password123.

00:14:56.238 --> 00:14:58.030 align:middle line:84%
That will also work,
but let's try and list

00:14:58.030 --> 00:15:00.730 align:middle line:84%
out the list of
users on the system.

00:15:00.730 --> 00:15:05.770 align:middle line:90%


00:15:05.770 --> 00:15:07.270 align:middle line:84%
And it says right
over here it looks

00:15:07.270 --> 00:15:08.450 align:middle line:90%
like we have a system error.

00:15:08.450 --> 00:15:11.210 align:middle line:84%
So the RPC server is too
busy to complete this option.

00:15:11.210 --> 00:15:14.090 align:middle line:84%
So I'll just wait for a few
seconds, but you get the idea.

00:15:14.090 --> 00:15:17.650 align:middle line:84%
You can utilize various tools to
perform a pass-the-hash attack.

00:15:17.650 --> 00:15:21.280 align:middle line:84%
And as I said, we are not--
we don't even have the user

00:15:21.280 --> 00:15:22.300 align:middle line:90%
accounts password.

00:15:22.300 --> 00:15:23.853 align:middle line:90%
We're just using the hash.

00:15:23.853 --> 00:15:26.020 align:middle line:84%
And as I said, the reason
why I wanted to cover this

00:15:26.020 --> 00:15:28.990 align:middle line:84%
is because this is a
vulnerability within Windows.

00:15:28.990 --> 00:15:31.390 align:middle line:84%
It's a vulnerability that
attackers take advantage

00:15:31.390 --> 00:15:33.940 align:middle line:84%
of quite often, and
you really don't

00:15:33.940 --> 00:15:37.600 align:middle line:84%
need to move to the password
or hash cracking stages.

00:15:37.600 --> 00:15:40.180 align:middle line:84%
You can pretty much
utilize the hash

00:15:40.180 --> 00:15:42.700 align:middle line:84%
to authenticate with the
target and maintain access

00:15:42.700 --> 00:15:44.210 align:middle line:90%
to the target system.

00:15:44.210 --> 00:15:44.710 align:middle line:90%
All right.

00:15:44.710 --> 00:15:47.680 align:middle line:84%
So that is going to conclude
the practical demonstration

00:15:47.680 --> 00:15:50.660 align:middle line:90%
side of this video.

00:15:50.660 --> 00:15:51.160 align:middle line:90%
All right.

00:15:51.160 --> 00:15:54.400 align:middle line:84%
So that concludes the
final Windows section

00:15:54.400 --> 00:15:56.620 align:middle line:84%
of this course, where
we were exploring

00:15:56.620 --> 00:16:00.520 align:middle line:84%
the process of dumping
hashes and finding passwords

00:16:00.520 --> 00:16:02.440 align:middle line:90%
in configuration files.

00:16:02.440 --> 00:16:05.530 align:middle line:84%
We will now be moving on
to the first Linux section,

00:16:05.530 --> 00:16:07.780 align:middle line:84%
where we will be getting
an overview of Linux

00:16:07.780 --> 00:16:11.590 align:middle line:84%
vulnerabilities and frequently
exploited Linux services.

00:16:11.590 --> 00:16:13.600 align:middle line:84%
And then, we'll
begin taking a look

00:16:13.600 --> 00:16:17.140 align:middle line:84%
at how to exploit inherent
vulnerabilities within Linux

00:16:17.140 --> 00:16:19.390 align:middle line:84%
and also take a look
at privilege escalation

00:16:19.390 --> 00:16:23.260 align:middle line:84%
and dumping Linux user
account password hashes.

00:16:23.260 --> 00:16:26.906 align:middle line:84%
So I'll see you in
the next section.

00:16:26.906 --> 00:16:27.406 align:middle line:90%