WEBVTT

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


00:00:10.170 --> 00:00:12.420 align:middle line:84%
Welcome to the
Windows Hash Cracking

00:00:12.420 --> 00:00:14.160 align:middle line:90%
section of this course.

00:00:14.160 --> 00:00:16.140 align:middle line:84%
In this section, we
will be exploring

00:00:16.140 --> 00:00:21.390 align:middle line:84%
the process of how to dump and
crack NTLM hashes on a Windows

00:00:21.390 --> 00:00:24.000 align:middle line:84%
target system that
you have compromised.

00:00:24.000 --> 00:00:26.520 align:middle line:84%
All right, so as I
said, these sections

00:00:26.520 --> 00:00:28.320 align:middle line:84%
are going to be
relatively short.

00:00:28.320 --> 00:00:31.860 align:middle line:84%
We're just going to essentially
cover everything in one video.

00:00:31.860 --> 00:00:34.830 align:middle line:84%
The reason for that will
become very clear, primarily

00:00:34.830 --> 00:00:37.950 align:middle line:84%
because we've already explored
the process of dumping

00:00:37.950 --> 00:00:41.620 align:middle line:84%
NTLM hashes in the system and
host based attacks course.

00:00:41.620 --> 00:00:43.560 align:middle line:84%
We are primarily
focusing on how to crack

00:00:43.560 --> 00:00:46.110 align:middle line:90%
NTLM hashes in this video.

00:00:46.110 --> 00:00:49.140 align:middle line:84%
With that being said,
let's get an understanding

00:00:49.140 --> 00:00:52.110 align:middle line:84%
or let's revisit Windows
password hashes before we

00:00:52.110 --> 00:00:55.980 align:middle line:90%
actually continue or move on.

00:00:55.980 --> 00:00:59.160 align:middle line:84%
All right, so the Windows
operating system stores

00:00:59.160 --> 00:01:03.690 align:middle line:84%
hashed user account passwords
locally in the SAM database.

00:01:03.690 --> 00:01:07.560 align:middle line:84%
SAM stands for the
Security Accounts Manager.

00:01:07.560 --> 00:01:09.300 align:middle line:84%
All right, so this
database file is

00:01:09.300 --> 00:01:12.990 align:middle line:84%
where you have all the hashed
user account passwords stored

00:01:12.990 --> 00:01:16.860 align:middle line:84%
on Windows, because most
modern versions of Windows

00:01:16.860 --> 00:01:19.380 align:middle line:84%
do not store clear
text passwords, right?

00:01:19.380 --> 00:01:23.700 align:middle line:84%
So when you create a user
account, the hashed--

00:01:23.700 --> 00:01:26.130 align:middle line:84%
whenever you specify
your clear text password,

00:01:26.130 --> 00:01:30.000 align:middle line:84%
that password is hashed and
stored in its hashed format.

00:01:30.000 --> 00:01:33.360 align:middle line:84%
So Windows really doesn't
know what the clear text

00:01:33.360 --> 00:01:35.010 align:middle line:90%
equivalent is.

00:01:35.010 --> 00:01:38.580 align:middle line:84%
When you log on to the system
and you provide the clear text

00:01:38.580 --> 00:01:40.620 align:middle line:84%
password, that is
hashed and that

00:01:40.620 --> 00:01:44.640 align:middle line:84%
is compared to the one that's
stored within the same database

00:01:44.640 --> 00:01:45.870 align:middle line:90%
to see whether they match.

00:01:45.870 --> 00:01:48.390 align:middle line:84%
If they match, you're
authenticated successfully.

00:01:48.390 --> 00:01:51.090 align:middle line:84%
If they don't match, then you've
entered the incorrect password,

00:01:51.090 --> 00:01:51.590 align:middle line:90%
right?

00:01:51.590 --> 00:01:52.980 align:middle line:90%
So what is hashing?

00:01:52.980 --> 00:01:55.950 align:middle line:84%
Hashing is the process of
converting a piece of data

00:01:55.950 --> 00:01:57.360 align:middle line:90%
into another value.

00:01:57.360 --> 00:01:59.970 align:middle line:84%
A hashing function
or algorithm is

00:01:59.970 --> 00:02:01.770 align:middle line:90%
used to generate the new value.

00:02:01.770 --> 00:02:03.750 align:middle line:84%
The result of the
hashing algorithm

00:02:03.750 --> 00:02:06.670 align:middle line:84%
is known as a hash
or hash value.

00:02:06.670 --> 00:02:09.780 align:middle line:84%
Now, on Windows authentication
and verification

00:02:09.780 --> 00:02:12.270 align:middle line:84%
of user credentials
is facilitated

00:02:12.270 --> 00:02:16.500 align:middle line:84%
by the local security
authority also known as LSA.

00:02:16.500 --> 00:02:18.660 align:middle line:84%
Now, in terms of
the different types

00:02:18.660 --> 00:02:22.860 align:middle line:84%
of hash formats on Windows,
Windows versions up to Windows

00:02:22.860 --> 00:02:26.940 align:middle line:84%
Server 2003 utilize two
different types of hashes.

00:02:26.940 --> 00:02:30.630 align:middle line:84%
So you have your LM
hash and your NTLM hash.

00:02:30.630 --> 00:02:34.650 align:middle line:84%
All right, now, Windows
disables or disabled LM hashing

00:02:34.650 --> 00:02:37.620 align:middle line:84%
and utilizes NTLM
hashing by default

00:02:37.620 --> 00:02:39.420 align:middle line:90%
from Windows Vista onwards.

00:02:39.420 --> 00:02:43.650 align:middle line:84%
So everything from Windows
Vista, so Windows 7, 8, 8.1,

00:02:43.650 --> 00:02:48.090 align:middle line:84%
Windows 10, Windows 11 now
utilize NTLM hashing, right?

00:02:48.090 --> 00:02:50.790 align:middle line:84%
And, of course, there's
various versions of NTLM.

00:02:50.790 --> 00:02:52.800 align:middle line:84%
In this video, we're
primarily focused

00:02:52.800 --> 00:02:56.250 align:middle line:90%
on NTLM, so not NTLMv1, NTLMv2.

00:02:56.250 --> 00:02:57.750 align:middle line:84%
That's something
we'll be exploring

00:02:57.750 --> 00:03:00.580 align:middle line:90%
in another certification.

00:03:00.580 --> 00:03:03.900 align:middle line:84%
So I briefly mentioned
the SAM database, right?

00:03:03.900 --> 00:03:07.590 align:middle line:84%
So SAM, which stands for
Security Account Manager,

00:03:07.590 --> 00:03:10.650 align:middle line:84%
is a database file that is
responsible for managing

00:03:10.650 --> 00:03:13.260 align:middle line:84%
user accounts and
passwords on Windows.

00:03:13.260 --> 00:03:17.580 align:middle line:84%
All user account passwords that
are stored in the SAM database

00:03:17.580 --> 00:03:20.100 align:middle line:84%
or hashed as I've
already mentioned.

00:03:20.100 --> 00:03:22.350 align:middle line:84%
Now, the SAM database,
as you can already tell,

00:03:22.350 --> 00:03:26.910 align:middle line:84%
is quite similar to the
/etc/shadow file on Linux.

00:03:26.910 --> 00:03:30.300 align:middle line:84%
Now, the interesting thing about
SAM database file is that it

00:03:30.300 --> 00:03:33.000 align:middle line:84%
cannot be copied while the
operating system is running,

00:03:33.000 --> 00:03:35.320 align:middle line:84%
because you may be
thinking to yourself, well,

00:03:35.320 --> 00:03:37.830 align:middle line:84%
if I wanted to dump the
user account hashes,

