WEBVTT

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


00:00:02.770 --> 00:00:03.550 align:middle line:90%
Hi.

00:00:03.550 --> 00:00:05.410 align:middle line:84%
In this video
lesson, we're going

00:00:05.410 --> 00:00:08.790 align:middle line:90%
to talk about the DCSync attack.

00:00:08.790 --> 00:00:13.600 align:middle line:84%
The DCSync attack is trying to
impersonate a domain controller

00:00:13.600 --> 00:00:16.350 align:middle line:84%
and perform Active
Directory replication.

00:00:16.350 --> 00:00:19.860 align:middle line:84%
By doing so, you can extract
the entire Active Directory

00:00:19.860 --> 00:00:23.700 align:middle line:84%
database, which will include
usernames and passwords as

00:00:23.700 --> 00:00:24.790 align:middle line:90%
well.

00:00:24.790 --> 00:00:26.820 align:middle line:84%
But before you
can do this, there

00:00:26.820 --> 00:00:29.800 align:middle line:84%
are certain privileges
which are required.

00:00:29.800 --> 00:00:32.759 align:middle line:84%
And the two ones are
Directory Replicate changes

00:00:32.759 --> 00:00:37.290 align:middle line:84%
and Directory Replicate Changes
All on the domain object.

00:00:37.290 --> 00:00:39.240 align:middle line:84%
If you have these
two permissions,

00:00:39.240 --> 00:00:43.420 align:middle line:84%
you can essentially become
a domain controller.

00:00:43.420 --> 00:00:47.100 align:middle line:84%
And the outcome of
that is that you

00:00:47.100 --> 00:00:51.220 align:middle line:84%
could utilize a tool such as
mimikatz that has the command

00:00:51.220 --> 00:00:54.900 align:middle line:84%
lsadump dcsync,
where you can specify

00:00:54.900 --> 00:00:59.190 align:middle line:84%
the user account of the user
whose password hash you want.

00:00:59.190 --> 00:01:02.310 align:middle line:84%
And as you can see in
the picture currently,

00:01:02.310 --> 00:01:07.540 align:middle line:84%
we'll get the hash NTLM
value for a specific account.

00:01:07.540 --> 00:01:10.860 align:middle line:84%
And you can do this for any
account in Active Directory

00:01:10.860 --> 00:01:13.680 align:middle line:84%
as long as you have
these two permissions.

00:01:13.680 --> 00:01:17.040 align:middle line:84%
And while there might
be some reasons why

00:01:17.040 --> 00:01:21.100 align:middle line:84%
you want to delegate these
permissions to some users,

00:01:21.100 --> 00:01:23.100 align:middle line:84%
you should really keep
this to the bare minimum.

00:01:23.100 --> 00:01:26.250 align:middle line:84%
Because if an attacker
obtains these privileges,

00:01:26.250 --> 00:01:30.910 align:middle line:84%
it is literally game over
for your entire forest.

00:01:30.910 --> 00:01:34.150 align:middle line:84%
So what can we do to protect
against DCSync attack?

00:01:34.150 --> 00:01:35.800 align:middle line:84%
And what I want
to outline here is

00:01:35.800 --> 00:01:38.860 align:middle line:84%
that DCSync is something
which we performed

00:01:38.860 --> 00:01:41.380 align:middle line:84%
when we were talking
about Kerberos delegation

00:01:41.380 --> 00:01:43.810 align:middle line:84%
in the short demonstration
we did there.

00:01:43.810 --> 00:01:49.620 align:middle line:84%
We managed to obtain the
Kerberos ticket of the domain

00:01:49.620 --> 00:01:52.070 align:middle line:84%
controller, and then
we performed DCSync.

00:01:52.070 --> 00:01:54.375 align:middle line:84%
Even though we did not
impersonate the domain

00:01:54.375 --> 00:01:58.140 align:middle line:84%
controller, we became the
domain controller in that point.

00:01:58.140 --> 00:02:01.520 align:middle line:84%
The most common abusive
way for attackers

00:02:01.520 --> 00:02:04.790 align:middle line:84%
is to gain access to an
account that has these premises

00:02:04.790 --> 00:02:06.060 align:middle line:90%
and use it.

00:02:06.060 --> 00:02:08.960 align:middle line:84%
And the most common account
that requires these permissions

00:02:08.960 --> 00:02:11.150 align:middle line:84%
is the Azure
[? syncing ?] account.

