WEBVTT

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


00:00:03.339 --> 00:00:06.678 align:middle line:90%
[MUSIC PLAYING]

00:00:06.678 --> 00:00:10.020 align:middle line:90%


00:00:10.020 --> 00:00:12.810 align:middle line:90%
Dumping hashes with Mimikatz.

00:00:12.810 --> 00:00:14.430 align:middle line:84%
Now that we've
taken a look at how

00:00:14.430 --> 00:00:17.850 align:middle line:84%
we can find an administrative
password by searching

00:00:17.850 --> 00:00:20.970 align:middle line:84%
through various
configuration files, more

00:00:20.970 --> 00:00:23.760 align:middle line:84%
specifically the
unattended installation

00:00:23.760 --> 00:00:26.100 align:middle line:84%
or set up utilities
configuration files,

00:00:26.100 --> 00:00:29.070 align:middle line:84%
let's begin the actual
hash dumping process.

00:00:29.070 --> 00:00:30.930 align:middle line:84%
And of course, the
tool that we're

00:00:30.930 --> 00:00:34.140 align:middle line:84%
going to be utilizing in
order to do this is Mimikatz.

00:00:34.140 --> 00:00:37.050 align:middle line:84%
So Mimikatz is pretty
much the de facto standard

00:00:37.050 --> 00:00:39.870 align:middle line:84%
when it comes down to
post-exploitation on a Windows

00:00:39.870 --> 00:00:44.160 align:middle line:84%
system, more specifically,
password extraction or hash

00:00:44.160 --> 00:00:46.385 align:middle line:90%
extraction from memory.

00:00:46.385 --> 00:00:47.760 align:middle line:84%
All right, before
we actually get

00:00:47.760 --> 00:00:51.120 align:middle line:84%
started with taking a look
at how to use Mimikatz,

00:00:51.120 --> 00:00:54.480 align:middle line:84%
let's get an understanding of
what it is and how it works.

00:00:54.480 --> 00:00:57.840 align:middle line:84%
All right, so Mimikatz is a
Windows post-exploitation tool

00:00:57.840 --> 00:01:00.150 align:middle line:84%
that was written
by Benjamin Delpy,

00:01:00.150 --> 00:01:03.600 align:middle line:84%
and it allows for the extraction
of clear-text passwords,

00:01:03.600 --> 00:01:06.360 align:middle line:84%
hashes, and Kerberos
tickets from memory.

00:01:06.360 --> 00:01:09.413 align:middle line:84%
Now we already have gone
through the SAM database,

00:01:09.413 --> 00:01:10.830 align:middle line:84%
but I'll just go
through it again.

00:01:10.830 --> 00:01:13.800 align:middle line:84%
So the SAM database or the
Security Account Manager

00:01:13.800 --> 00:01:16.830 align:middle line:84%
database is a database
file on Windows systems

00:01:16.830 --> 00:01:19.140 align:middle line:84%
that stores hashed
user passwords.

00:01:19.140 --> 00:01:21.120 align:middle line:84%
And Mimikatz that can
be used to extract

00:01:21.120 --> 00:01:23.460 align:middle line:84%
hashes from the
LSASS process memory

00:01:23.460 --> 00:01:25.830 align:middle line:84%
where the hashes
are actually cached.

00:01:25.830 --> 00:01:29.580 align:middle line:84%
So again, if you've opened up
your Task Manager on a Windows

00:01:29.580 --> 00:01:32.813 align:middle line:84%
system and take a look at these
services or processes tab,

00:01:32.813 --> 00:01:34.230 align:middle line:84%
you may have noticed
that you have

00:01:34.230 --> 00:01:36.270 align:middle line:90%
a process called lsass.exe.

00:01:36.270 --> 00:01:41.610 align:middle line:84%
So LSA stands for the
Local Security Authority,

00:01:41.610 --> 00:01:45.540 align:middle line:84%
and LSASS stands for the Local
Security Authority Subsystem.

00:01:45.540 --> 00:01:48.870 align:middle line:84%
And this process is responsible
for authenticating users,

00:01:48.870 --> 00:01:51.660 align:middle line:84%
and part of that process
involves interacting

00:01:51.660 --> 00:01:53.400 align:middle line:90%
with the SAM database.

00:01:53.400 --> 00:01:56.370 align:middle line:84%
And as a result, the LSASS
process will actually

00:01:56.370 --> 00:02:00.540 align:middle line:84%
store the actual data that
it's retrieving from the SAM

00:02:00.540 --> 00:02:04.020 align:middle line:84%
database, so data like the
administrator or rather

00:02:04.020 --> 00:02:05.760 align:middle line:90%
user hashes.

00:02:05.760 --> 00:02:09.240 align:middle line:84%
And it'll store them in
its memory, so within RAM.

00:02:09.240 --> 00:02:12.630 align:middle line:84%
And what Mimikatz
does is it essentially

00:02:12.630 --> 00:02:15.810 align:middle line:84%
extracts these hashes from
the LSASS process memory

00:02:15.810 --> 00:02:17.820 align:middle line:84%
where the hashes
are being cached.