00:03:37.830 --> 00:03:38.890 align:middle line:90%
how would I do this?

00:03:38.890 --> 00:03:41.130 align:middle line:84%
Can I just copy the
SAM database file?

00:03:41.130 --> 00:03:43.770 align:middle line:84%
Well, you actually cannot do
that while the operating system

00:03:43.770 --> 00:03:44.460 align:middle line:90%
is running.

00:03:44.460 --> 00:03:47.220 align:middle line:84%
So from the perspective
of a penetration test,

00:03:47.220 --> 00:03:49.590 align:middle line:84%
this is not really
a viable technique.

00:03:49.590 --> 00:03:52.650 align:middle line:84%
However, there are
situations or scenarios

00:03:52.650 --> 00:03:55.380 align:middle line:84%
where a copy of the
SAM database file

00:03:55.380 --> 00:04:00.300 align:middle line:84%
has been made on the system
for two primary reasons, one

00:04:00.300 --> 00:04:04.200 align:middle line:84%
of which is just taking a backup
and the administrator did not

00:04:04.200 --> 00:04:08.160 align:middle line:84%
delete the backup file,
therefore providing attackers

00:04:08.160 --> 00:04:10.890 align:middle line:84%
with essentially a copy
of the SAM database

00:04:10.890 --> 00:04:13.470 align:middle line:84%
that they can
download or transfer.

00:04:13.470 --> 00:04:18.149 align:middle line:84%
And secondly, when the Windows
operating system encounters

00:04:18.149 --> 00:04:22.000 align:middle line:84%
an issue and you try and
repair the operating system,

00:04:22.000 --> 00:04:25.110 align:middle line:84%
if you have ever used the
Windows Repair utility,

00:04:25.110 --> 00:04:28.380 align:middle line:84%
then Windows will make a copy
of the SAM database file.

00:04:28.380 --> 00:04:32.830 align:middle line:84%
And this copy usually needs
to be deleted manually.

00:04:32.830 --> 00:04:35.160 align:middle line:84%
So again, there
are scenarios where

00:04:35.160 --> 00:04:38.580 align:middle line:84%
you might find a copy of
the SAM database file.

00:04:38.580 --> 00:04:40.590 align:middle line:84%
All right, so the
Windows NT kernel,

00:04:40.590 --> 00:04:42.930 align:middle line:84%
which is just the
Windows kernel itself,

00:04:42.930 --> 00:04:45.180 align:middle line:84%
keeps the SAM
database file locked.

00:04:45.180 --> 00:04:47.250 align:middle line:84%
And as a result,
attackers typically

00:04:47.250 --> 00:04:51.000 align:middle line:84%
utilize in-memory techniques
to dump the SAM hashes

00:04:51.000 --> 00:04:53.400 align:middle line:90%
from the LSASS process cache.

00:04:53.400 --> 00:04:56.370 align:middle line:84%
All right, so we'll actually
get into the LSASS process.

00:04:56.370 --> 00:05:01.170 align:middle line:84%
But LSASS stands for the Local
Security Authority Subsystem.

00:05:01.170 --> 00:05:04.440 align:middle line:84%
And this process on
Windows essentially

00:05:04.440 --> 00:05:09.010 align:middle line:84%
is used for authentication and
verification of credentials,

00:05:09.010 --> 00:05:09.510 align:middle line:90%
right?

00:05:09.510 --> 00:05:11.850 align:middle line:84%
And for that
reason, it interacts

00:05:11.850 --> 00:05:12.960 align:middle line:90%
with the SAM database.

00:05:12.960 --> 00:05:15.930 align:middle line:84%
Now, this process
has a cache, right?

00:05:15.930 --> 00:05:18.240 align:middle line:84%
A cache is typically
where a program

00:05:18.240 --> 00:05:19.890 align:middle line:90%
will store temporary data.

00:05:19.890 --> 00:05:22.830 align:middle line:84%
Now, attackers and pen
testers will typically

00:05:22.830 --> 00:05:25.860 align:middle line:84%
utilize in-memory
techniques to dump the SAM

00:05:25.860 --> 00:05:28.470 align:middle line:84%
hashes from the
LSASS process cache,

00:05:28.470 --> 00:05:31.350 align:middle line:84%
because when the LSASS
process is again,

00:05:31.350 --> 00:05:35.550 align:middle line:84%
being utilized to verify and/or
for verification of credentials

00:05:35.550 --> 00:05:39.750 align:middle line:84%
and authentication, it will go
and check the same database,

00:05:39.750 --> 00:05:42.460 align:middle line:84%
and it stores that
information in its cache.

00:05:42.460 --> 00:05:44.400 align:middle line:84%
And if we can gain
access to that cache,

00:05:44.400 --> 00:05:46.740 align:middle line:84%
then we can get
the actual hashes

00:05:46.740 --> 00:05:49.950 align:middle line:84%
that are stored in that cache
and consequently crack them.

00:05:49.950 --> 00:05:53.160 align:middle line:84%
All right, so in modern
versions of Windows,

00:05:53.160 --> 00:05:56.220 align:middle line:84%
the SAM database is
encrypted with a syskey.

00:05:56.220 --> 00:05:58.620 align:middle line:90%
And in order for you to dump--

00:05:58.620 --> 00:06:01.470 align:middle line:84%
to access and interact
with the LSASS process

00:06:01.470 --> 00:06:06.340 align:middle line:84%
and consequently dump the actual
hashes from the SAM database,

00:06:06.340 --> 00:06:09.360 align:middle line:84%
you need elevated or
administrative privileges

00:06:09.360 --> 00:06:12.180 align:middle line:84%
on the target system,
which is why I'm making

00:06:12.180 --> 00:06:14.760 align:middle line:84%
or we have actually covered
this topic at the end

00:06:14.760 --> 00:06:17.490 align:middle line:84%
after performing privilege
escalation, right?

00:06:17.490 --> 00:06:20.280 align:middle line:90%
So do keep that in mind.

00:06:20.280 --> 00:06:22.910 align:middle line:84%
Now, let's learn a little
bit more about the NTLM hash,

00:06:22.910 --> 00:06:25.250 align:middle line:84%
also known as the
NTHash, all right?

00:06:25.250 --> 00:06:28.670 align:middle line:84%
So NTLM is a collection of
authentication protocols

00:06:28.670 --> 00:06:31.640 align:middle line:84%
that are utilized in Windows
to facilitate authentication

00:06:31.640 --> 00:06:32.900 align:middle line:90%
between computers.

00:06:32.900 --> 00:06:34.760 align:middle line:84%
The authentication
process involves

00:06:34.760 --> 00:06:36.500 align:middle line:84%
using a valid
username and password

00:06:36.500 --> 00:06:38.090 align:middle line:90%
to authenticate successfully.

00:06:38.090 --> 00:06:40.130 align:middle line:84%
From Windows Vista
onwards, Windows

00:06:40.130 --> 00:06:43.880 align:middle line:84%
disables LM hashing and
utilizes NTLM hashing.

00:06:43.880 --> 00:06:45.890 align:middle line:84%
So when a user
account is created,

00:06:45.890 --> 00:06:48.980 align:middle line:84%
it is encrypted using the
MD4 hashing algorithm,

00:06:48.980 --> 00:06:51.740 align:middle line:84%
while the original
password is disposed of.

00:06:51.740 --> 00:06:55.050 align:middle line:84%
NTLM improves upon LM
in the following ways.

00:06:55.050 --> 00:06:59.150 align:middle line:84%
So firstly, NTLM does not
split the hash into two chunks,

00:06:59.150 --> 00:07:02.690 align:middle line:84%
and allows passwords
to be case sensitive,

00:07:02.690 --> 00:07:06.210 align:middle line:84%
and also allows the use of
symbols and unicode characters.

