WEBVTT

00:00.000 --> 00:05.800
We have Dirk Jain here to talk about Active Directory and Entra ID Exploitation.

00:05.840 --> 00:07.260
Super excited for this talk.

00:07.260 --> 00:09.540
So everybody help me welcome him to the stage.

00:09.540 --> 00:10.260
Yeah!

00:16.460 --> 00:18.460
Hello, good afternoon everybody.

00:18.920 --> 00:20.000
Thanks for coming out.

00:20.000 --> 00:21.320
It's a full house.

00:21.420 --> 00:25.180
I'm gonna start my presentation by apologizing for two things.

00:25.180 --> 00:29.380
First of all, because my slides are in light mode and it seems kind of bright out there.

00:29.380 --> 00:33.380
So if your eyes hurt at the end of this talk, I'm sorry for that.

00:33.440 --> 00:36.700
The second thing is that the talk is called Advanced.

00:36.700 --> 00:50.620
So that's gonna be my excuse to go over the basics like really, really quick because there's a lot of information in this talk and I don't have time to talk about everything because otherwise I'd be standing here for two hours and you have other things to do today.

00:50.620 --> 00:56.640
So we're gonna go through things fast and then we hopefully get to the interesting stuff as soon as we can.

00:57.440 --> 00:58.840
So I'm Dirk Jain.

00:58.840 --> 00:59.980
Thanks for coming out.

00:59.980 --> 01:02.480
I am all the way from the Netherlands.

01:02.680 --> 01:04.900
In my day job I have my own company.

01:04.900 --> 01:11.440
It's called Outsider Security and there I do a bit of a combination of research, pen testing and a lot of training.

01:11.860 --> 01:13.380
Maybe you've seen me here before.

01:13.380 --> 01:18.320
It's actually my third DEF CON and I like to do research.

01:18.320 --> 01:19.700
I like to write tools.

01:19.820 --> 01:21.680
But I don't want to talk about this today.

01:21.680 --> 01:26.620
I actually want to talk about lateral movement from Active Directory to Entra.

01:26.840 --> 01:35.900
And if you want to talk about that, we need to cover a little bit of the existing attacks because some of the existing attacks will actually make a comeback later in the talk.

01:36.120 --> 01:39.880
But the thing I am really excited to talk about are two things.

01:40.260 --> 01:42.700
Policies and exchange.

01:42.800 --> 01:47.820
Now, I get that's a little vague, but we'll make sense of that later on.

01:47.820 --> 01:53.840
Let's start with the existing attack surface and the changes that were there over the years.

01:54.420 --> 02:00.660
So if we talk about hybrid attacks, it means attacks that cover both AD and Entra.

02:00.660 --> 02:05.400
And for this talk, the starting point is going to be full control over the on-prem Active Directory.

02:05.500 --> 02:07.760
So this is not about like getting domain admin.

02:07.760 --> 02:15.240
This is what you can do if you already have domain admin and you want to move to somebody's cloud environment from that point of view.

02:15.760 --> 02:17.580
So AD is fully compromised.

02:17.580 --> 02:21.320
We have all the access that we want and we want to pivot to Entra.

02:21.620 --> 02:27.880
Now there are a few attacks that you can always do and there's also a few attacks that depend on the configuration.

02:28.400 --> 02:33.320
So ADFS and seamless single sign-on, they're two quite well-known attacks.

02:33.320 --> 02:35.200
They've been covered extensively in the past.

02:35.200 --> 02:37.600
They've been abused by threat actors in the past.

02:37.900 --> 02:43.040
Basically, if you have these components, there's always going to be an attack path from your on-prem AD to Entra.

02:43.520 --> 02:51.740
Also, if you have Entra ID connect, which most companies have because you need that for the synchronization, there's also going to be attack paths with that.

02:52.040 --> 02:59.400
Now these attack paths, they exist because basically you are putting sort of a trust in a on-prem AD system.

02:59.400 --> 03:08.200
So if you have ADFS, then by the whole definition of the thing, you are authorizing this ADFS server on-prem to issue tokens for the cloud.

03:08.200 --> 03:18.540
So the way it works is that ADFS has a certificate, ADFS has a private key, Entra also has a certificate and ADFS issues SAML tokens and these SAML tokens are used to authenticate users.

03:18.920 --> 03:33.520
So we have this private key on-prem and with most private key schemes, if somebody manages to steal that private key and that certificate, then they can basically remove all these security layers and they can enforce their own tokens.

03:33.780 --> 03:39.200
This is not super complicated like concept-wise because we are trusting the system.

03:39.200 --> 03:45.220
If the system is compromised, then the whole hybrid environment is compromised and you can impersonate users in Entra.

03:45.800 --> 03:48.720
Seamless single sign-on is kind of similar actually.

03:49.060 --> 04:00.020
Seamless single sign-on is Kerberos based so that means that it's a different protocol than SAML and also it uses symmetric keys in this case so there's no asymmetric cryptography but actually symmetric cryptography.

04:00.460 --> 04:01.920
But the same thing is here.

04:02.020 --> 04:04.260
On-prem AD issues Kerberos tickets.

04:04.420 --> 04:10.260
The cloud accepts these Kerberos tickets because it has the key to validate they were issued legitimately.

04:10.600 --> 04:17.860
And if an attacker steals these keys, then of course they can craft their own Kerberos tickets and they can impersonate users in the cloud.

04:17.860 --> 04:19.540
It's called silver tickets.

04:19.600 --> 04:23.180
You're probably familiar with that because it's not exactly new.

04:23.200 --> 04:25.620
So this is already old stuff.

04:25.620 --> 04:38.620
However, a few important things with this is that even though these concepts are configured per domain, there's quite a difference between how domains work in on-prem AD versus how domains work in Entra.

04:38.620 --> 04:44.240
Because in on-prem AD we have active directory domains, they have their own structure, they're part of the forest.

04:44.580 --> 04:46.820
But in Entra, that doesn't really apply.

04:46.820 --> 04:49.860
So Entra is more of a flat structured identity provider.

04:50.100 --> 04:56.700
That means that all the users that you have, even if you sync users from multiple domains, they're all kind of pooled together.

04:57.360 --> 05:07.560
So even though Entra doesn't really have the concept of domains, we can configure some things per domain which is kind of weird because we have a configuration per domain but domains are not really a thing.

05:07.560 --> 05:13.380
So that leaves us in a bit of a weird place and I think that's kind of confusing.

05:13.620 --> 05:15.940
But it does have security consequences.

05:15.940 --> 05:28.800
Because there's no security boundary between individual domains in Entra, then basically it means that most of the authentication material that you have in any domain on-prem works for any domain in the cloud.