00:02:17.820 --> 00:02:20.440 align:middle line:84%
So in terms of
utilizing Mimikatz.

00:02:20.440 --> 00:02:22.470 align:middle line:84%
We can utilize the
pre-compiled Mimikatz

00:02:22.470 --> 00:02:25.720 align:middle line:84%
executable, which comes
pre-packaged with Kali Linux

00:02:25.720 --> 00:02:26.955 align:middle line:90%
And parent OS.

00:02:26.955 --> 00:02:30.840 align:middle line:84%
Alternatively, if we have
access to an meterpreter session

00:02:30.840 --> 00:02:33.900 align:middle line:84%
on a Windows target, we can
utilize the inbuilt meterpreter

00:02:33.900 --> 00:02:36.190 align:middle line:90%
extension called Kiwi.

00:02:36.190 --> 00:02:38.670 align:middle line:84%
And the great thing about
Kiwi is it essentially

00:02:38.670 --> 00:02:43.410 align:middle line:84%
performs or allows you to dump
or extract hashes from memory

00:02:43.410 --> 00:02:46.650 align:middle line:84%
directly from within
memory, so you're not really

00:02:46.650 --> 00:02:50.670 align:middle line:84%
uploading the Mimikatz binary
or executable onto the target.

00:02:50.670 --> 00:02:52.710 align:middle line:84%
Everything is being
executed in memory,

00:02:52.710 --> 00:02:56.140 align:middle line:84%
so you're really not leaving
any artifacts on the system.

00:02:56.140 --> 00:02:58.775 align:middle line:84%
However, we will be taking
a look at how to use both.

00:02:58.775 --> 00:03:00.900 align:middle line:84%
So we'll take a look at
how to utilize the Mimikatz

00:03:00.900 --> 00:03:05.610 align:middle line:84%
executable as well as the
Kiwi module or extension

00:03:05.610 --> 00:03:07.170 align:middle line:90%
for meterpreter.

00:03:07.170 --> 00:03:08.550 align:middle line:84%
Now, it's very
important to note,

00:03:08.550 --> 00:03:10.470 align:middle line:84%
as I've mentioned
previously, that Mimikatz

00:03:10.470 --> 00:03:13.710 align:middle line:84%
will require elevated privileges
in order to run correctly.

00:03:13.710 --> 00:03:17.640 align:middle line:84%
The reason for that is
because the lsass.exe process

00:03:17.640 --> 00:03:20.790 align:middle line:84%
is a privileged process, so it
runs with system privileges.

00:03:20.790 --> 00:03:22.690 align:middle line:84%
And in order to
interact with it,

00:03:22.690 --> 00:03:25.560 align:middle line:84%
you need to have administrative
privileges or system

00:03:25.560 --> 00:03:26.640 align:middle line:90%
privileges.

00:03:26.640 --> 00:03:29.650 align:middle line:84%
So that is really
what is required.

00:03:29.650 --> 00:03:33.010 align:middle line:84%
Now, this particular video has a
lab environment attached to it.

00:03:33.010 --> 00:03:35.160 align:middle line:84%
So we'll actually
be taking a look

00:03:35.160 --> 00:03:36.990 align:middle line:84%
at how to perform all
of these techniques

00:03:36.990 --> 00:03:40.050 align:middle line:84%
so how to dump NTLM
hashes with Mimikatz

00:03:40.050 --> 00:03:42.480 align:middle line:84%
either through the executable
or through the meterpreter

00:03:42.480 --> 00:03:43.770 align:middle line:90%
extension, which is Kiwi.

00:03:43.770 --> 00:03:47.230 align:middle line:84%
So fire up the lab environment,
and I'll do that as well.

00:03:47.230 --> 00:03:51.380 align:middle line:84%
And I'll see you within
the lab environment.

00:03:51.380 --> 00:03:53.510 align:middle line:84%
All right, so I'm back
within the lab environment.

00:03:53.510 --> 00:03:55.880 align:middle line:84%
And you should already
have the target IP

00:03:55.880 --> 00:03:57.593 align:middle line:90%
address specified for you.

00:03:57.593 --> 00:03:59.760 align:middle line:84%
Of course, in your case,
it's going to be different.

00:03:59.760 --> 00:04:02.600 align:middle line:84%
So the first step will
involve essentially

00:04:02.600 --> 00:04:05.570 align:middle line:84%
exploiting a vulnerable service
running on the target in order

00:04:05.570 --> 00:04:07.290 align:middle line:90%
to obtain initial access.

00:04:07.290 --> 00:04:09.320 align:middle line:84%
So we'll perform an
Nmap scan on the target

00:04:09.320 --> 00:04:11.510 align:middle line:84%
to identify the
vulnerable service.

00:04:11.510 --> 00:04:13.070 align:middle line:84%
However, before I
do that, you can

00:04:13.070 --> 00:04:16.370 align:middle line:84%
see that this particular
lab environment provides you

00:04:16.370 --> 00:04:19.310 align:middle line:84%
with the attacker machine,
which is your Kali Linux system,

00:04:19.310 --> 00:04:21.930 align:middle line:84%
and the target machine
right over here,