00:07:06.210 --> 00:07:09.170 align:middle line:84%
So if you've gone through the
system and host-based attacks

00:07:09.170 --> 00:07:11.900 align:middle line:84%
course, you should know the
difference between an LM

00:07:11.900 --> 00:07:15.260 align:middle line:84%
hash and an NTLM
hash and why NTLM

00:07:15.260 --> 00:07:17.900 align:middle line:84%
is much better from a
security perspective.

00:07:17.900 --> 00:07:20.750 align:middle line:84%
But from a pen test perspective,
it makes it a little bit

00:07:20.750 --> 00:07:23.540 align:middle line:84%
complicated, because
the password is not

00:07:23.540 --> 00:07:25.790 align:middle line:90%
limited to a specific length.

00:07:25.790 --> 00:07:29.780 align:middle line:84%
Passwords can be case sensitive
and passwords can also utilize

00:07:29.780 --> 00:07:33.050 align:middle line:90%
symbols and unicode characters.

00:07:33.050 --> 00:07:35.270 align:middle line:84%
So this is the NTLM
hashing process

00:07:35.270 --> 00:07:37.937 align:middle line:84%
where when we're
creating a user account,

00:07:37.937 --> 00:07:39.770 align:middle line:84%
we can specify the
following password, which

00:07:39.770 --> 00:07:40.790 align:middle line:90%
is quite secure.

00:07:40.790 --> 00:07:44.270 align:middle line:84%
It contains symbols, uppercase,
and lowercase letters

00:07:44.270 --> 00:07:48.110 align:middle line:84%
as well as the numbers and
some special unicode characters

00:07:48.110 --> 00:07:50.840 align:middle line:84%
that is hashed using the
MD4 hashing algorithm

00:07:50.840 --> 00:07:54.830 align:middle line:90%
and that produces the NTLM hash.

00:07:54.830 --> 00:07:56.900 align:middle line:84%
All right, so in terms
of dumping and cracking

00:07:56.900 --> 00:07:59.990 align:middle line:84%
NTLM hashes, we can dump
Windows password hashes

00:07:59.990 --> 00:08:03.410 align:middle line:84%
by leveraging various utilities
like the inbuilt meterpreter

00:08:03.410 --> 00:08:06.170 align:middle line:84%
hash dump command, which
is what we will be using.

00:08:06.170 --> 00:08:08.450 align:middle line:84%
If you want to learn more
about how to dump hashes

00:08:08.450 --> 00:08:11.990 align:middle line:84%
with Mimikatz, you can check out
the Metasploit Framework course

00:08:11.990 --> 00:08:14.460 align:middle line:84%
or the System and
Host-based Attacks course

00:08:14.460 --> 00:08:17.510 align:middle line:84%
to learn more about how to use
it as we have covered it quite

00:08:17.510 --> 00:08:19.220 align:middle line:90%
extensively by this point.

00:08:19.220 --> 00:08:21.290 align:middle line:84%
So after we have
dumped the hashes,

00:08:21.290 --> 00:08:24.500 align:middle line:84%
we can crack them through the
use of the following utilities.

00:08:24.500 --> 00:08:27.860 align:middle line:84%
One of them is John the Ripper
and the other is Hashcat.

00:08:27.860 --> 00:08:30.260 align:middle line:84%
And we'll be focusing on
how to use both of them

00:08:30.260 --> 00:08:32.240 align:middle line:90%
to crack NTLM hashes.

00:08:32.240 --> 00:08:35.690 align:middle line:84%
With that being said, this
video has a lab environment

00:08:35.690 --> 00:08:36.480 align:middle line:90%
attached to it.

00:08:36.480 --> 00:08:39.230 align:middle line:84%
So all you need to do is just
fire up the lab environment,

00:08:39.230 --> 00:08:41.700 align:middle line:84%
and we will be gaining
access to the target system

00:08:41.700 --> 00:08:44.960 align:middle line:84%
firstly, after which we will
check and see whether we

00:08:44.960 --> 00:08:46.760 align:middle line:90%
have elevated privileges.

00:08:46.760 --> 00:08:48.380 align:middle line:84%
After we've done
that, we can then

00:08:48.380 --> 00:08:50.390 align:middle line:84%
go ahead and dump
the hashes and then

00:08:50.390 --> 00:08:54.170 align:middle line:84%
take a look at how they can be
cracked with John the Ripper

00:08:54.170 --> 00:08:55.580 align:middle line:90%
and of course Hashcat.

00:08:55.580 --> 00:08:59.340 align:middle line:84%
So with that out of the way,
we can actually get started.

00:08:59.340 --> 00:09:03.530 align:middle line:84%
So I'll see you in
the lab environment.

00:09:03.530 --> 00:09:05.880 align:middle line:84%
All right, so I'm back
in the lab environment.

00:09:05.880 --> 00:09:08.557 align:middle line:84%
And you will be provided
with the target IP address.

00:09:08.557 --> 00:09:10.640 align:middle line:84%
In your case, it's going
to be different, but just

00:09:10.640 --> 00:09:12.270 align:middle line:90%
copy the value.

00:09:12.270 --> 00:09:14.510 align:middle line:84%
The next step, of course,
is to perform an Nmap

00:09:14.510 --> 00:09:16.670 align:middle line:84%
scan on the target
system to identify

00:09:16.670 --> 00:09:19.520 align:middle line:84%
the vulnerable service
that is running that we

00:09:19.520 --> 00:09:21.300 align:middle line:90%
can exploit to gain access.

00:09:21.300 --> 00:09:24.260 align:middle line:84%
So I'll Nmap and we'll perform
a quick service version

00:09:24.260 --> 00:09:25.710 align:middle line:90%
detection scan.

00:09:25.710 --> 00:09:28.040 align:middle line:84%
And in this case, I know
that the vulnerable service

00:09:28.040 --> 00:09:29.310 align:middle line:90%
is running on port 80.

00:09:29.310 --> 00:09:33.520 align:middle line:84%
So I'll just limit the scan to
port 80, and I'll hit Enter.

00:09:33.520 --> 00:09:35.645 align:middle line:84%
And I'll give this a couple
of seconds to complete.

00:09:35.645 --> 00:09:39.130 align:middle line:90%


00:09:39.130 --> 00:09:40.900 align:middle line:84%
All right, the Nmap
scan is complete.

00:09:40.900 --> 00:09:43.050 align:middle line:84%
And as you can see,
we have the web server

00:09:43.050 --> 00:09:44.970 align:middle line:90%
open or port 80 open.

00:09:44.970 --> 00:09:47.550 align:middle line:84%
And we have a web
application called

00:09:47.550 --> 00:09:52.650 align:middle line:84%
BadBlue or rather a web server
called BadBlue version 2.7.

00:09:52.650 --> 00:09:55.560 align:middle line:84%
We already know that there
is a vulnerability that

00:09:55.560 --> 00:09:58.380 align:middle line:84%
affects this particular
version of BadBlue.

00:09:58.380 --> 00:10:01.530 align:middle line:84%
So we can actually confirm
that by searching for BadBlue.

00:10:01.530 --> 00:10:04.710 align:middle line:84%
And I'll just type it in
with the correct case.

00:10:04.710 --> 00:10:05.670 align:middle line:90%
There we are.

00:10:05.670 --> 00:10:08.580 align:middle line:84%
And you can see that we have
the Metasploit Framework Exploit

00:10:08.580 --> 00:10:10.920 align:middle line:90%
module here for version 2.7.

00:10:10.920 --> 00:10:14.660 align:middle line:90%
So we'll open up msfconsole.

00:10:14.660 --> 00:10:16.460 align:middle line:84%
And we'll search for
the Exploit Module.