05:28.800 --> 05:35.860
And the only actual security difference is between synchronized accounts, so accounts that come from on-prem, and cloud only accounts.

05:35.860 --> 05:40.180
So people think that it works like this, like with like silos.

05:40.180 --> 05:43.600
So we have two domains here or we have actually quite a few domains.

05:43.600 --> 05:45.900
One is managed, one is federated.

05:45.960 --> 05:50.800
They're synced from different on-prem AD domains that don't even need to be in the same forest.

05:50.840 --> 05:53.480
But there's not really this difference in the cloud.

05:53.480 --> 06:03.840
So it's not that these domains are isolated but actually all these domains are kind of pooled together and the only actual difference is between hybrid users and cloud only users.

06:04.100 --> 06:15.140
So that means that if we compromise the on-prem domains here, in the case of password hashing, we can override passwords of any hybrid user, not just in this domain but actually also in any other domain.

06:15.160 --> 06:26.240
Same with federation, if we compromise one federation server or if you only have like one federated domain in your tenant, actually these tokens are valid for any hybrid account in any of the domains that you have.

06:26.400 --> 06:30.560
And the only thing that we cannot do is we cannot target cloud only users.

06:30.560 --> 06:38.500
So if we try to reset the password of a cloud only user, that's not going to work because cloud only users are separate from like hybrid users.

06:39.020 --> 06:46.360
So this is some of the existing attack service and conceptually actually these two concepts, seamless single sign-on and ADFS are quite similar.

06:46.360 --> 06:49.460
They both can be used to force authentication material.

06:49.460 --> 07:00.860
The main difference impact wise is that ADFS can also cover multi-factor authentication so you can add a MFA claim to a SAML token while seamless single sign-on is only about single factor.

07:01.060 --> 07:12.220
So it's 2025, hopefully you have an MFA policy and that means if you have seamless single sign-on then you would still need to bypass the MFA while with ADFS you can also bypass MFA.

07:12.220 --> 07:22.280
There is a setting that you can use to mitigate this, however I've almost never seen anybody enable this so in most cases if you have ADFS in the environment you can also bypass multi-factor.

07:22.360 --> 07:37.240
But both methods are not limited to one domain, actually they work for all of the domains in Entra and even though the authentication material is technically per domain, which is a little weird but that's just how it works because the difference is architecture wise between on-prem and the cloud.

07:37.720 --> 07:47.300
So if you have this, if you have seamless single sign-on, if you have ADFS, there's always going to be an attack path and you can be used to impersonate any hybrid accounts.

07:47.740 --> 08:05.500
So I'm going to extend this attack graph a little bit as we go through the talk and basically on the left-hand side we have Active Directory , on the right-hand side we have the Entra ID and if you have any of the components on the AD side then you can perform the following attacks in Entra.

08:05.900 --> 08:08.780
So seamless single sign -on, ADFS, we've covered that.

08:09.100 --> 08:15.260
Actually I'm going to assume that you don't have this in this talk because if you have it, there is like a by design attack path.

08:15.920 --> 08:19.980
And there's also quite a few attack paths that are based on Entra ID connect.

08:20.060 --> 08:23.160
A few of these are already known so I'm not going to cover them extensively.

08:23.380 --> 08:29.300
But one thing I do want to highlight is the ability to actually convert cloud only users to hybrid users.

08:29.320 --> 08:33.960
Because I've just told you that cloud only users are out of scope of these attacks.

08:33.960 --> 08:38.500
We cannot reset password of cloud only accounts or impersonate them with SAML tokens.

08:38.600 --> 08:44.360
But there is actually a way to kind of move a cloud only account to make it a hybrid account.

08:44.360 --> 08:47.640
And then we can actually do these attacks with these accounts.

08:48.060 --> 08:49.600
So there's a technique for that.

08:49.600 --> 08:51.020
It's called soft matching.

08:51.020 --> 08:52.980
There's a variant of that that's called hard matching.

08:53.020 --> 08:57.560
And it's used to work for any account back in 2018 when I first looked at this.

08:57.560 --> 09:06.400
And basically the way that it works is that you pretend that there's a on-prem account that's the same user principle name or the same email address as a cloud account.

09:06.400 --> 09:09.420
And the synchronization engine will like match those together.

09:09.440 --> 09:13.100
It thinks it's the same account and then suddenly it becomes a hybrid account.

09:13.100 --> 09:16.160
And then it becomes in scope of all of these attacks.

09:16.600 --> 09:23.720
So this solves this for global admins because this used to be the case you could just override the global admins password and you were a global admin.

09:24.200 --> 09:30.780
But then somebody else, Sapir, a different researcher, she found out that they actually never fixed this for eligible admins.

09:30.780 --> 09:36.720
Which is a little weird because there's this feature, privileged identity management, that you actually need to pay extra for.

09:37.200 --> 09:43.640
And if you have that, then apparently it's less secure because then you have eligible admins and they're not protected from this attack.

09:43.640 --> 09:54.620
So eligible admins, eligible global admins, you can convert them to hybrid accounts and then you can impersonate them with ADFS or with things like Golden SAML or with single sign-on.

09:54.620 --> 09:55.820
There's mitigation for that.

09:55.820 --> 09:58.460
You can block soft matching, you can block hard matching.

09:58.560 --> 10:03.280
Again, I've never actually seen companies do this because it's quite an obscure setting.

10:03.280 --> 10:06.140
But there are mitigations for this that you can run in theory.

10:07.340 --> 10:12.760
Anyway, if you want to do this, then you need to have access to that Entra ID connect account.

10:13.160 --> 10:19.160
And that means you need to have access to that server, which is not going to be a problem because we consider the on-prem AD compromised.

10:19.220 --> 10:24.540
And then you can dump the credentials because it was always using username password authentication.

10:24.540 --> 10:28.100
You can extract the plain text password from the server using several tools.

10:28.200 --> 10:33.860
I wrote the AD connect dump tool suite quite a couple years ago and then you have the credentials of that account.

10:34.520 --> 10:38.640
But maybe you're like, well, actually, we can now do this with a service principle.

10:38.760 --> 10:41.140
And Microsoft announced that a couple of months ago.

10:41.140 --> 10:42.780
And you're like, yeah, this is more secure.

10:43.280 --> 10:44.240
Is it though?

10:44.320 --> 10:48.580
Because if you have a service principle, then it uses certificates for authentication.

10:48.920 --> 10:52.180
But I can also just dump the certificates instead of dumping the password.

10:52.180 --> 10:59.080
So here I added one more tool to the tool suite, which I made open source like earlier this week, AD sync cert dump.