00:04:21.930 --> 00:04:24.050 align:middle line:84%
which is running Windows
10 and is currently

00:04:24.050 --> 00:04:28.490 align:middle line:84%
running a service on
port 80 called BadBlue.

00:04:28.490 --> 00:04:31.370 align:middle line:84%
So we'll just perform the Nmap
scan anyway, even though that's

00:04:31.370 --> 00:04:32.870 align:middle line:90%
the service will be exploiting.

00:04:32.870 --> 00:04:36.440 align:middle line:84%
So I'll say Nmap, and I'll
just paste in the target IP

00:04:36.440 --> 00:04:37.470 align:middle line:90%
right over there.

00:04:37.470 --> 00:04:40.310 align:middle line:84%
And of course, we can perform
some service version detection

00:04:40.310 --> 00:04:45.860 align:middle line:84%
if we want to to get a more
specific or exact information

00:04:45.860 --> 00:04:48.300 align:middle line:84%
regarding the version of
the service that's running.

00:04:48.300 --> 00:04:49.258 align:middle line:90%
So I'll hit Enter.

00:04:49.258 --> 00:04:51.800 align:middle line:84%
And I'll give that a couple of
seconds to a couple of minutes

00:04:51.800 --> 00:04:53.820 align:middle line:90%
to complete.

00:04:53.820 --> 00:04:55.830 align:middle line:84%
All right, so we can
see that on port 80,

00:04:55.830 --> 00:04:57.290 align:middle line:90%
we have BadBlue running.

00:04:57.290 --> 00:05:00.000 align:middle line:90%
And that is version 2.7.

00:05:00.000 --> 00:05:02.420 align:middle line:84%
Now luckily for us, the
Metasploit framework

00:05:02.420 --> 00:05:04.580 align:middle line:84%
has an exploit
module that can be

00:05:04.580 --> 00:05:07.310 align:middle line:84%
used to exploit this
specific version of BadBlue

00:05:07.310 --> 00:05:11.840 align:middle line:84%
and consequently provide us
with a meterpreter session.

00:05:11.840 --> 00:05:14.090 align:middle line:90%
So we will start up MSF console.

00:05:14.090 --> 00:05:16.710 align:middle line:84%
I'm just going to start up the
PostgreSQL database as well.

00:05:16.710 --> 00:05:21.840 align:middle line:84%
So service postgresql
start and MSF console.

00:05:21.840 --> 00:05:24.190 align:middle line:84%
We'll give that a
couple of seconds.

00:05:24.190 --> 00:05:27.090 align:middle line:84%
And we can immediately then
search for the exploit module.

00:05:27.090 --> 00:05:29.340 align:middle line:84%
There really are only
two exploit modules

00:05:29.340 --> 00:05:31.540 align:middle line:90%
for the BadBlue service.

00:05:31.540 --> 00:05:32.250 align:middle line:90%
So there we are.

00:05:32.250 --> 00:05:35.830 align:middle line:90%
And I'll say search BadBlue.

00:05:35.830 --> 00:05:39.140 align:middle line:84%
And we will be utilizing
the first exploit module.

00:05:39.140 --> 00:05:41.470 align:middle line:84%
So this is exploit
zero and exploit one.

00:05:41.470 --> 00:05:44.560 align:middle line:84%
So this is the BadBlue
pass through overflow

00:05:44.560 --> 00:05:46.810 align:middle line:84%
or rather the pass
through exploit modules.

00:05:46.810 --> 00:05:50.290 align:middle line:84%
So this works on
BadBlue version 2.7.

00:05:50.290 --> 00:05:52.400 align:middle line:84%
And in this case,
this will work.

00:05:52.400 --> 00:05:54.230 align:middle line:90%
So I will copy it.

00:05:54.230 --> 00:05:57.130 align:middle line:90%
So I can say use one.

00:05:57.130 --> 00:06:00.220 align:middle line:84%
That will specify that
particular exploit module.

00:06:00.220 --> 00:06:04.510 align:middle line:84%
And then, the default payload
is set to the 32-bit meterpreter

00:06:04.510 --> 00:06:07.300 align:middle line:84%
payload, which is perfectly
fine in this case.

00:06:07.300 --> 00:06:10.400 align:middle line:84%
If I show the options
for this module,

00:06:10.400 --> 00:06:13.730 align:middle line:84%
the only option that we need
to configure is the target IP.

00:06:13.730 --> 00:06:18.150 align:middle line:84%
So I'll say set our hosts, and
I'll paste in the target IP.

00:06:18.150 --> 00:06:20.520 align:middle line:84%
You can then configure
your payload options.

00:06:20.520 --> 00:06:22.080 align:middle line:84%
This is for your
meterpreter session

00:06:22.080 --> 00:06:25.480 align:middle line:84%
so you can set up your Kali
Linux IP, which in this case,

00:06:25.480 --> 00:06:28.620 align:middle line:84%
it is already configured for
me, and the default Lport

00:06:28.620 --> 00:06:31.930 align:middle line:84%
is 4444, which I'll
leave it as it is.

00:06:31.930 --> 00:06:35.860 align:middle line:84%
So I'll say exploit, and we'll
give this a couple of seconds.