00:10:16.460 --> 00:10:20.820 align:middle line:90%


00:10:20.820 --> 00:10:21.810 align:middle line:90%
All right, there we go.

00:10:21.810 --> 00:10:24.030 align:middle line:84%
The Metasploit Framework
Console is starting up.

00:10:24.030 --> 00:10:28.110 align:middle line:84%
So I'll say, search and
BadBlue, and I can then

00:10:28.110 --> 00:10:31.530 align:middle line:84%
say, use option 1
or use module 1.

00:10:31.530 --> 00:10:33.640 align:middle line:84%
And I'm using the
identifier here.

00:10:33.640 --> 00:10:35.590 align:middle line:84%
So this is the module
we want to use.

00:10:35.590 --> 00:10:37.350 align:middle line:84%
You can also copy
the module name

00:10:37.350 --> 00:10:40.410 align:middle line:84%
and say, use and paste
the module name there.

00:10:40.410 --> 00:10:42.030 align:middle line:90%
I'll just say, use 1.

00:10:42.030 --> 00:10:45.820 align:middle line:84%
The default payload is the
32-bit meterpreter payload,

00:10:45.820 --> 00:10:47.370 align:middle line:84%
which is perfectly
fine, because we

00:10:47.370 --> 00:10:50.400 align:middle line:84%
don't know what the
target operating system

00:10:50.400 --> 00:10:52.560 align:middle line:90%
architecture is yet, all right.

00:10:52.560 --> 00:10:56.190 align:middle line:84%
So we can show the
options here, and we need

00:10:56.190 --> 00:10:57.480 align:middle line:90%
to set the payload options.

00:10:57.480 --> 00:10:58.980 align:middle line:90%
In my case, they're already set.

00:10:58.980 --> 00:11:02.220 align:middle line:84%
If they are not, you can
type in the ifconfig command

00:11:02.220 --> 00:11:04.080 align:middle line:84%
and get your Kali
Linux IP address

00:11:04.080 --> 00:11:09.090 align:middle line:84%
and set the Lhost option or set
the value for the Lhost option

00:11:09.090 --> 00:11:09.810 align:middle line:90%
yourself.

00:11:09.810 --> 00:11:13.800 align:middle line:84%
The default port or the default
value for the Lport option

00:11:13.800 --> 00:11:17.190 align:middle line:84%
is 4444, which is perfectly
fine in this case.

00:11:17.190 --> 00:11:20.580 align:middle line:84%
So I'll set the target IP by
saying, set Rhosts, and then

00:11:20.580 --> 00:11:22.950 align:middle line:84%
I specify the target
IP that I copied.

00:11:22.950 --> 00:11:26.115 align:middle line:90%
And I'll type in Exploit.

00:11:26.115 --> 00:11:27.990 align:middle line:84%
All right, so that's
going to send the stage,

00:11:27.990 --> 00:11:32.290 align:middle line:84%
and we should receive a
meterpreter session, fantastic.

00:11:32.290 --> 00:11:37.440 align:middle line:84%
So let's perform some basic
local enumeration, sysinfo.

00:11:37.440 --> 00:11:40.890 align:middle line:84%
You can see that the target
operating system is Windows

00:11:40.890 --> 00:11:44.790 align:middle line:90%
Server 2012 R2, build 9,600.

00:11:44.790 --> 00:11:47.730 align:middle line:84%
It is a 64-bit operating
system, and we have

00:11:47.730 --> 00:11:49.980 align:middle line:90%
a 32-bit meterpreter session.

00:11:49.980 --> 00:11:52.350 align:middle line:84%
And we currently have
access to the target system

00:11:52.350 --> 00:11:55.060 align:middle line:84%
as the administrator
user, which is fantastic.

00:11:55.060 --> 00:11:58.380 align:middle line:84%
And we can confirm that
by typing in getprivs.

00:11:58.380 --> 00:12:00.750 align:middle line:84%
So I'll just type
in the command here.

00:12:00.750 --> 00:12:02.670 align:middle line:84%
And you can see we
have the permissions

00:12:02.670 --> 00:12:06.010 align:middle line:84%
that you typically associate
with the administrator user.

00:12:06.010 --> 00:12:09.090 align:middle line:84%
So that means that we do not
need to elevate our privileges

00:12:09.090 --> 00:12:12.990 align:middle line:84%
and can consequently move
on to the next phase, which

00:12:12.990 --> 00:12:15.210 align:middle line:90%
is dumping the NTLM hashes.

00:12:15.210 --> 00:12:18.510 align:middle line:84%
However, before we do this,
given the fact that we're

00:12:18.510 --> 00:12:22.470 align:middle line:84%
going to be targeting the LSASS
process or the LSASS process

00:12:22.470 --> 00:12:26.460 align:middle line:84%
cache, it would be a good
idea to migrate or to identify

00:12:26.460 --> 00:12:30.000 align:middle line:84%
the LSASS process ID
by saying pgrep LSASS

00:12:30.000 --> 00:12:31.770 align:middle line:90%
and then migrating into it.

00:12:31.770 --> 00:12:34.540 align:middle line:84%
This will essentially
solve two issues.

00:12:34.540 --> 00:12:37.050 align:middle line:84%
Firstly, it will upgrade
our meterpreter session

00:12:37.050 --> 00:12:39.450 align:middle line:90%
to a 64-bit meterpreter session.

00:12:39.450 --> 00:12:42.780 align:middle line:84%
And secondly, it'll essentially
make our meterpreter session

00:12:42.780 --> 00:12:47.430 align:middle line:84%
much more stable in the context
of accessing the LSASS process

00:12:47.430 --> 00:12:48.480 align:middle line:90%
cache.

00:12:48.480 --> 00:12:53.120 align:middle line:84%
So I'll say, migrate, and
if successful it should say,

00:12:53.120 --> 00:12:55.130 align:middle line:84%
migration completed
successfully.

00:12:55.130 --> 00:12:57.860 align:middle line:84%
I can now utilize the
hash dump utility.

00:12:57.860 --> 00:13:01.220 align:middle line:84%
You can also load the kiwi
module, which is essentially

00:13:01.220 --> 00:13:05.210 align:middle line:84%
a module or the module
implementation of Mimikatz

00:13:05.210 --> 00:13:06.260 align:middle line:90%
for meterpreter.

00:13:06.260 --> 00:13:10.090 align:middle line:84%
But in this case, we'll just use
the simple command hash dump.

00:13:10.090 --> 00:13:11.060 align:middle line:90%
There we go.

00:13:11.060 --> 00:13:13.960 align:middle line:84%
And this will
display a list of--

00:13:13.960 --> 00:13:17.710 align:middle line:84%
essentially dump a list of
user accounts and their hashes.

00:13:17.710 --> 00:13:20.800 align:middle line:84%
And these are the NTLM
hashes right over here.

00:13:20.800 --> 00:13:22.630 align:middle line:84%
And the ones that
we're interested in

00:13:22.630 --> 00:13:25.450 align:middle line:84%
are going to be the
administrator user and the user

00:13:25.450 --> 00:13:26.990 align:middle line:90%
Bob or the user account Bob.

00:13:26.990 --> 00:13:28.990 align:middle line:84%
We're not really interested
in the guest account

00:13:28.990 --> 00:13:30.940 align:middle line:84%
because that's
really not useful.

00:13:30.940 --> 00:13:33.280 align:middle line:84%
And in most cases,
the administrator

00:13:33.280 --> 00:13:36.550 align:middle line:84%
or rather the guest account
is disabled by default.

00:13:36.550 --> 00:13:38.320 align:middle line:84%
All right, what
we can also do is

00:13:38.320 --> 00:13:42.460 align:middle line:84%
confirm what other user
accounts on the system,