10:59.080 --> 11:00.640
And it will just dump the certificates.

11:00.640 --> 11:01.900
It will dump the private key.

11:01.900 --> 11:04.080
And with that, we can authenticate as a service principle.

11:04.080 --> 11:06.260
And then we can do the exact same as before.

11:06.780 --> 11:11.120
You're like, well, actually, we can also store these in a trusted platform module.

11:11.120 --> 11:13.020
And then it's actually hardware protected.

11:13.480 --> 11:14.500
You're again correct.

11:14.500 --> 11:15.260
We can do that.

11:15.260 --> 11:16.200
It's an option.

11:16.620 --> 11:23.060
But if there's a trusted platform module, then we can just very nicely ask the trusted platform module to sign something for us.

11:23.060 --> 11:24.900
That something is called an assertion.

11:24.900 --> 11:27.240
And that assertion allows us to authenticate.

11:27.240 --> 11:31.260
So if I ask the TPM for this assertion, it allows me to authenticate in the cloud.

11:31.260 --> 11:33.380
And once again, I have access to this account.

11:33.880 --> 11:38.540
You're like, well, actually, that does mean you need persistent access to this host, yes?

11:38.540 --> 11:42.080
Because it's stored in hardware and you don't have the actual private key.

11:42.820 --> 11:44.000
Not really.

11:44.000 --> 11:48.720
Because if we look at this assertion, we see that it's based on a time stamp.

11:49.100 --> 11:53.880
And it's basically a JSON web token that's valid for a limited amount of time.

11:54.080 --> 11:58.700
But of course there's no proof that this time was the actual time when I signed this.

11:58.700 --> 12:02.500
Because I can also sign a token for next week or next year or next month.

12:02.720 --> 12:06.820
So I can just sign the tokens in advance and then I can just use them whenever I want.

12:07.560 --> 12:14.500
Also, if we look at the documentation, it explicitly says that Entra actually doesn't care how large you make the time range.

12:14.500 --> 12:17.160
Because it doesn't enforce any limits on the expiry.

12:17.160 --> 12:22.340
So I can also just create an assertion that's valid for like a year and I can use that then whenever.

12:22.340 --> 12:25.140
So it's nice that it's in hardware protection.

12:25.140 --> 12:33.260
But hardware protection is quite useless if you can extract like a assertion from there that's just as valuable as the actual private key.

12:33.260 --> 12:38.540
So I don't need the key, I just need the assertion in the end and the assertion I can create that for a very long time.

12:39.000 --> 12:45.500
So there's not much difference in attack surface between the service principle based approach and the account based approach in that sense.

12:46.340 --> 12:49.500
So we can use these credentials to convert the accounts.

12:49.620 --> 12:55.160
And a different thing that's interesting is the ability to modify policies.

12:55.240 --> 12:59.680
So that's actually an attack that was documented.

12:59.680 --> 13:01.560
I've talked about it in the past.

13:01.560 --> 13:04.640
But it wasn't always clear what it actually meant.

13:04.640 --> 13:13.980
So if we look at the documentation, then documentation actually says that the sync account can modify policies, it can delete policies, it can change policies.

13:14.180 --> 13:22.660
The problem with this is that like all these permissions in Entra, they're so vague that nobody really knows what they mean, like each of these individual permissions.

13:22.940 --> 13:26.100
And then the question is, well, what exactly is a policy?

13:26.100 --> 13:28.020
Like what does a policy even mean?

13:28.020 --> 13:32.360
I can think of a few policies, but are these actually stored as policies?

13:32.680 --> 13:37.760
So let's have a look at policies in my favorite graph API.

13:38.380 --> 13:40.080
That is not this API.

13:40.340 --> 13:44.360
It's going to be this API, the graph.windows.net.

13:44.360 --> 13:48.740
Especially the internal version, the 1.61-internal.

13:48.740 --> 13:52.620
This is like the secret Microsoft version that they don't want you to know about.

13:52.940 --> 14:00.220
I've given some talks on that in the past, but basically this API version exposes a lot more information than all the official APIs.

14:00.420 --> 14:08.560
It also allows you to, for example, to enumerate more data with a normal user account that you normally can, and it just shows a lot of internal Entra data.

14:09.100 --> 14:13.860
Now, one of the policies that is maybe the most obvious one are conditional access policies.

14:13.860 --> 14:21.120
So conditional access policies are the security policies that we use to enforce all these controls in the tenant, like multi-factor authentication.

14:22.100 --> 14:38.020
And if you can just change these policies from on-prem, if you can just delete them from on-prem, which the sync account could do, yeah, then MFA is not really a great control anymore because we can just turn it off, or we can just add exclusions, or any other policy can be just disabled or deleted.

14:38.580 --> 14:40.220
So they patched this in 2023.

14:40.460 --> 14:43.160
Actually, I talked about this at BlueEd in 2019.

14:43.160 --> 14:48.420
I don't think many people actually realized this was possible, but they did fix it like a few years ago.

14:48.620 --> 14:55.820
And now when you try to do this, even as global admin, you get like this error message that says only confidential clients can do this, so you cannot do this anymore.

14:55.820 --> 14:59.960
Over this API, you cannot modify conditional access policies anymore.

15:00.480 --> 15:08.880
But conditional access policies are not the only policies, and they block this specifically for conditional access policies, but not for other policies.

15:09.420 --> 15:11.540
So what are some other policies?

15:11.540 --> 15:20.320
You can list these over the policies API endpoints, and we get this on-prem authentication policy, password management policy, a default policy.

15:20.340 --> 15:25.660
Each of these policies is like an integer, is a type number, and this is default for type 24, whatever that means.

15:25.820 --> 15:28.380
And we also have an external identities policy.

15:28.500 --> 15:38.700
So I did some digging into this, and it turns out that the on-prem authentication flow policy is where the seamless single sign-on settings are stored, and the pass-through authentication settings.

15:38.720 --> 15:43.520
The password management policy is where self-service password reset configuration is stored.

15:43.520 --> 15:53.700
Default policy type 24 is the authentication methods, and the external identities policy is how you interact with other tenants, basically your B2B collaboration settings.

15:54.180 --> 16:00.220
So this one was quite interesting, because we just talked about these on-prem attack techniques.

16:00.580 --> 16:09.180
So the on-prem authentication flow policy, it looks a little bit like this, and it has these things called key credentials.

16:09.280 --> 16:17.900
So it turns out these key credentials are actually the symmetric Kerberos keys, where it stores the keys that are used for the seamless single sign-on.

16:17.900 --> 16:24.900
So you create that account on-prem for seamless single sign-on, and it adds the keys here to the key credentials in that policy.