00:06:35.860 --> 00:06:36.490 align:middle line:90%
There we are.

00:06:36.490 --> 00:06:39.400 align:middle line:84%
It sends the stage, and we
get a meterpreter session

00:06:39.400 --> 00:06:41.038 align:middle line:90%
on the target system.

00:06:41.038 --> 00:06:42.830 align:middle line:84%
All right, so let me
clear out my terminal.

00:06:42.830 --> 00:06:44.650 align:middle line:84%
So let's learn more
about our system.

00:06:44.650 --> 00:06:46.250 align:middle line:90%
We type in sysinfo.

00:06:46.250 --> 00:06:49.090 align:middle line:84%
We can see it's
running Windows 2016.

00:06:49.090 --> 00:06:49.930 align:middle line:90%
Oh, interesting.

00:06:49.930 --> 00:06:51.880 align:middle line:84%
So I actually did
not realize that.

00:06:51.880 --> 00:06:57.670 align:middle line:84%
It's running Windows
Server 2016, build 17763,

00:06:57.670 --> 00:07:00.790 align:middle line:84%
and we currently have a
32-bit interpreter payload

00:07:00.790 --> 00:07:03.230 align:middle line:90%
on a 64-bit operating system.

00:07:03.230 --> 00:07:04.780 align:middle line:90%
So we say get user ID.

00:07:04.780 --> 00:07:07.150 align:middle line:84%
You can see we
currently have access

00:07:07.150 --> 00:07:09.110 align:middle line:90%
as the administrator user.

00:07:09.110 --> 00:07:11.170 align:middle line:84%
However, what I
would like to do is

00:07:11.170 --> 00:07:14.030 align:middle line:84%
I would like to migrate
to the lsass.exe process.

00:07:14.030 --> 00:07:18.640 align:middle line:84%
So I can use the pgrep
option and say pgrep LSASS,

00:07:18.640 --> 00:07:22.840 align:middle line:84%
and that'll find the process
ID for the LSASS service.

00:07:22.840 --> 00:07:24.777 align:middle line:90%
So it's provided us with that.

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

00:07:27.110 --> 00:07:29.260 align:middle line:90%
So I'll say migrate to 788.

00:07:29.260 --> 00:07:31.330 align:middle line:84%
And because we have
administrative privileges,

00:07:31.330 --> 00:07:36.388 align:middle line:84%
we can migrate to any
process, so I'll hit Enter.

00:07:36.388 --> 00:07:36.930 align:middle line:90%
There we are.

00:07:36.930 --> 00:07:38.610 align:middle line:84%
And if I now type
in get user ID,

00:07:38.610 --> 00:07:40.380 align:middle line:84%
we should have NT
authority system

00:07:40.380 --> 00:07:44.790 align:middle line:84%
privileges which are the highest
privileges on a Windows system.

00:07:44.790 --> 00:07:45.780 align:middle line:90%
All right, fantastic.

00:07:45.780 --> 00:07:48.900 align:middle line:84%
So let's start off
first and foremost

00:07:48.900 --> 00:07:52.800 align:middle line:84%
with the Kiwi module, which
is an inbuilt meterpreter

00:07:52.800 --> 00:07:53.760 align:middle line:90%
extension.

00:07:53.760 --> 00:07:56.520 align:middle line:84%
So in order to load it,
we simply need to type

00:07:56.520 --> 00:07:58.530 align:middle line:90%
in load and then kiwi.

00:07:58.530 --> 00:07:59.490 align:middle line:90%
Hit Enter.

00:07:59.490 --> 00:08:02.310 align:middle line:84%
It's going to say loading the
extension Kiwi as you can see,

00:08:02.310 --> 00:08:06.870 align:middle line:84%
Mimikatz version 2.2.0 on
64-bit version of Windows.

00:08:06.870 --> 00:08:09.432 align:middle line:84%
And, of course, it was
developed by Benjamin Delpy.

00:08:09.432 --> 00:08:10.890 align:middle line:84%
The only reason
I'm mentioning that

00:08:10.890 --> 00:08:12.850 align:middle line:84%
is because it's
a fantastic tool.

00:08:12.850 --> 00:08:15.240 align:middle line:84%
So now that it's
loaded, if we open up

00:08:15.240 --> 00:08:18.120 align:middle line:84%
the Help menu for
the meterpreter,

00:08:18.120 --> 00:08:20.950 align:middle line:84%
you can see at the bottom we
now have the kiwi commands.

00:08:20.950 --> 00:08:24.090 align:middle line:84%
So we can use the credentials
all command to retrieve

00:08:24.090 --> 00:08:26.790 align:middle line:84%
all credentials, or
we can specifically

00:08:26.790 --> 00:08:28.890 align:middle line:90%
target the actual SAM database.

00:08:28.890 --> 00:08:33.000 align:middle line:84%
So we can use the LSA or
the local security authority

00:08:33.000 --> 00:08:35.789 align:middle line:84%
and, more specifically,
the LSASS process

00:08:35.789 --> 00:08:38.220 align:middle line:84%
to dump the contents
of the SAM database