00:13:42.460 --> 00:13:45.550 align:middle line:84%
and you can see in this case,
we have got all the hashes

00:13:45.550 --> 00:13:48.520 align:middle line:84%
for all the user accounts on
the system, which is great.

00:13:48.520 --> 00:13:50.650 align:middle line:84%
All right, so I'll
terminate this channel.

00:13:50.650 --> 00:13:53.890 align:middle line:84%
And what you want to do
now is copy these hashes.

00:13:53.890 --> 00:13:55.840 align:middle line:84%
So I'll just copy
them as they are.

00:13:55.840 --> 00:13:59.440 align:middle line:84%
I'm going to exclude the
user account Guest, right,

00:13:59.440 --> 00:14:02.080 align:middle line:84%
and I'm going to open
up a new tab here.

00:14:02.080 --> 00:14:05.320 align:middle line:84%
And I'll head over to my desktop
on the Kali Linux system,

00:14:05.320 --> 00:14:10.200 align:middle line:84%
and I'll create a new
file called hashes.txt.

00:14:10.200 --> 00:14:13.110 align:middle line:84%
And I'll open it up with
Vim, the Vim text editor.

00:14:13.110 --> 00:14:17.265 align:middle line:84%
You can also use the standard
GUI text editor or the Nano

00:14:17.265 --> 00:14:19.230 align:middle line:84%
text editor, whatever
works for you.

00:14:19.230 --> 00:14:22.228 align:middle line:84%
And I'll paste those
hashes in here.

00:14:22.228 --> 00:14:22.770 align:middle line:90%
There we are.

00:14:22.770 --> 00:14:24.480 align:middle line:90%
So they are pasted incorrectly.

00:14:24.480 --> 00:14:27.550 align:middle line:84%
You don't need to modify
the hashes in any way.

00:14:27.550 --> 00:14:29.440 align:middle line:84%
And I'll write in
Quit to save that.

00:14:29.440 --> 00:14:32.490 align:middle line:84%
So let me just cut out
the content of hashes.txt.

00:14:32.490 --> 00:14:34.570 align:middle line:84%
You can see we invented
them correctly.

00:14:34.570 --> 00:14:38.160 align:middle line:84%
So let's start off by
exploring how we can crack NTLM

00:14:38.160 --> 00:14:41.400 align:middle line:90%
hashes with John the Ripper.

00:14:41.400 --> 00:14:44.460 align:middle line:84%
All right, so in order
to crack NTLM hashes,

00:14:44.460 --> 00:14:46.900 align:middle line:90%
we can utilize the John utility.

00:14:46.900 --> 00:14:49.650 align:middle line:84%
So if I type in John,
you can get an idea

00:14:49.650 --> 00:14:52.170 align:middle line:84%
as how to utilize
John the Ripper.

00:14:52.170 --> 00:14:54.060 align:middle line:84%
In this case, we are
primarily focusing

00:14:54.060 --> 00:14:58.210 align:middle line:84%
on how to crack an NTLM hash,
and it really is very simple.

00:14:58.210 --> 00:15:01.770 align:middle line:84%
What we need to provide firstly
is the format of the hashes

00:15:01.770 --> 00:15:02.970 align:middle line:90%
that we want to crack.

00:15:02.970 --> 00:15:06.060 align:middle line:84%
And that can be
denoted or specified

00:15:06.060 --> 00:15:09.040 align:middle line:84%
through the use of the format
option right over here.

00:15:09.040 --> 00:15:11.790 align:middle line:84%
So we say, format
is equal to NT.

00:15:11.790 --> 00:15:14.550 align:middle line:84%
Now, if we wanted to list
the available formats,

00:15:14.550 --> 00:15:19.983 align:middle line:84%
we can say, list equal
formats as it says there.

00:15:19.983 --> 00:15:21.650 align:middle line:84%
And we'll give this
a couple of seconds.

00:15:21.650 --> 00:15:23.300 align:middle line:84%
And these are all
the formats that you

00:15:23.300 --> 00:15:25.220 align:middle line:90%
can crack with John the Ripper.

00:15:25.220 --> 00:15:28.670 align:middle line:84%
And, of course, in our case,
we're looking for NTLM,

00:15:28.670 --> 00:15:33.670 align:middle line:84%
so we can say, grep
NTLM and I'll hit Enter.

00:15:33.670 --> 00:15:37.160 align:middle line:84%
And in this case, NTLM
is referred to as a NT.

00:15:37.160 --> 00:15:37.755 align:middle line:90%
There we are.

00:15:37.755 --> 00:15:43.840 align:middle line:84%
So we have net NTLM, we
have net Sha1, nk, and NT.

00:15:43.840 --> 00:15:46.510 align:middle line:84%
So this is the format
we're going to be using.

00:15:46.510 --> 00:15:48.760 align:middle line:84%
All right, so now that
we have that specified,

00:15:48.760 --> 00:15:50.890 align:middle line:84%
you can also specify
the word list

00:15:50.890 --> 00:15:53.650 align:middle line:84%
that you'd like to use to
perform a brute force attack.

00:15:53.650 --> 00:15:56.440 align:middle line:84%
If you don't specify
the word list,

00:15:56.440 --> 00:15:59.690 align:middle line:84%
then John the Ripper will
use its default word list.

00:15:59.690 --> 00:16:05.250 align:middle line:84%
So for now, what we can do is
say, John format equals NT,

00:16:05.250 --> 00:16:08.390 align:middle line:84%
and then we specify the file
that contains the hashes.

00:16:08.390 --> 00:16:10.540 align:middle line:84%
Now, if we wanted
to use a word list,

00:16:10.540 --> 00:16:14.770 align:middle line:84%
we can specify that by saying,
word list, and then we can say,

00:16:14.770 --> 00:16:18.970 align:middle line:84%
word list is equal
to user share and we

00:16:18.970 --> 00:16:21.490 align:middle line:84%
can specify whatever
word list we want to use.

00:16:21.490 --> 00:16:24.220 align:middle line:84%
In this case, let's try and
use the default John the Ripper

00:16:24.220 --> 00:16:26.690 align:middle line:90%
word list, and I'll hit Enter.

00:16:26.690 --> 00:16:28.440 align:middle line:84%
This is going to take
a couple of seconds.

00:16:28.440 --> 00:16:29.010 align:middle line:90%
There we are.

00:16:29.010 --> 00:16:31.800 align:middle line:84%
And it looks like it's
completed the cracking.

00:16:31.800 --> 00:16:34.890 align:middle line:84%
So you can see that it will
proceed with the default word

00:16:34.890 --> 00:16:38.370 align:middle line:84%
list, so that is
user/shared/John/password.list

00:16:38.370 --> 00:16:40.915 align:middle line:90%
and the rules are word list.

00:16:40.915 --> 00:16:42.540 align:middle line:84%
All right, and you
can learn more about

00:16:42.540 --> 00:16:45.450 align:middle line:84%
how John the Ripper works by
taking a look at the output.

00:16:45.450 --> 00:16:48.000 align:middle line:84%
All right, so you can see
that if you successfully

00:16:48.000 --> 00:16:51.000 align:middle line:84%
pasted in the hashes
correctly, then it will say,

00:16:51.000 --> 00:16:54.060 align:middle line:84%
loaded two password hashes
with no different salts.

00:16:54.060 --> 00:16:58.080 align:middle line:84%
And it correctly identifies
that this is an NTLM hash as it

00:16:58.080 --> 00:17:01.290 align:middle line:90%
was encrypted with MD4, right?

00:17:01.290 --> 00:17:05.550 align:middle line:84%
No OpenMP support for
this hash type proceeding

00:17:05.550 --> 00:17:07.109 align:middle line:90%
with the single rules.