16:25.240 --> 16:29.700
It also stores the keys per domain, like which keys are active for which domain.

16:29.700 --> 16:31.500
That's a bit of a weird structure.

16:31.680 --> 16:34.140
It basically stores the GUIDs of these keys.

16:34.140 --> 16:40.680
So there are actually two keys, or four if you rotated them recently, because it has like N minus one keys.

16:40.940 --> 16:43.160
But there's two key formats.

16:43.560 --> 16:50.920
And the problem is that I cannot see the keys, I cannot extract the keys, not even if I'm global admin, it's not going to return them to me.

16:51.180 --> 16:57.680
So initially I had no clue how these keys were actually stored, because it's a symmetric key, but which key?

16:57.680 --> 17:04.200
Like Kerberos has a lot of different key formats, like RC4, AES, 128, AES-256.

17:04.420 --> 17:07.580
But how do I fit these three key formats in two fields?

17:07.580 --> 17:08.460
I don't know.

17:08.900 --> 17:10.920
So I just tried a couple of combinations.

17:11.180 --> 17:13.220
I tried actually a lot of combinations.

17:13.480 --> 17:17.160
I didn't have any examples or API calls that I could observe.

17:17.260 --> 17:24.020
So I tried putting like the NT hash, or like the plain text password, AES keys, the salt, all that kind of things.

17:24.200 --> 17:33.200
In the end I got it working by just putting like the plain text keys, like the base Kerberos key in both of the fields, and then I could authenticate with RC4.

17:33.320 --> 17:36.460
So if you do that, then at least RC4 works.

17:36.460 --> 17:39.300
I don't think I ever got AES working, but it's something.

17:39.900 --> 17:46.020
So that means if we can modify this, we can actually add our own backdoor seamless single sign-on keys.

17:46.020 --> 17:55.880
And it means that even if you are not using seamless single sign-on, which I hope you're not, because it's not a very good protocol, but we can just add seamless single sign-on keys.

17:55.880 --> 17:59.380
I can enable seamless single sign-on from on-prem basically.

17:59.760 --> 18:10.840
I can do that on an existing domain, but the problem with that is that it will either break the existing seamless single sign-on, which is a bit annoying for the client, or it will be rotated out, which is a bit annoying for me.

18:11.020 --> 18:14.020
But you can also do this on Microsoft.com domains.

18:14.020 --> 18:22.260
So these of course are not even hybrid domains, so there's no, that doesn't make any sense that you configure seamless single sign-on on that, but it does work.

18:22.260 --> 18:33.960
And I can just add these keys on this on-microsoft.com domain, and since all of these keys work for any domain in the tenant, I can then also use these keys on the on-microsoft.com domain to authenticate to regular domains.

18:35.120 --> 18:36.640
So it looks like this.

18:36.640 --> 18:41.020
I added my own two keys to the on-microsoft.com domain.

18:41.020 --> 18:48.680
I put them in the right format, and then I can authenticate with Kerberos tickets to Entra, and I can do seamless single sign-on.

18:49.280 --> 18:54.100
Now, if you're on the defensive side, you may be wondering, what can I detect this for?

18:54.100 --> 18:57.800
Like, are there any logs that I can use to monitor for this behavior?

18:58.140 --> 19:04.480
Unfortunately, the answer is a plain no, because if you change this, there's like literally no events.

19:04.480 --> 19:07.780
Like, I was waiting for the logs to come in, and there just were no logs.

19:07.780 --> 19:14.600
I was going to put a screenshot here of the event, but there is no event if you modify this policy over this internal API.

19:14.680 --> 19:19.560
Funny enough, the only time that an event is generated is when you actually remove the keys again.

19:19.560 --> 19:22.300
Then there is an event, but if you add more keys, then there is not.

19:22.300 --> 19:26.920
So, if you want to detect this, yeah, good luck, because there is no log, so no detection.

19:27.580 --> 19:29.020
So, how do we use this?

19:29.160 --> 19:31.740
That's a bit of a combination of multiple tools.

19:31.740 --> 19:38.720
We need to deal with Kerberos, so you can do it with Impact, with Rubius, whatever tools you like to issue your own Kerberos tickets.

19:39.080 --> 19:47.120
Then we can use road tools hybrids to actually do the Kerberos authentication, and we can authenticate as any hybrid user in the tenants, in any of the domains.

19:47.720 --> 19:54.900
You're forgetting this thing called multi-factor authentication, because seamlessly on sign-on is only your replacement for the passwords.

19:55.060 --> 20:06.100
Again, you're correct, and if we ignore the fact that we could just delete the conditional access policies, there is also a different solution actually for this, and that is in the policy type 24.

20:06.220 --> 20:15.560
So, this actually stores the authentication method policies, and that means that it stores the data from which authentication methods are enabled in the tenants.

20:16.200 --> 20:29.580
I've known about this for a few years, but there was never really an attack path here, because of course I can change the configuration for authentication, but if I enable, for example, Fido keys, it's not suddenly going to allow me to authenticate to accounts,

20:29.580 --> 20:34.780
because the Fido key will then be enabled, but it's not going to be magically linked to users.

20:35.020 --> 20:40.320
But then Microsoft actually added a new feature, and it was called the external authentication methods.

20:40.560 --> 20:52.560
And with that you can basically bring your own external MFA provider, and if I just add an MFA provider to the list, and I put people in scope of that MFA provider, then they can do multi-factor authentication on any external platform.

20:52.980 --> 20:58.960
There's legit providers, of course, but I can also add a fake MFA provider, and I just need to talk to the right protocols.

20:59.540 --> 21:10.560
It's all based on OIDC, and I can just provision a new, like, fake MFA provider that just approves all the MFA requests, and then we can also bypass multi-factor authentication.

21:10.840 --> 21:16.200
If you're interested in the actual protocols, I did give a talk about this earlier this year, about how to set this up.

21:16.500 --> 21:27.180
I also showed there that, again, the logs don't really tell you anything, so if you change this configuration over the internal API, it's going to tell you, like, oh yeah, something was changed, but I'm not going to tell you what.

21:27.180 --> 21:31.280
Like, it was changed from null to some other version of null.

21:31.380 --> 21:33.960
So again, good luck detecting this kind of stuff.

21:34.900 --> 21:37.080
So, let's fill this in the attack graph.

21:37.080 --> 21:50.220
We can modify policies, and with those policies, anything that's contained in policies we can change, and it means we can actually configure seamless single sign-on, we can configure external authentication methods, and then we can, again, impersonate any hybrid user,

21:50.220 --> 21:55.220
even if seamless single sign-on is not configured, like, legitimately on the AD side.