00:02:11.150 --> 00:02:14.150 align:middle line:84%
If you have password
sync to Azure AD,

00:02:14.150 --> 00:02:16.720 align:middle line:84%
that account will have
these permissions.

00:02:16.720 --> 00:02:20.160 align:middle line:84%
So protecting that account
is really important.

00:02:20.160 --> 00:02:22.070 align:middle line:84%
And if you have a
separate server that

00:02:22.070 --> 00:02:24.770 align:middle line:84%
is used for password
synchronization with Azure,

00:02:24.770 --> 00:02:28.940 align:middle line:84%
that account or that server has
to be really, really tightened.

00:02:28.940 --> 00:02:32.330 align:middle line:84%
The security of it has
to be very protected.

00:02:32.330 --> 00:02:35.480 align:middle line:84%
So how do we protect
against DCSync?

00:02:35.480 --> 00:02:37.010 align:middle line:84%
Well, really, you
should just not

00:02:37.010 --> 00:02:39.780 align:middle line:84%
assign the two rights
which I just mentioned.

00:02:39.780 --> 00:02:41.600 align:middle line:84%
If you need those
rights, the accounts

00:02:41.600 --> 00:02:43.640 align:middle line:84%
have to have very
long passwords,

00:02:43.640 --> 00:02:46.430 align:middle line:84%
and computers where these
accounts are logged into

00:02:46.430 --> 00:02:50.650 align:middle line:84%
should have a very limited
amount of administrators--

00:02:50.650 --> 00:02:53.150 align:middle line:84%
really, only the people that
actually need to log in to them

00:02:53.150 --> 00:02:56.060 align:middle line:84%
to perform some kind of
maintenance or something

00:02:56.060 --> 00:02:58.010 align:middle line:84%
of that sort, and
not just because they

00:02:58.010 --> 00:03:00.440 align:middle line:84%
have a group that a server
administrator also has.

00:03:00.440 --> 00:03:02.180 align:middle line:84%
There are very limited
amount of people

00:03:02.180 --> 00:03:06.710 align:middle line:84%
that actually have business
need to be on those devices.

00:03:06.710 --> 00:03:09.320 align:middle line:84%
While protecting
against DCSync is

00:03:09.320 --> 00:03:12.080 align:middle line:84%
really hard, the
detection is much easier,

00:03:12.080 --> 00:03:14.990 align:middle line:84%
because every time a domain
controller replication

00:03:14.990 --> 00:03:19.100 align:middle line:84%
is performed, an event
is going to be logged,

00:03:19.100 --> 00:03:20.570 align:middle line:90%
and you can look into that.

00:03:20.570 --> 00:03:25.208 align:middle line:84%
If the event comes from a
non-domain-controller machine,

00:03:25.208 --> 00:03:26.750 align:middle line:84%
then you are certain
that an attacker

00:03:26.750 --> 00:03:30.630 align:middle line:84%
is trying to perform this
attack on your network.

00:03:30.630 --> 00:03:32.210 align:middle line:90%
Here is an example.

00:03:32.210 --> 00:03:35.900 align:middle line:84%
On the top image, we have
a query for a CM system

00:03:35.900 --> 00:03:40.370 align:middle line:84%
where we are looking
at the event ID 4662

00:03:40.370 --> 00:03:44.480 align:middle line:84%
and where the username does
not end with dollar sign,

00:03:44.480 --> 00:03:49.660 align:middle line:84%
it is not AUTHORITY, or
the username is not Window.

00:03:49.660 --> 00:03:53.560 align:middle line:84%
So by doing this,
we're going to get rid

00:03:53.560 --> 00:03:59.590 align:middle line:84%
of noise of known things
that will occur and only

00:03:59.590 --> 00:04:03.670 align:middle line:84%
get alerts on those that
are really suspicious.

00:04:03.670 --> 00:04:07.120 align:middle line:84%
And what we're going
to see into the event--

00:04:07.120 --> 00:04:09.400 align:middle line:84%
I do not [? reflect ?]
on the picture--

00:04:09.400 --> 00:04:10.510 align:middle line:90%
is exactly that.

00:04:10.510 --> 00:04:12.130 align:middle line:84%
There's an account
which was used

00:04:12.130 --> 00:04:14.950 align:middle line:84%
to perform Directory
replications,

00:04:14.950 --> 00:04:18.880 align:middle line:84%
and it was not coming
from the main controller.