00:17:07.109 --> 00:17:10.349 align:middle line:84%
And it'll then process the
remaining buffer candidate

00:17:10.349 --> 00:17:11.550 align:middle line:90%
password if any.

00:17:11.550 --> 00:17:15.030 align:middle line:84%
And right over here it tells us
the passwords, the clear text

00:17:15.030 --> 00:17:17.099 align:middle line:84%
passwords for the
administrator account

00:17:17.099 --> 00:17:19.079 align:middle line:90%
as well as the user Bob.

00:17:19.079 --> 00:17:21.810 align:middle line:84%
All right, so in the case
of this lab environment,

00:17:21.810 --> 00:17:24.329 align:middle line:84%
simple passwords were
used to demonstrate

00:17:24.329 --> 00:17:27.119 align:middle line:84%
how you can perform the
password or the hash

00:17:27.119 --> 00:17:30.240 align:middle line:84%
cracking process with
John the Ripper firstly,

00:17:30.240 --> 00:17:31.680 align:middle line:90%
and then of course with Hashcat.

00:17:31.680 --> 00:17:34.470 align:middle line:84%
So I recommend saving
these credentials

00:17:34.470 --> 00:17:38.190 align:middle line:84%
as we have now been able to
identify the hashes or other

00:17:38.190 --> 00:17:43.170 align:middle line:84%
the clear text passwords by
cracking the NTLM hashes, which

00:17:43.170 --> 00:17:44.380 align:middle line:90%
is fantastic.

00:17:44.380 --> 00:17:47.100 align:middle line:84%
So from a penetration
testers perspective,

00:17:47.100 --> 00:17:49.260 align:middle line:84%
this information is
extremely useful,

00:17:49.260 --> 00:17:52.650 align:middle line:84%
because it means that we can
now legitimately authenticate

00:17:52.650 --> 00:17:55.650 align:middle line:84%
with the target system
either through RDP

00:17:55.650 --> 00:17:58.470 align:middle line:84%
or through another
protocol like SSH

00:17:58.470 --> 00:18:02.280 align:middle line:84%
if SSH has been installed
on the target system.

00:18:02.280 --> 00:18:04.590 align:middle line:84%
However, in the event
that we were not

00:18:04.590 --> 00:18:07.110 align:middle line:84%
able to crack the
actual hashes, we

00:18:07.110 --> 00:18:08.970 align:middle line:84%
could have still
utilized the hashes

00:18:08.970 --> 00:18:12.270 align:middle line:84%
to authenticate with the
target system via SMB,

00:18:12.270 --> 00:18:15.930 align:middle line:84%
utilizing the PS exec
utility as we've already

00:18:15.930 --> 00:18:17.220 align:middle line:90%
explored, all right?

00:18:17.220 --> 00:18:19.410 align:middle line:84%
But we've been able to do
it with John the Ripper.

00:18:19.410 --> 00:18:22.780 align:middle line:84%
As I said, you can also specify
the word list if you want.

00:18:22.780 --> 00:18:26.040 align:middle line:84%
So if I type in
John here, and let's

00:18:26.040 --> 00:18:29.040 align:middle line:84%
see if I can identify the word
list option, there we are.

00:18:29.040 --> 00:18:32.010 align:middle line:84%
So word list equals and then
you can specify the word list

00:18:32.010 --> 00:18:33.210 align:middle line:90%
that you'd like to use.

00:18:33.210 --> 00:18:35.820 align:middle line:84%
Now, by default, on
Kali Linux, there

00:18:35.820 --> 00:18:37.500 align:middle line:84%
is a really helpful
word list that

00:18:37.500 --> 00:18:39.090 align:middle line:90%
comes pre-packaged with it.

00:18:39.090 --> 00:18:43.590 align:middle line:84%
And it is stored under the
user Share word list directory.

00:18:43.590 --> 00:18:47.340 align:middle line:84%
And by default, it is compressed
with the gzip compression

00:18:47.340 --> 00:18:48.540 align:middle line:90%
algorithm.

00:18:48.540 --> 00:18:50.835 align:middle line:84%
So we can decompress
it by saying,

00:18:50.835 --> 00:18:53.370 align:middle line:84%
gzip-d/user/shar
e/wordlists/rockyou.txt.

00:18:53.370 --> 00:18:56.010 align:middle line:90%


00:18:56.010 --> 00:18:57.330 align:middle line:90%
We hit Enter.

00:18:57.330 --> 00:18:59.220 align:middle line:84%
That is going to
decompress it, and we

00:18:59.220 --> 00:19:01.350 align:middle line:84%
can go through the
cracking process again.

00:19:01.350 --> 00:19:04.590 align:middle line:84%
So we can all say we want to
use a different word list,

00:19:04.590 --> 00:19:10.350 align:middle line:84%
and we can say word list equals
user/share/wordlists/rockyou.txt

00:19:10.350 --> 00:19:11.400 align:middle line:90%
in hit Enter.

00:19:11.400 --> 00:19:15.750 align:middle line:84%
And that is going to utilize
the rock you word list instead

00:19:15.750 --> 00:19:16.890 align:middle line:90%
of the default one.

00:19:16.890 --> 00:19:19.680 align:middle line:84%
In this case, you can
see that John pretty much

00:19:19.680 --> 00:19:22.620 align:middle line:84%
knows that we have already
cracked these hashes.

00:19:22.620 --> 00:19:24.150 align:middle line:84%
So it'll tell you
right over here

00:19:24.150 --> 00:19:26.220 align:middle line:84%
that no password hashes
are left to crack,

00:19:26.220 --> 00:19:28.060 align:middle line:84%
and that's because
we've already done it.

00:19:28.060 --> 00:19:30.000 align:middle line:84%
However, as a
penetration tester,

00:19:30.000 --> 00:19:34.890 align:middle line:84%
feel free to utilize any word
list that you have created

00:19:34.890 --> 00:19:37.500 align:middle line:84%
or that you feel
would be a good fit.

00:19:37.500 --> 00:19:39.070 align:middle line:84%
All right, so with
that being said,

00:19:39.070 --> 00:19:42.360 align:middle line:84%
we can now move on to cracking
these hashes with Hashcat.

00:19:42.360 --> 00:19:45.300 align:middle line:84%
All right, so let me open
up the Hashcat utility.

00:19:45.300 --> 00:19:47.550 align:middle line:84%
And I'll type in
Hashcat, there we are.

00:19:47.550 --> 00:19:50.430 align:middle line:84%
And I'll open up the Help
menu, because Hashcat is

00:19:50.430 --> 00:19:52.350 align:middle line:90%
a really, really powerful tool.

00:19:52.350 --> 00:19:54.570 align:middle line:84%
And we'll not be
exploring all the options.

00:19:54.570 --> 00:19:56.010 align:middle line:84%
Remember, we're
primarily focused

00:19:56.010 --> 00:19:59.010 align:middle line:90%
on cracking NTLM hashes.

00:19:59.010 --> 00:20:02.400 align:middle line:84%
All right, so I'll just scroll
to the top of the documentation

00:20:02.400 --> 00:20:04.750 align:middle line:84%
because I need to
explain a few things.

00:20:04.750 --> 00:20:08.230 align:middle line:84%
So at the top of
the documentation,

00:20:08.230 --> 00:20:09.600 align:middle line:90%
you can see that--

00:20:09.600 --> 00:20:12.030 align:middle line:84%
let's see if I can actually
identify that here.

00:20:12.030 --> 00:20:15.540 align:middle line:84%
It's not going to be formatted
correctly, but there we are.

00:20:15.540 --> 00:20:18.540 align:middle line:84%
Right, so at the top it'll
tell you the version of Hashcat