21:55.980 --> 22:06.620
So it was kind of nice, but actually last year, around this time, Microsoft changed a lot of the permissions here, so they hardened all the permissions that the sync accounts had, that it didn't actually need.

22:06.780 --> 22:12.560
And I think this is, like, the best change that Microsoft did in years, because it really reduces the attack service that you have from on-prem.

22:12.680 --> 22:15.660
So now we cannot do this anymore from the on-prem side.

22:15.660 --> 22:18.580
The sync account doesn't have any privileges anymore to do this.

22:18.620 --> 22:27.340
Of course, it still remains, like, a valid scenario if you have control over the tenant to add your own back doors, but that means you're usually already global admin to do this.

22:27.900 --> 22:38.240
So we need to remove a few paths, again, from our attack tree, and unfortunately, well, fortunately or unfortunately, depending on which side of the fence you're on, these things are fixed, so you no longer abuse them.

22:39.520 --> 22:45.000
So I had to look for some other paths, and that kind of led me to Exchange.

22:45.400 --> 22:47.920
Now, Exchange and I have a little bit of a history.

22:48.080 --> 22:51.260
I did talk about Exchange, like, when I started in security.

22:51.260 --> 22:54.160
I don't know if anybody remembers Brave Exchange.

22:54.160 --> 23:03.890
It was one of the first, like, coercion techniques before people figured out that you can coerce, like, literally every protocol against literally every other protocol, and it made this one a little bit less interesting.

23:04.430 --> 23:15.490
But I decided to look at Exchange again, and especially Exchange Hybrid, because Exchange in AD is usually domain admin, and well, maybe Exchange in AD is also privileged in Entra.

23:15.490 --> 23:16.390
Who knows?

23:16.790 --> 23:29.790
And it turns out that Exchange Hybrid on-prem is actually the same thing as Exchange Online, because they share a service principle, and that means that you kind of have this Exchange Online service principle sort of running in your on-prem AD.

23:29.790 --> 23:30.970
That's interesting.

23:31.390 --> 23:40.510
What's also interesting is that Exchange Online is essentially global admin, so that means that we can get global admin from on-prem if you have Exchange Hybrid.

23:40.510 --> 23:51.090
Now, not everybody is going to have Exchange Hybrid, but usually the organizations that should be concerned about these attacks, they're more likely to have this kind of hybrid setup also maybe with Exchange.

23:51.430 --> 23:54.250
Now, how is Exchange Online global admin?

23:54.250 --> 23:55.770
Why is it global admin?

23:55.830 --> 24:01.610
That's a good question, but let's first look at how Exchange Hybrid is actually the same as Exchange Online.

24:01.650 --> 24:11.670
So it turns out that for communication between the on-prem service and the cloud service, they actually have a certificate credential on the service principle on the cloud side.

24:11.670 --> 24:22.710
So that means that if you authenticate to Exchange Hybrid with OAuth, it's going to use the exact same credentials or exactly the same authentication flow as if you authenticate to Outlook on the web.

24:23.090 --> 24:33.110
So it's configured on the service principle of Exchange Online, and that means that we can also use these credentials to authenticate as Exchange Online, and we can essentially become Exchange Online.

24:33.430 --> 24:40.070
We can do that with the OAuth 2.0 client credentials flow, and to do that, we need to have, of course, access to these credentials.

24:40.630 --> 24:42.810
Now, this was like a super long process.

24:42.810 --> 24:45.610
It took me months of very advanced reverse engineering.

24:46.130 --> 24:47.250
Okay, not really.

24:47.250 --> 24:50.170
I just like remote desktops to the Exchange server.

24:50.170 --> 24:51.630
I clicked on certificates.

24:51.630 --> 24:52.470
I right-clicked.

24:52.470 --> 24:53.910
I chose exports.

24:54.070 --> 25:05.210
I choose export private key because for some reason the private key was more affordable, and then I had the credentials basically of Exchange Online, and I could authenticate as Exchange Online in my tenants.

25:06.130 --> 25:21.430
I can do this with RoadTX, so I got a token for the Microsoft Graph, and it's a little bit small, but if we zoom in here, we see the roles that it has, and the interesting here is actually the domain read-write all, and that means that it can modify domains,

25:21.430 --> 25:22.950
but again, that's kind of weird.

25:23.050 --> 25:24.990
Like, well, first of all, why does it need this?

25:24.990 --> 25:26.390
And second of all, what does this mean?

25:26.430 --> 25:44.050
Because domains is quite a broad term, and the ability to read-write domains means that we can actually modify custom domains in a tenant, but it also means that we can configure like some of these hybrid settings that are configured on domains, so we can actually configure the federation information,

25:44.050 --> 25:50.810
which means that even if you don't have ADFS, which most companies don't, Exchange can actually configure ADFS for you.

25:50.810 --> 25:59.230
So it can just add like a symbol token signing certificate on one of these domains, and then of course we can authenticate as any user in the tenants.

25:59.430 --> 26:01.330
So let's look at this case.

26:01.330 --> 26:02.970
I have this federation config here.

26:02.970 --> 26:16.610
This is actually a federated domain, and they made the effort to actually harden this, so they're saying like, well, okay, we're not accepting any MFA claims that are coming from on-prem, so it's rejecting the MFA claims coming from ADFS.

26:17.230 --> 26:20.430
And because I am Exchange, I can modify this.

26:20.430 --> 26:38.210
I just get the current config, I patch it, I do the road DX graph request, which is basically just a wrapper around curl to make my life a bit easier, and then we change the configuration to actually accept multi-factor authentication, and then we can again issue symbol tokens with like fake MFA claims.

26:38.210 --> 26:44.210
We can also add our own symbol token signing certificates, and then we can again pretend to be any hybrid user in the tenants.

26:45.290 --> 26:55.710
So we're adding extra box, we're adding Exchange, and Exchange can actually configure the federation information, and once we've done that, then we can again impersonate any hybrid user in the tenants.

26:56.310 --> 26:57.910
Okay, that's fun.

26:58.770 --> 27:01.290
Actually, this was not the first thing I was looking at.

27:01.290 --> 27:03.530
I just found that like somewhere in the middle.

27:03.770 --> 27:08.290
I was first looking to actually validate that my hybrid setup was even working.

27:08.370 --> 27:11.810
It was quite an effort actually to get hybrid exchange working.

27:11.810 --> 27:15.870
It was less effort to find the bugs than to actually get a complete working setup.

27:16.310 --> 27:22.750
But there is this nice command that you can use to test the OAuth connectivity, and it does authentication then.

27:22.890 --> 27:29.030
So we can actually test if our Exchange hybrid on-prem can successfully authenticate to Exchange online.