00:08:38.220 --> 00:08:41.520 align:middle line:84%
or rather the cached
contents of the SAM database.

00:08:41.520 --> 00:08:45.070 align:middle line:84%
So, for example, I
can say creds_all,

00:08:45.070 --> 00:08:47.230 align:middle line:84%
and that will dump
all credentials.

00:08:47.230 --> 00:08:49.810 align:middle line:84%
And in this case, you
can see we get the NTLM

00:08:49.810 --> 00:08:52.450 align:middle line:90%
hash of the administrator user.

00:08:52.450 --> 00:08:55.630 align:middle line:84%
And in terms of WDigest
credentials and Kerberos

00:08:55.630 --> 00:08:58.240 align:middle line:84%
credentials, you can see
that no clear-text passwords

00:08:58.240 --> 00:08:59.770 align:middle line:90%
are specified.

00:08:59.770 --> 00:09:01.480 align:middle line:84%
Now the reason
that is the case is

00:09:01.480 --> 00:09:07.750 align:middle line:84%
because Windows versions,
probably later than Windows

00:09:07.750 --> 00:09:12.650 align:middle line:84%
8.1, do not store clear
text passwords at all.

00:09:12.650 --> 00:09:15.700 align:middle line:84%
So you'll pretty much be
running into this quite a bit,

00:09:15.700 --> 00:09:19.600 align:middle line:84%
but we were still able to
obtain the NTLM hashes.

00:09:19.600 --> 00:09:26.860 align:middle line:84%
So we can also say LSA
dump SAM and hit Enter,

00:09:26.860 --> 00:09:28.790 align:middle line:84%
and that is going
to dump all the NTLM

00:09:28.790 --> 00:09:31.610 align:middle line:84%
hashes for all the user
accounts on the system.

00:09:31.610 --> 00:09:33.640 align:middle line:84%
And if you take a closer
look, if you remember,

00:09:33.640 --> 00:09:36.490 align:middle line:84%
in my first video
within this section,

00:09:36.490 --> 00:09:38.290 align:middle line:84%
I mentioned that
the same database

00:09:38.290 --> 00:09:40.180 align:middle line:90%
is encrypted with a syskey.

00:09:40.180 --> 00:09:43.270 align:middle line:84%
And Mimikatz or
kiwi, in this case,

00:09:43.270 --> 00:09:45.520 align:middle line:84%
actually provides us
with the syskey, which

00:09:45.520 --> 00:09:48.460 align:middle line:90%
can be very useful later on.

00:09:48.460 --> 00:09:50.110 align:middle line:90%
We also get the SAM key here.

00:09:50.110 --> 00:09:53.290 align:middle line:84%
And you can see for every
user, we get the NTLM hash, so

00:09:53.290 --> 00:09:54.800 align:middle line:90%
the administrator user.

00:09:54.800 --> 00:09:57.670 align:middle line:84%
We also have the user
account student here,

00:09:57.670 --> 00:10:01.780 align:middle line:84%
and we get the NTLM hash for
the user account student.

00:10:01.780 --> 00:10:04.210 align:middle line:84%
So we can also dump
the LSA secret.

00:10:04.210 --> 00:10:07.600 align:middle line:84%
So I can say LSA dump
secrets and hit Enter.

00:10:07.600 --> 00:10:13.090 align:middle line:84%
And in certain situations,
dumping the LSA secrets

00:10:13.090 --> 00:10:14.920 align:middle line:84%
could provide you
with some clear text

00:10:14.920 --> 00:10:16.930 align:middle line:90%
credentials in some cases.

00:10:16.930 --> 00:10:19.060 align:middle line:84%
So you can see in
this case, it really

00:10:19.060 --> 00:10:20.680 align:middle line:90%
doesn't provide us with much.

00:10:20.680 --> 00:10:24.910 align:middle line:84%
And, of course, I'm not going
to dive deeper into LSA secrets.

00:10:24.910 --> 00:10:28.755 align:middle line:84%
If I clear up my terminal
and I open up the Help menu,

00:10:28.755 --> 00:10:30.880 align:middle line:84%
you can take a look at the
additional Kiwi commands

00:10:30.880 --> 00:10:31.960 align:middle line:90%
that you can run.

00:10:31.960 --> 00:10:35.920 align:middle line:84%
So you can also dump
the WDigest credentials,

00:10:35.920 --> 00:10:39.928 align:middle line:84%
which we did because we run
the credentials all command.

00:10:39.928 --> 00:10:42.220 align:middle line:84%
And then, of course, if you're
working within an Active

00:10:42.220 --> 00:10:45.340 align:middle line:84%
Directory environment,
you can also essentially

00:10:45.340 --> 00:10:49.270 align:middle line:84%
work with golden tickets or
create a golden ticket, Golden

00:10:49.270 --> 00:10:51.490 align:middle line:84%
Kerberos ticket for that
matter, and then, of course,

00:10:51.490 --> 00:10:54.160 align:middle line:84%
you can list the
Kerberos ticket list

00:10:54.160 --> 00:10:57.100 align:middle line:90%
or list all Kerberos tickets.