00:20:18.540 --> 00:20:19.180 align:middle line:90%
that's running.

00:20:19.180 --> 00:20:22.030 align:middle line:84%
So it'll tell you the usage
instructions right over here.

00:20:22.030 --> 00:20:26.280 align:middle line:84%
So Hashcat options, the hash or
the hash file, the dictionary

00:20:26.280 --> 00:20:27.910 align:middle line:90%
mask or directory.

00:20:27.910 --> 00:20:32.610 align:middle line:84%
Now, whenever you are cracking
NTLM hashes or any hash,

00:20:32.610 --> 00:20:35.880 align:middle line:84%
there are really two key things
that you need to be specifying,

00:20:35.880 --> 00:20:37.860 align:middle line:90%
one of which is the hash type.

00:20:37.860 --> 00:20:40.270 align:middle line:84%
And you can do that
by using the M option.

00:20:40.270 --> 00:20:43.800 align:middle line:84%
So this is the equivalent of
specifying the format option

00:20:43.800 --> 00:20:44.940 align:middle line:90%
with John the Ripper.

00:20:44.940 --> 00:20:50.370 align:middle line:84%
So you say, M, but you don't
say M equals to NT or NTLM.

00:20:50.370 --> 00:20:53.490 align:middle line:84%
For the hash type you need
to specify the hash ID

00:20:53.490 --> 00:20:55.020 align:middle line:90%
or the hash type ID.

00:20:55.020 --> 00:20:57.880 align:middle line:84%
The hash type ID can be
found right over here.

00:20:57.880 --> 00:21:00.690 align:middle line:84%
So if you just crawl and you can
see these are the hash modes.

00:21:00.690 --> 00:21:03.210 align:middle line:84%
So we are looking
for NTLM, right?

00:21:03.210 --> 00:21:07.950 align:middle line:84%
And let's see if I can
identify NTLM here.

00:21:07.950 --> 00:21:11.010 align:middle line:84%
And you then need to
identify the consequent ID

00:21:11.010 --> 00:21:16.195 align:middle line:90%
of that particular hash mode.

00:21:16.195 --> 00:21:17.320 align:middle line:90%
Let's see if I can find it.

00:21:17.320 --> 00:21:19.900 align:middle line:84%
It should be before
the rest of them here.

00:21:19.900 --> 00:21:23.970 align:middle line:84%
So we have for the
first ones MD4 and MD5.

00:21:23.970 --> 00:21:26.940 align:middle line:84%
We should have the
NT format or NTLM,

00:21:26.940 --> 00:21:28.245 align:middle line:90%
for lack of a better word.

00:21:28.245 --> 00:21:33.350 align:middle line:90%


00:21:33.350 --> 00:21:35.150 align:middle line:90%
All right, so one of them is LM.

00:21:35.150 --> 00:21:36.680 align:middle line:90%
We're not cracking LM hashes.

00:21:36.680 --> 00:21:39.920 align:middle line:84%
We're looking for
NTLM, so that is 1,000.

00:21:39.920 --> 00:21:43.160 align:middle line:84%
All right, so we specify
the hash mode, right?

00:21:43.160 --> 00:21:45.740 align:middle line:84%
We then need to specify
the attack type.

00:21:45.740 --> 00:21:48.810 align:middle line:84%
So if we scroll to the
bottom of the documentation,

00:21:48.810 --> 00:21:52.850 align:middle line:84%
you can see that you have
in addition to the mode,

00:21:52.850 --> 00:21:54.980 align:middle line:84%
you also have the
attack modes, right?

00:21:54.980 --> 00:21:57.980 align:middle line:84%
So in this case, we are going
to be performing a brute force

00:21:57.980 --> 00:21:58.880 align:middle line:90%
attack.

00:21:58.880 --> 00:22:02.460 align:middle line:84%
And we can then specify the word
list that we would like to use.

00:22:02.460 --> 00:22:04.950 align:middle line:84%
And in this case, we can
use the rock you word list.

00:22:04.950 --> 00:22:07.260 align:middle line:84%
So you can see we
specify the word list.

00:22:07.260 --> 00:22:09.110 align:middle line:90%
So this is an example here.

00:22:09.110 --> 00:22:11.690 align:middle line:84%
We can specify because we
are performing a brute force,

00:22:11.690 --> 00:22:16.910 align:middle line:84%
we can say, Hashcat
a 3m 1,000 hashes.txt

00:22:16.910 --> 00:22:19.820 align:middle line:84%
and then the word list
that we would like to use.

00:22:19.820 --> 00:22:25.820 align:middle line:84%
All right, so what we can do
is I will just type in Enter

00:22:25.820 --> 00:22:27.660 align:middle line:90%
there, and I'll clear that out.

00:22:27.660 --> 00:22:32.060 align:middle line:84%
So I'll say, Hashcat,
we're using the--

00:22:32.060 --> 00:22:34.910 align:middle line:84%
we are going to be
utilizing the attack type 3.

00:22:34.910 --> 00:22:39.470 align:middle line:84%
So I'll say, a3, and then we're
using the hash mode 1,000,

00:22:39.470 --> 00:22:40.580 align:middle line:90%
so that's NTLM.

00:22:40.580 --> 00:22:45.070 align:middle line:84%
We then say hashes.txt, and then
I can specify the word list.

00:22:45.070 --> 00:22:49.212 align:middle line:90%
So word list is user share.

00:22:49.212 --> 00:22:53.230 align:middle line:84%
And in this case, what I'll do
is we can actually try and--

00:22:53.230 --> 00:22:55.465 align:middle line:84%
I'm just going to specify
it here user/share/wordl

00:22:55.465 --> 00:22:57.730 align:middle line:90%
ists/rockyou.txt.

00:22:57.730 --> 00:22:59.290 align:middle line:90%
We hit Enter.

00:22:59.290 --> 00:23:01.880 align:middle line:84%
And this is now going to
take a couple of seconds.

00:23:01.880 --> 00:23:04.780 align:middle line:84%
So it's going to
initialize Hashcat,

00:23:04.780 --> 00:23:08.740 align:middle line:84%
and it's then going
to identify, firstly,

00:23:08.740 --> 00:23:10.610 align:middle line:84%
let me see if I can
show you that here.

00:23:10.610 --> 00:23:13.630 align:middle line:84%
So it'll tell me what device
is being used for the cracking.

00:23:13.630 --> 00:23:17.120 align:middle line:84%
So it'll give you a list
of your system resources.

00:23:17.120 --> 00:23:19.330 align:middle line:84%
So you can see in this
case, the lab environment

00:23:19.330 --> 00:23:24.970 align:middle line:84%
provides you with a 32 core
processor and 94 gigabytes

00:23:24.970 --> 00:23:26.620 align:middle line:90%
of RAM or thereabout.

00:23:26.620 --> 00:23:29.590 align:middle line:84%
And you can see
that it accurately

00:23:29.590 --> 00:23:31.720 align:middle line:84%
identifies the
hash type, and it's

00:23:31.720 --> 00:23:34.390 align:middle line:84%
going to begin initialized
in the backend runtime

00:23:34.390 --> 00:23:35.270 align:middle line:90%
for the device.

00:23:35.270 --> 00:23:38.950 align:middle line:84%
So I'll give this a couple
of seconds, after which it

00:23:38.950 --> 00:23:41.650 align:middle line:84%
is going to begin the cracking
process, which you just

00:23:41.650 --> 00:23:42.850 align:middle line:90%
missed shortly.

00:23:42.850 --> 00:23:44.860 align:middle line:84%
It just took a
couple of seconds.

00:23:44.860 --> 00:23:48.400 align:middle line:84%
And you can see that it
actually cracked the password

00:23:48.400 --> 00:23:51.530 align:middle line:84%
for the user Bob
right over here.