27:29.130 --> 27:38.030
And it seems it can, so we're telling it to test the connectivity against outlook.office.com, talking to the EWS API, and the result is success.

27:38.030 --> 27:39.210
So we are authenticated.

27:39.850 --> 27:44.770
This also has a nice flag that you can use to get some more debug information.

27:45.390 --> 27:51.410
And I looked at the debug information, and that was a very large rabbit hole it turned out.

27:51.650 --> 27:54.250
So let's look at some of the information here.

27:54.310 --> 27:56.690
So it goes to outlook.office.com.

27:56.690 --> 27:59.690
It says, hello, I want to talk to the EWS API.

27:59.930 --> 28:02.810
And then that says, okay, you need to be authorized.

28:03.090 --> 28:06.790
I accept tokens from this issuer like 0001.

28:06.830 --> 28:10.470
That's actually the GUID for Entra, so it accepts Entra tokens.

28:10.790 --> 28:15.570
And then Exchange on-prem says, oh, it includes the off-server ACS.

28:15.750 --> 28:17.090
I've never heard of ACS.

28:17.090 --> 28:18.530
I don't know what ACS is.

28:18.630 --> 28:23.490
But then it's getting a token, so it's getting a token at the ACS off-server.

28:23.830 --> 28:27.230
And the token is apparently called a actor token.

28:27.570 --> 28:29.210
I don't know what that is either.

28:29.330 --> 28:33.670
ACS lives on accounts.access control.windows.net.

28:33.750 --> 28:37.510
I had also never, ever heard of that, so I don't know what it is.

28:37.530 --> 28:42.530
I actually still don't know what it is or why it's even there, but it appears to be like some weird legacy thing.

28:43.150 --> 28:45.070
And it was sending an assertion there.

28:45.070 --> 28:49.410
Well, at least I know what an assertion is, and the rest I had to figure out from there.

28:49.810 --> 28:55.790
And when it got that actor token, it generated some other token, and this token is actually not signed.

28:55.870 --> 29:04.970
It's an unsigned JSON web token, and apparently that is used as like an outer mechanism for the inner actor token or something like that.

29:05.310 --> 29:08.790
So I tried to find some documentation on this, which is quite hard.

29:08.790 --> 29:10.630
You're definitely not going to find it for Exchange.

29:10.630 --> 29:13.170
I did find a few documents for SharePoint.

29:13.390 --> 29:29.030
I did also manage to create an image that kind of captures this whole scenario pretty well, because this protocol, these actor tokens, I mean I've seen a lot of shady protocols, a lot of bad protocols, and like this one wins in shadiness by like a very,

29:29.030 --> 29:30.190
very long margin.

29:30.650 --> 29:36.970
So let's have a look at ACS, or access control service it is called.

29:37.170 --> 29:48.910
So you would think that if Exchange wants to access other service in the cloud, that it talks to Entra, that it gets like some tokens with the OAuth like on behalf of Flow, something like that, and it gets some secure scope token.

29:49.230 --> 29:50.370
But no.

29:50.470 --> 30:12.510
So Entra is like this shady friend that's called ACS, and that gives out tokens, if you ask nicely, and Exchange requests an actor token, and ACS issues an actor token, and those actor tokens, as the name implies, they allow Exchange to act on behalf of anybody that it likes.

30:12.850 --> 30:27.230
So if Exchange wants to talk to Exchange online, it's going to say I have this actor token, this actor token allows me to impersonate users, and I'm going to impersonate Bob, or I'm going to impersonate Alice, or I'm going to impersonate whoever I would like to be,

30:27.230 --> 30:31.190
because this actor token allows me to impersonate anybody in the tenant.

30:31.870 --> 30:42.110
And the only time that we actually need to talk to a cloud-based service is when we request the actor token, because the users of the actor token is in this unsigned JSON web token.

30:42.610 --> 30:44.370
So this is how actor tokens look.

30:44.370 --> 30:57.530
So they are signed by Entra actually, the audience in this case is Office, or outlook.office.com, the issuer is this thing called ACS, and the important field here is this trusted for delegation.

30:57.530 --> 31:02.370
So if a token is trusted for delegation, it's allowed to impersonate other users.

31:02.610 --> 31:13.970
Then we take this signed actor token, we embed this in a unsigned bearer token, that's this one, the actor token, and we say, okay, we want to impersonate this user today.

31:14.890 --> 31:19.390
So this is kind of shady, and this has quite a few security implications.

31:19.630 --> 31:27.090
So these things are called service-to-service tokens, or S2S tokens for short, and they have a lot of very interesting properties.

31:27.730 --> 31:29.770
So we're going to stare at this list for a while.

31:30.170 --> 31:32.430
Basically, they're valid for 24 hours.

31:32.810 --> 31:43.710
They cannot be revoked, so once an actor has this token, once an actor has this actor token, they can just access data in your tenant for 24 hours without any restrictions whatsoever, and nothing you can do about it.

31:43.970 --> 31:50.850
There's no logs when they're issued, because when Microsoft apps request tokens, that doesn't generate any logging on our end.

31:51.050 --> 32:01.830
They're unsigned, so to use them, we generate a unsigned token, which means that we don't need to talk to any authentication service, which again means that there's no logs for the actual impersonation itself.

32:02.010 --> 32:16.410
And we can impersonate anybody in the tenant for all the apps, all the Microsoft apps that have this trusted for delegation flag, and basically every Microsoft app I looked at had this, so I think that's a bit of a trend, that Microsoft apps just generally are allowed to do this for you.

32:17.230 --> 32:28.750
This authentication is not subject to conditional access or any security checks whatsoever, so even if you're in a very locked down environment, these actor tokens just bypass all the things, basically.

32:28.770 --> 32:42.090
You can access any mailbox in Exchange online with this, and for some reason it also works for SharePoint, because Exchange can also access SharePoint, which means we can access the OneDrive of anybody, all SharePoint sites, basically anything that we would like.

32:42.550 --> 32:51.050
And these S2S tokens are apparently used by Microsoft in their back end to actually access data on behalf of users.

32:51.050 --> 32:55.750
So in the back end, they're just passing around these actor tokens and just impersonating users.

32:55.750 --> 32:59.210
It all sounds very secure and not shady whatsoever.

32:59.450 --> 33:06.850
If any of these tokens leak, basically each of these tokens impersonate like an entire tenant's worth of data.

33:06.930 --> 33:14.510
So if you get some of these actor tokens out of any Microsoft service, you can just access all the data in that tenant that this token is scoped to.

33:14.890 --> 33:16.210
So it's kind of shady.

33:16.370 --> 33:22.350
Microsoft also seems to be aware that this is kind of shady, so they are actually working quite hard on eliminating this.