00:10:57.100 --> 00:10:59.560 align:middle line:84%
And in terms of
what we are doing,

00:10:59.560 --> 00:11:02.170 align:middle line:84%
another great tool or
command that you can run

00:11:02.170 --> 00:11:03.530 align:middle line:90%
is password change.

00:11:03.530 --> 00:11:06.350 align:middle line:84%
So you can change the
password or hash of a user.

00:11:06.350 --> 00:11:08.800 align:middle line:84%
Now, as I said, during
a penetration test,

00:11:08.800 --> 00:11:11.410 align:middle line:84%
I would not recommend doing
that because you're obviously

00:11:11.410 --> 00:11:14.320 align:middle line:84%
changing an account
password that is being used

00:11:14.320 --> 00:11:15.860 align:middle line:90%
in a production environment.

00:11:15.860 --> 00:11:21.130 align:middle line:84%
So do you refrain from running
that if you do not need to.

00:11:21.130 --> 00:11:23.630 align:middle line:84%
Now, as I said, you might be
thinking to yourself, well,

00:11:23.630 --> 00:11:25.780 align:middle line:90%
why are hashes so important?

00:11:25.780 --> 00:11:28.900 align:middle line:84%
I know we can crack them,
but cracking in and of itself

00:11:28.900 --> 00:11:30.500 align:middle line:90%
is a very difficult process.

00:11:30.500 --> 00:11:32.320 align:middle line:84%
And based on the
password strength

00:11:32.320 --> 00:11:34.150 align:middle line:84%
or the strength of
the password, it

00:11:34.150 --> 00:11:36.190 align:middle line:90%
can take hours to days or weeks.

00:11:36.190 --> 00:11:39.130 align:middle line:84%
And in certain
cases, you might not

00:11:39.130 --> 00:11:41.750 align:middle line:84%
be able to crack
the hashes at all.

00:11:41.750 --> 00:11:44.180 align:middle line:84%
So you might be
asking yourself, well,

00:11:44.180 --> 00:11:45.790 align:middle line:90%
what can we do with hashes?

00:11:45.790 --> 00:11:48.770 align:middle line:84%
And that's something that we'll
be exploring in the next video.

00:11:48.770 --> 00:11:50.980 align:middle line:84%
So I just wanted
to highlight this

00:11:50.980 --> 00:11:52.390 align:middle line:90%
before we actually continue.

00:11:52.390 --> 00:11:55.040 align:middle line:90%
So that's using the Kiwi module.

00:11:55.040 --> 00:11:56.710 align:middle line:84%
Now, of course,
it's better to learn

00:11:56.710 --> 00:12:01.490 align:middle line:84%
how to use Mimikatz by
utilizing the actual executable.

00:12:01.490 --> 00:12:03.400 align:middle line:84%
So I'll just clear
up my terminal.

00:12:03.400 --> 00:12:07.330 align:middle line:84%
And I'm currently working
within C Windows System32.

00:12:07.330 --> 00:12:10.300 align:middle line:84%
So I'll navigate to the
root of the C drive,

00:12:10.300 --> 00:12:12.340 align:middle line:84%
and I'll create a new
directory called temp.

00:12:12.340 --> 00:12:14.403 align:middle line:84%
And of course, that's just
a temporary directory.

00:12:14.403 --> 00:12:15.820 align:middle line:84%
This is where I
recommend that you

00:12:15.820 --> 00:12:18.910 align:middle line:84%
store all your working
files or exploit code.

00:12:18.910 --> 00:12:21.220 align:middle line:84%
So I'll navigate into
the temp directory.

00:12:21.220 --> 00:12:23.500 align:middle line:84%
And as I said,
Kavi Linux already

00:12:23.500 --> 00:12:26.710 align:middle line:84%
has the Mimikatz executable
available for you,

00:12:26.710 --> 00:12:28.690 align:middle line:84%
and it is found under
the following directory.

00:12:28.690 --> 00:12:30.375 align:middle line:84%
So we can upload
it to the target.

00:12:30.375 --> 00:12:31.750 align:middle line:84%
I'm going to say
Upload, and it's

00:12:31.750 --> 00:12:38.290 align:middle line:84%
under user, share, Windows,
resources, Mimikatz, x64.

00:12:38.290 --> 00:12:41.080 align:middle line:84%
And of course, you can also
upload the 32-bit Mimikatz

00:12:41.080 --> 00:12:42.070 align:middle line:90%
executable.

00:12:42.070 --> 00:12:45.430 align:middle line:84%
And then, of course,
many mimikatz.exe.

00:12:45.430 --> 00:12:46.930 align:middle line:90%
I'll upload that.

00:12:46.930 --> 00:12:47.492 align:middle line:90%
There we are.

00:12:47.492 --> 00:12:48.700 align:middle line:90%
That's uploaded successfully.

00:12:48.700 --> 00:12:53.650 align:middle line:84%
And I'll open up a shell session
or a command shell session.

00:12:53.650 --> 00:12:57.120 align:middle line:84%
All right, we'll give
that a couple of seconds.

00:12:57.120 --> 00:12:57.780 align:middle line:90%
There we are.