00:23:51.530 --> 00:23:55.810 align:middle line:84%
And if you take a look
at the recovered digest,

00:23:55.810 --> 00:23:58.240 align:middle line:84%
you can see that it recovered
two passwords, right,

00:23:58.240 --> 00:23:59.980 align:middle line:90%
or two digests, if you will.

00:23:59.980 --> 00:24:01.760 align:middle line:90%
And that makes a lot of sense.

00:24:01.760 --> 00:24:04.300 align:middle line:84%
So you can see the
candidates are password 1.

00:24:04.300 --> 00:24:07.180 align:middle line:84%
So we already know that
that's for the user Bob.

00:24:07.180 --> 00:24:10.520 align:middle line:84%
And if we take a look
right at the top here,

00:24:10.520 --> 00:24:12.950 align:middle line:84%
these are all the attempts
that it performed.

00:24:12.950 --> 00:24:16.360 align:middle line:84%
And this is a typical
brute force attack, right?

00:24:16.360 --> 00:24:19.540 align:middle line:84%
And the reason we're using
an already existing word list

00:24:19.540 --> 00:24:21.640 align:middle line:84%
and we're not generating
our own word list

00:24:21.640 --> 00:24:24.640 align:middle line:84%
is primarily because this video
is focused on the technique

00:24:24.640 --> 00:24:28.930 align:middle line:84%
as opposed to the actual process
of cracking complex passwords,

00:24:28.930 --> 00:24:31.390 align:middle line:84%
which in that case, you need
to generate your own word

00:24:31.390 --> 00:24:34.490 align:middle line:84%
list based on a few parameters
that are quite important.

00:24:34.490 --> 00:24:37.510 align:middle line:84%
So Hashcat is done,
and it provides us

00:24:37.510 --> 00:24:41.950 align:middle line:84%
with the actual clear text
password for that hash.

00:24:41.950 --> 00:24:47.080 align:middle line:84%
So we have successfully
been able to crack

00:24:47.080 --> 00:24:50.950 align:middle line:84%
the actual hash or the hashes
for both the administrator

00:24:50.950 --> 00:24:53.830 align:middle line:84%
user as well as the
user account Bob.

00:24:53.830 --> 00:25:00.100 align:middle line:84%
So we can now utilize these
passwords or the hashes

00:25:00.100 --> 00:25:03.400 align:middle line:84%
themselves to authenticate with
the target system legitimately.

00:25:03.400 --> 00:25:05.440 align:middle line:84%
And I've covered how
to do this either

00:25:05.440 --> 00:25:09.640 align:middle line:84%
through the PsExec utility
or the PsExec Python script

00:25:09.640 --> 00:25:12.700 align:middle line:84%
or through the PsExec
Metasploit Framework module.

00:25:12.700 --> 00:25:15.620 align:middle line:84%
If RDP is enabled on
the target system,

00:25:15.620 --> 00:25:18.490 align:middle line:90%
you can also log in that way.

00:25:18.490 --> 00:25:20.110 align:middle line:84%
All right, so just
to demonstrate

00:25:20.110 --> 00:25:23.050 align:middle line:84%
how this would work, I've
performed an Nmap scan

00:25:23.050 --> 00:25:26.560 align:middle line:84%
on the target system in
order to identify whether RDP

00:25:26.560 --> 00:25:28.610 align:middle line:90%
is currently running.

00:25:28.610 --> 00:25:32.020 align:middle line:84%
And you can see that the port
3389 is currently open, which

00:25:32.020 --> 00:25:34.610 align:middle line:90%
means that RDP is enabled.

00:25:34.610 --> 00:25:37.060 align:middle line:84%
So what we can do now
is we can essentially

00:25:37.060 --> 00:25:38.980 align:middle line:84%
authenticate with the
target system using

00:25:38.980 --> 00:25:41.200 align:middle line:84%
the passwords we
were able to identify

00:25:41.200 --> 00:25:43.210 align:middle line:90%
from the hash cracking process.

00:25:43.210 --> 00:25:46.910 align:middle line:84%
And we can utilize
the xfree RDP utility.

00:25:46.910 --> 00:25:49.510 align:middle line:84%
So we specify the
user as administrator

00:25:49.510 --> 00:25:52.060 align:middle line:84%
and the password is
password, and we then

00:25:52.060 --> 00:25:53.740 align:middle line:90%
specify the target IP.

00:25:53.740 --> 00:25:57.520 align:middle line:84%
And if I hit Enter, I'm going
to trust the certificate.

00:25:57.520 --> 00:26:00.220 align:middle line:84%
And we'll give this a couple
of seconds, and there we are.

00:26:00.220 --> 00:26:03.280 align:middle line:84%
I'm logged on to the target
system without any issues.

00:26:03.280 --> 00:26:06.880 align:middle line:84%
And the great thing with this
is I've done this legitimately

00:26:06.880 --> 00:26:09.520 align:middle line:84%
without essentially
utilizing an exploit.

00:26:09.520 --> 00:26:12.970 align:middle line:84%
And after you've gained the
clear text passwords for user

00:26:12.970 --> 00:26:16.450 align:middle line:84%
accounts on a Windows system,
it's pretty much game over,

00:26:16.450 --> 00:26:18.610 align:middle line:84%
because you now have
unrestricted access

00:26:18.610 --> 00:26:22.060 align:middle line:84%
to that target system, and you
can essentially authenticate

00:26:22.060 --> 00:26:23.150 align:middle line:90%
to it whenever you want.

00:26:23.150 --> 00:26:26.230 align:middle line:84%
So this is really another
good form of persistence

00:26:26.230 --> 00:26:29.380 align:middle line:84%
or another form of maintaining
access on the Windows system

00:26:29.380 --> 00:26:30.730 align:middle line:90%
that you have compromised.

00:26:30.730 --> 00:26:32.500 align:middle line:84%
With that being
said, that is going

00:26:32.500 --> 00:26:34.540 align:middle line:84%
to conclude the
practical demonstration

00:26:34.540 --> 00:26:36.940 align:middle line:90%
side of this video.

00:26:36.940 --> 00:26:41.130 align:middle line:84%
All right, so that is how to
dump and crack NTLM hashes

00:26:41.130 --> 00:26:44.010 align:middle line:84%
on a Windows system
that you have just

00:26:44.010 --> 00:26:48.210 align:middle line:84%
compromised through the use of
John the Ripper and the Hashcat

00:26:48.210 --> 00:26:48.970 align:middle line:90%
utility.

00:26:48.970 --> 00:26:52.300 align:middle line:84%
So by the end of this
section, which is this video,

00:26:52.300 --> 00:26:55.920 align:middle line:84%
you should have an understanding
as to how you can dump hashes.

00:26:55.920 --> 00:26:57.420 align:middle line:84%
In addition to that,
you should also

00:26:57.420 --> 00:27:01.650 align:middle line:84%
know how to utilize the two
popular or extremely powerful

00:27:01.650 --> 00:27:04.290 align:middle line:84%
tools that can be used
to crack these hashes.

00:27:04.290 --> 00:27:06.910 align:middle line:84%
One of them is John the Ripper
and the other is Hashcat.

00:27:06.910 --> 00:27:09.930 align:middle line:84%
We're now going to move
on to the Linux password

00:27:09.930 --> 00:27:13.620 align:middle line:84%
hash or the Linux hash cracking
section of this course, where

00:27:13.620 --> 00:27:17.350 align:middle line:84%
we'll be exploring the same
process but for Linux systems.

00:27:17.350 --> 00:27:20.500 align:middle line:84%
So I'll be seeing you
in the next video.

00:27:20.500 --> 00:27:21.000 align:middle line:90%