33:22.350 --> 33:28.870
They wrote a blog like a month ago that's acknowledging this hyper-difficult access, service-to-service tokens.

33:28.930 --> 33:45.110
I don't know that, I don't think that anybody that read this blog actually has a single clue what's written here, because this just means that all these apps that Microsoft has, they are accessing all this data with high-privileged tokens, impersonation tokens that don't have any security checks.

33:45.410 --> 33:51.950
And they've already successfully mitigated like a thousand high-privileged access scenarios, which is great of course.

33:51.950 --> 33:53.690
It's great that we're improving this.

33:53.830 --> 33:57.350
This also makes me wonder, why was this a thing in the first place?

33:57.350 --> 33:59.810
This sounds like a really bad design.

34:00.010 --> 34:02.510
And also, how many of these are still left?

34:02.510 --> 34:12.510
Because it's nice that you mitigated the thousands, but if there's still like 5,000 left where all these tokens are just like being sent between all these services, still sounds kind of risky.

34:13.110 --> 34:21.790
So, we have Exchange, Exchange on-prem, and it can access any data in Exchange online, and also full access to SharePoint.

34:21.830 --> 34:24.490
So let's do a little demo with that.

34:24.830 --> 34:28.490
I'm going to request an access token, or actor token actually.

34:28.530 --> 34:34.110
I'm going to request that for SharePoint, because the nice thing with SharePoint is these tokens can also be used in the UI.

34:34.490 --> 34:40.150
So I'm requesting an access token for this user, and I'm impersonating this user.

34:40.150 --> 34:45.030
This user is actually global admin, so there's no policies that block me from doing this.

34:45.070 --> 34:48.110
And I can then access their OneDrive in my nice browser.

34:48.110 --> 34:54.690
I can click on things, and you see I'm really authenticated as this user, because I totally did a very secure login.

34:55.470 --> 35:09.190
If I want to impersonate somebody else, I just change the user name in this unsigned token, so I don't need to talk to Entra for this, and I basically can do this for 24 hours with nothing to stop me, and then now I will be authenticated as a different user.

35:09.770 --> 35:11.990
So this works for OneDrive, this works for SharePoint.

35:12.110 --> 35:15.450
This also works for the SharePoint admin center if you want to do that.

35:15.590 --> 35:23.970
It also works for Exchange, but in Exchange they made some changes, so it no longer works in the GUI, but of course over the API it's not a problem if you want to do this.

35:24.650 --> 35:37.050
Now, I was originally going to sort of end it here, and then when I was preparing these slides, I was like, well, what if I request a token for my favorite API, the graph.windows.net?

35:37.770 --> 35:39.250
Well, that was interesting.

35:39.250 --> 35:55.090
I was getting back a token for graph.windows.net, and it was for delegation, so I sent this token to graph.windows.net, or actually I embedded it, the actor token, in a unsigned JSON web token, and it actually worked.

35:55.370 --> 36:11.970
So for this I need to do one more little thing, because the Exchange and SharePoint, they just care about the user principal name, but graph.windows.net actually cares about this thing called a net ID or name ID, and that's like a unique GUI for each user that you have in Entra.

36:12.730 --> 36:27.930
I could talk about it for a while, but basically you can just query this data, Exchange can query this data, you can query this with road recon, so I can just query the net ID of any user I want to impersonate, I put that in the token, and then I can talk to graph.windows.net on behalf of anybody.

36:28.510 --> 36:37.370
And it means that Exchange can basically just impersonate anybody in the tenants over graph.windows.net, and that means it can kind of do anything that it wants.

36:37.370 --> 36:51.690
It can add new users, it can add admins, it can modify settings, it can modify policies, because Exchange is actually a first party app, so it can again modify the conditional access policies, and we can just do whatever, we are basically anybody which includes global admins.

36:52.250 --> 36:54.130
So let's do another demo of that.

36:54.210 --> 37:12.590
This time we get an actor token for graph.windows.net, and I impersonate this user, which is a global admin, and then I just call the API, I add a new user, I give that new user global admin rights, and then we sign into the admin portal to show you that it really works.

37:13.370 --> 37:20.890
We can use our new accounts to authenticate, and we basically have full access to the tenant, we can do whatever we like.

37:22.130 --> 37:29.010
So let's go to the user list, and let's search for the user, show you that it really exists.

37:31.900 --> 37:32.960
There we go.

37:32.960 --> 37:38.320
This is your new global admin, and you see it actually has the role global administrator.

37:38.320 --> 37:48.980
So we compromised Exchange on prem, and then we became anybody, and then we also became global admin in Entra, and we compromised the entire tenant while bypassing all the security features that we have.

37:49.460 --> 37:50.340
So it's fun.

37:51.000 --> 38:05.660
If you look at the audit logs, there are actually audit logs if you perform actions with this, and the nice thing about this, for defenders at least, is that you can detect this quite nicely, because these audit logs look quite weird, because in this case I'm impersonating this user,

38:05.660 --> 38:10.140
but it shows both the user and it shows Exchange at the same time.

38:10.140 --> 38:15.200
So it shows the user principal name of the global admin, but it also shows the display name of Exchange.

38:15.200 --> 38:22.120
And this kind of unique combination of both Exchange and the user is kind of a telltale for this attack.

38:22.120 --> 38:26.180
So you can write a nice detection query that we can actually filter the audit logs.

38:26.360 --> 38:32.580
You have to filter out some of the legit operations that Exchange does, because Exchange actually uses this in the back end.

38:32.620 --> 38:40.240
They use this to modify groups, so if you act like over the Exchange PowerShell module, it will modify groups based on this logic.

38:40.240 --> 38:44.060
It also sometimes modifies the tenant settings, so we have to filter these out.

38:44.240 --> 38:55.820
But then any event that emerges from this query, unless like another weird Exchange thing that I'm not aware of, that should be like somebody misusing this or abusing this.

38:55.820 --> 39:03.820
Thanks to my friends at work in detection for actually validating this across multiple tenants, that this is the only legit behavior that they could find.

39:03.820 --> 39:06.180
So anything that hits from here should be malicious.

39:06.800 --> 39:11.080
Now if you have a tenant , then you might want to know like, does this affect me?

39:11.080 --> 39:18.420
So if you have Exchange Hybrid , then yes it affects you because you have this credentials on the Exchange service principle .

39:18.460 --> 39:20.440
But you can also see this from the cloud perspective.

39:20.440 --> 39:25.420
So if you go in RotaryCon , if you go to the service principles, then you can see the key credentials.

39:25.820 --> 39:35.400
The funny thing is that you cannot see this in the portal because Microsoft tries to hide the ability that service principles can even have secrets in the Azure portal and Entra portal.