00:12:57.780 --> 00:13:00.273 align:middle line:84%
And if I list out the
contents of this directory,

00:13:00.273 --> 00:13:01.690 align:middle line:84%
you can see we
have Mimikatz here.

00:13:01.690 --> 00:13:06.630 align:middle line:84%
So we can easily execute
it by saying mimikatz.exe.

00:13:06.630 --> 00:13:07.548 align:middle line:90%
I'll hit Enter.

00:13:07.548 --> 00:13:09.090 align:middle line:84%
And as you can see,
that provides you

00:13:09.090 --> 00:13:12.390 align:middle line:84%
with the Mimikatz terminal
or console, if you will.

00:13:12.390 --> 00:13:14.460 align:middle line:84%
The first thing I
would recommend doing

00:13:14.460 --> 00:13:16.050 align:middle line:84%
is to actually check
whether you have

00:13:16.050 --> 00:13:18.060 align:middle line:90%
the appropriate privileges.

00:13:18.060 --> 00:13:22.590 align:middle line:84%
And this can be confirmed by
typing in privilege colon colon

00:13:22.590 --> 00:13:24.210 align:middle line:90%
debug.

00:13:24.210 --> 00:13:26.340 align:middle line:84%
And if it tells you
privilege 20 OK,

00:13:26.340 --> 00:13:28.980 align:middle line:84%
that means that you have the
required privileges in order

00:13:28.980 --> 00:13:32.250 align:middle line:84%
to perform hash
extraction from memory.

00:13:32.250 --> 00:13:34.570 align:middle line:84%
All right, so now
that we've done that,

00:13:34.570 --> 00:13:37.020 align:middle line:84%
let's take a look at how we
can replicate what we just

00:13:37.020 --> 00:13:38.800 align:middle line:90%
did with the Kiwi module.

00:13:38.800 --> 00:13:41.490 align:middle line:84%
So if we want to dump the
contents of the SAM database

00:13:41.490 --> 00:13:46.680 align:middle line:84%
or rather dump the actual cache
of the LSA or LSASS process,

00:13:46.680 --> 00:13:53.780 align:middle line:84%
we can say lsadump
colon colon, hit Enter,

00:13:53.780 --> 00:13:56.330 align:middle line:84%
and this will provide you
with much more information

00:13:56.330 --> 00:13:57.890 align:middle line:90%
that Kiwi would.

00:13:57.890 --> 00:14:00.590 align:middle line:84%
And again, if we just take a
look at the output immediately,

00:14:00.590 --> 00:14:03.980 align:middle line:84%
you can see that it provides
you with the domain the syskey,

00:14:03.980 --> 00:14:06.360 align:middle line:84%
and then, of course, you
have your SAM key there.

00:14:06.360 --> 00:14:08.030 align:middle line:84%
And then for the
administrator, you

00:14:08.030 --> 00:14:10.220 align:middle line:84%
have the actual RID,
which in this case

00:14:10.220 --> 00:14:13.250 align:middle line:84%
is 500, which confirms that
this indeed is the administrator

00:14:13.250 --> 00:14:13.970 align:middle line:90%
user.

00:14:13.970 --> 00:14:17.150 align:middle line:84%
You then have the NTLM
hash right over here.

00:14:17.150 --> 00:14:19.760 align:middle line:84%
You also have the supplementary
credentials, which

00:14:19.760 --> 00:14:21.590 align:middle line:90%
will not get into right now.

00:14:21.590 --> 00:14:23.330 align:middle line:84%
And of course, if
you take a look

00:14:23.330 --> 00:14:25.590 align:middle line:84%
at the other users like
the student account,

00:14:25.590 --> 00:14:29.100 align:middle line:84%
you also have the hashes for
that particular user account.

00:14:29.100 --> 00:14:30.170 align:middle line:90%
So on and so forth.

00:14:30.170 --> 00:14:33.410 align:middle line:84%
But we don't really get
anything of importance

00:14:33.410 --> 00:14:35.450 align:middle line:84%
in terms of clear-text
credentials.

00:14:35.450 --> 00:14:41.580 align:middle line:84%
We can also dump LSA secrets
by saying lsadump colon colon

00:14:41.580 --> 00:14:42.080 align:middle line:90%
secrets.

00:14:42.080 --> 00:14:44.578 align:middle line:90%


00:14:44.578 --> 00:14:45.120 align:middle line:90%
There we are.

00:14:45.120 --> 00:14:46.650 align:middle line:84%
And we get the
same output that we

00:14:46.650 --> 00:14:49.770 align:middle line:84%
did when we ran the
same command or rather

00:14:49.770 --> 00:14:52.920 align:middle line:84%
a variant of the same
command with Kiwi.

00:14:52.920 --> 00:14:55.530 align:middle line:84%
Now one great thing
that we can actually

00:14:55.530 --> 00:14:58.650 align:middle line:84%
do with the actual
Mimikatz executables

00:14:58.650 --> 00:15:01.710 align:middle line:90%
to display log-on passwords.

00:15:01.710 --> 00:15:05.190 align:middle line:84%
So whenever a user
logs on to Windows,

00:15:05.190 --> 00:15:06.840 align:middle line:84%
if the system has
been configured