39:35.400 --> 39:36.840
So there you cannot see it.

39:36.840 --> 39:38.600
But over the API you can see it.

39:38.620 --> 39:48.300
And if you have key credentials here, then it means that if they're still valid, because you see this sometimes that companies have a Exchange Hybrid set up in the past.

39:48.300 --> 39:49.480
It's no longer there.

39:49.480 --> 39:51.020
So the keys have all expired.

39:51.020 --> 39:51.920
Then you're not at risk.

39:51.920 --> 39:56.580
But if you have an active key, then it's really time to start wondering where is that key?

39:56.580 --> 39:57.740
Who has access to that key?

39:57.740 --> 39:59.260
Is that protected very well?

39:59.500 --> 40:02.620
And if you're not using it, just make sure to remove the keys.

40:03.280 --> 40:11.680
And there's actually a different mitigation because it's now possible to split up the service principle from Exchange Online and Exchange On-Prem.

40:11.680 --> 40:13.380
So they announced this in April.

40:13.380 --> 40:20.520
So it's like somewhere between me submitting this talk and me giving the talk, they also realized themselves that this is not ideal.

40:20.520 --> 40:21.620
So you can split it up.

40:21.620 --> 40:24.500
It's actually going to be required by October 2025.

40:25.160 --> 40:42.800
Actually this, I don't have a screenshot of this, but I gave this talk at Black Hat a few days ago and on that day the Exchange team released another blog and they're like, well not enough of you have been doing this, so we're going to turn off the API for like two days in August to make sure that your stuff breaks and that you really migrate from here.

40:42.800 --> 40:46.340
So they do consider this pretty important to do.

40:46.340 --> 40:49.640
So if you have Exchange Hybrid, definitely go do this.

40:50.940 --> 41:00.360
I didn't actually think this was a vulnerability because I just think it's like an extremely flawed design, but it's not like somebody made that design by accident, like Microsoft uses this.

41:01.000 --> 41:04.360
Somebody legitimately thought like this is the way that we should do it.

41:04.580 --> 41:08.020
So I was like, okay, well it's not a bug, I think.

41:08.060 --> 41:15.520
But I still reported to MSRC like a whole three weeks before I gave this talk, which gave them like plenty of time to think about what to do with it.

41:16.200 --> 41:18.820
The product team did consider it a vulnerability .

41:18.840 --> 41:20.160
That's also a bit unusual.

41:20.160 --> 41:26.460
Usually I think something is a vulnerability and they think it's not a vulnerability, but in this case they definitely thought it was a vulnerability .

41:27.180 --> 41:35.600
And I'm very happy that they actually managed to get out a fix so that I can talk about this without them being angry with me.

41:35.740 --> 41:44.420
But they basically released a fix last week and they also did another fix over the weekend to actually block the behavior for GraffledWindows.net.

41:45.040 --> 41:50.540
So first party service principles can no longer get these actor tokens for this API.

41:50.880 --> 42:01.680
You can still do this for Exchange and SharePoint, so you can still use Exchange on-prem to access Exchange online and get access to all the data that is stored in the cloud service.

42:01.940 --> 42:11.880
They also assigned a CVE, basically they told me on Monday they were going to assign a CVE and on Tuesday, anyway, there was a CVE on the day I was doing my talk.

42:12.000 --> 42:22.060
And then also like CISA released like an emergency patch notice that people should really be doing this, so apparently it caused a little bit of a storm.

42:22.580 --> 42:34.660
And there's the CVE with like the migration things that you should do, which means that you should actually split up the service principle, remove any key credentials that you don't need to mitigate from this on-prem to cloud attack.

42:35.080 --> 42:38.340
So let's change the attack graph a little bit.

42:38.340 --> 42:45.260
We can no longer access any user, but we can of course still access Exchange online or SharePoint online.

42:45.460 --> 42:52.520
I thought that was it, and then yesterday I was actually having a chat with Katie from Datadog, and she was like, did you do something with Exchange?

42:52.720 --> 42:55.480
Because they blocked the ability for Exchange to get tokens for graph.

42:55.480 --> 42:56.300
And I was like, what?

42:56.300 --> 42:56.980
They did?

42:57.040 --> 42:58.380
And it turns out, yes, they did.

42:58.380 --> 43:03.320
So they blocked Exchange service principles for getting tokens for the Microsoft graph like entirely.

43:03.640 --> 43:05.180
So this thing is also kind of fixed.

43:05.180 --> 43:07.940
I didn't know about this, but apparently it is fixed.

43:08.200 --> 43:13.020
So you can also no longer modify the federation configuration.

43:14.360 --> 43:20.720
So to conclude, ID connect was quite a bit more powerful than you probably knew about.

43:20.740 --> 43:26.740
It could modify a lot of things in the tenant, could modify policies, authentication methods, federation config, et cetera.

43:27.220 --> 43:41.580
Exchange hybrid on-prem is essentially the same thing as Exchange online, and Exchange online can just, or could at least access whatever on behalf of anybody with very little logging and not really, yeah, it's just that basically.

43:41.580 --> 43:45.560
I think this whole actor token design shouldn't have been there in the first place.

43:45.560 --> 43:50.480
It's lacking very important security controls in kind of all places that exist.

43:50.740 --> 44:00.940
And I also think that like the whole thing Microsoft is doing in the back ends, they should be a little bit more transparent about this because this has been the case for I don't know how many years.

44:01.400 --> 44:12.840
And if they are doing these insecure things in the back end, at least I'd like to know about this because if they were more transparent about this, maybe I would have found this a few years ago and it would have been more secure like a few years back.

44:13.080 --> 44:16.800
If you have Exchange on-prem, definitely go do the migrations.

44:18.080 --> 44:19.720
Lastly, some references.

44:19.720 --> 44:23.500
So I couldn't put all the references to existing or prior research in there.

44:23.500 --> 44:25.120
Here's a whole list of reading material.

44:25.120 --> 44:32.340
You can also find this version of the slide deck on the DEF CON media server so you don't necessarily need to write all of these down.

44:33.140 --> 44:34.560
And this was kind of my talk.

44:34.740 --> 44:37.340
I was very excited originally about this research.

44:37.500 --> 44:41.180
There is one more thing I'm a little excited about that's going to be my next talk.

44:41.240 --> 44:44.780
And my next talk has a slightly different title.

44:45.060 --> 44:48.680
I'm happy to take any questions on whatever I covered before.

44:48.680 --> 44:51.720
Not on this, but I promise you this is also going to be interesting.

44:51.780 --> 44:52.560
Thank you so much.