00:15:06.840 --> 00:15:11.850 align:middle line:84%
to store log-on passwords in
memory in clear text rather,

00:15:11.850 --> 00:15:14.490 align:middle line:84%
Mimikatz can actually
show you those passwords.

00:15:14.490 --> 00:15:19.470 align:middle line:84%
So in order to do that, I'll
say sekurlsa colon colon--

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

00:15:21.000 --> 00:15:28.180 align:middle line:84%
Sekurlsa, and then we
can say log-on passwords.

00:15:28.180 --> 00:15:29.590 align:middle line:90%
Hit Enter.

00:15:29.590 --> 00:15:31.210 align:middle line:84%
And again, in this
case, you can see

00:15:31.210 --> 00:15:34.390 align:middle line:84%
the system has been configured
very well in that it's not

00:15:34.390 --> 00:15:36.190 align:middle line:84%
displaying any clear
text passwords.

00:15:36.190 --> 00:15:39.130 align:middle line:84%
So let's just take a
look at the output right

00:15:39.130 --> 00:15:40.067 align:middle line:90%
from the beginning.

00:15:40.067 --> 00:15:41.650 align:middle line:84%
So these are all the
log on passwords.

00:15:41.650 --> 00:15:44.170 align:middle line:90%
So we can see that--

00:15:44.170 --> 00:15:48.910 align:middle line:84%
let me get started
from this particular--

00:15:48.910 --> 00:15:49.880 align:middle line:90%
Yeah, that's correct.

00:15:49.880 --> 00:15:54.020 align:middle line:84%
So we can head over
into a few log-ons here.

00:15:54.020 --> 00:15:57.850 align:middle line:84%
So we can see that this is an
interactive log on directly

00:15:57.850 --> 00:15:59.830 align:middle line:90%
from the window manager.

00:15:59.830 --> 00:16:03.130 align:middle line:84%
And you can see that the
password is always set to null.

00:16:03.130 --> 00:16:05.470 align:middle line:84%
So that means that clear
text passwords have

00:16:05.470 --> 00:16:07.250 align:middle line:90%
been disabled on this system.

00:16:07.250 --> 00:16:09.760 align:middle line:84%
However, if they
weren't, we should

00:16:09.760 --> 00:16:12.850 align:middle line:84%
have been able to get
the clear text passwords.

00:16:12.850 --> 00:16:16.390 align:middle line:84%
And we can take a look at the
administrator interactive log

00:16:16.390 --> 00:16:16.900 align:middle line:90%
on there.

00:16:16.900 --> 00:16:20.680 align:middle line:84%
You can see that the
password is null again.

00:16:20.680 --> 00:16:24.530 align:middle line:84%
However, we get the NTLM
hash as we did previously.

00:16:24.530 --> 00:16:26.500 align:middle line:84%
And then, of course,
the same goes

00:16:26.500 --> 00:16:28.720 align:middle line:84%
for the WDigest
credentials, so null

00:16:28.720 --> 00:16:32.290 align:middle line:84%
and then the Kerberos details
right over here, which again

00:16:32.290 --> 00:16:34.510 align:middle line:90%
the password told us is null.

00:16:34.510 --> 00:16:36.910 align:middle line:84%
So again, I just wanted to
highlight that technique

00:16:36.910 --> 00:16:40.360 align:middle line:84%
because it can be extremely
powerful and useful when

00:16:40.360 --> 00:16:42.610 align:middle line:84%
working in a
Windows environment.

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

00:16:45.400 --> 00:16:48.020 align:middle line:90%
side of this video.

00:16:48.020 --> 00:16:50.230 align:middle line:84%
All right, so now that
we've taken a look at how

00:16:50.230 --> 00:16:53.470 align:middle line:84%
we can extract NTLM
hashes from memory,

00:16:53.470 --> 00:16:56.230 align:middle line:84%
you might be asking
yourself, and of course, I

00:16:56.230 --> 00:16:59.140 align:middle line:84%
mentioned the same thing within
the practical demonstration,

00:16:59.140 --> 00:17:02.230 align:middle line:84%
what can we do with
these hashes in regards

00:17:02.230 --> 00:17:07.030 align:middle line:84%
to further exploiting a
system or moving or performing

00:17:07.030 --> 00:17:07.910 align:middle line:90%
lateral movement?

00:17:07.910 --> 00:17:11.290 align:middle line:84%
Well, the technique that we're
going to be focusing on next

00:17:11.290 --> 00:17:12.880 align:middle line:90%
is called pass the hash.

00:17:12.880 --> 00:17:15.460 align:middle line:84%
And that's what we'll be
covering in the next video,

00:17:15.460 --> 00:17:17.319 align:middle line:84%
and it will address
this question,

00:17:17.319 --> 00:17:21.550 align:middle line:84%
and we'll show you why password
hashes are almost as valuable

00:17:21.550 --> 00:17:23.530 align:middle line:90%
as clear text passwords.

00:17:23.530 --> 00:17:27.180 align:middle line:84%
So I'll see you
in the next video.

00:17:27.180 --> 00:17:28.000 align:middle line:90%