start	end	text
0	400	Okay.
400	4720	So Tote is going to be talking about Active Directory and something.
4720	5940	So let's give him a welcome .
10420	11280	Yeah .
11280	12000	Wow.
12660	14100	Hello, everyone.
14660	15620	Welcome.
15760	17460	Thank you so much for joining.
17460	21840	So this is actually my first time talking.
21840	26980	I mean, this is actually my first time actually being in an international conference.
27740	31380	So talking in DEF CON feels like a dream.
31380	37600	So anyway, today I'm going to talk about a vulnerability I found in Active Directory.
37760	46020	And before we actually get to the vulnerability, let me start with some background.
46020	52760	So I found this vulnerability while doing a research about DMSA.
53300	57700	And three years ago I also did a research on GMSA.
58200	63740	Now, there is just one thing that I couldn't figure out about MSA.
63740	71300	Because I can, like, I mean, after I did research on both of them, I can say that I have a grasp of how they work.
71300	79740	But the thing that I just couldn't figure out was why the D in DMSA and the G in GMSA are lower case.
79800	84440	And the at first I thought this is just because I'm not an English speaker.
84440	91460	So when I worked on GMSA, I asked like a ton of people why the G is lower case.
91700	104120	And so I'm telling you this story just so you know that if at some point during the presentation you will ask yourself why it is written that way, I have no clue.
104620	108500	And yeah, so I'm Yuval Gordon.
108500	111120	I'm a security researcher at Akamai Technologies.
111440	118280	And in the past decade or so, I've been working on different roles in cyber security.
118280	125000	But the one domain that I keep coming back to is identity research and active directory.
125100	129200	And so in Akamai, I'm now doing an offensive research.
129200	132040	So that's how I got to this research.
132380	136880	And that's my X handle over somewhere.
136880	139680	So feel free to follow me or reach out to me.
140900	144140	And okay, so let's get started.
144500	151880	So we're going to start by with a quick introduction of service accounts.
152160	158440	So this is just to make sure that everyone has some understanding of what service account is.
158740	161960	And then I'm going to do a deep dive to GMSA.
161960	167540	I'm going to explain exactly how they work and where I found the vulnerability.
168400	178120	And after that, I will be talking about that successor, which is the name of the technique that we use to exploit this vulnerability.
179300	187600	Okay, so in order to explain what a service account is, I'm going to use a story by Elad Shamir.
187600	193140	So Elad Shamir is, I think, the VP research of Specter Ops.
193140	196680	And he has some talks related to Kerberos.
196680	203600	And in his talks, he has this concept to explain about Kerberos and different things in Kerberos.
203600	206120	And I just really love his story.
206120	211300	So I really recommend you guys to watch his talks.
211300	216520	But for now, I will just summarize the relevant parts for us.
217140	222640	So in his story, Elad is talking about this amusement park.
223360	227980	And in this amusement park, there are, you know, visitors.
228320	233160	And when a visitor enters the park, they get a daily ticket.
233160	238180	So the daily ticket, it's like a TGT in Kerberos.
238920	242820	And so in the park, we have a lot of different rides.
242820	246780	So every ride, it's like a different service.
246800	250240	And service, for example, can be a web application.
251140	257620	So when the visitor wants to get on a ride, they need a ticket for that ride.
257620	265120	So actually, the daily ticket that they got is not enough to get on a ride.
265380	269500	Each ride requires a different ticket.
270000	280760	So what the visitor has to do, they go to the ticket office once again, and they now ask for a ticket for the specific ride they want to get on.
281600	285560	And so when they get the ticket, they will go to the ride operator.
287980	292440	And this will be the main focus of our talk today.
292480	299240	So they will go to the ride operator with this ticket, and they will hand it the ticket.
299240	302920	So the ride operator will validate the ticket.
303220	308460	They will, so the ticket has some information about the user.
308460	328960	So it will include the age of the visitor and the height of the visitor and maybe the different membership, like maybe this is a premium user and the ride operator will validate it and decide whether the visitor should be allowed to get on the ride or not.
328960	334780	So maybe it's like a premium ride and the visitor can't actually access it.
334780	338780	So that's the purpose of service account, kind of.
338780	343980	So there are different types of service accounts.
343980	351840	We have the legacy type of service account, the unmanaged type, and we have the managed type.
351840	368040	So actually the legacy service account, they had like a lot, they have a lot of security risks involved with them and the most major one is that they are a target for an attack called Kerberos thing.
368040	372720	So this is a widely used attack, very common today.
372720	374220	Attackers love it.
374240	390520	And in 2008 and 2012, Microsoft introduced MSA and then GMSA and we will refer to both of them as MSA because for the sake of our talk, we don't really care about the differences between them.
390520	398140	So MSA actually solved the security risks that were related to the legacy service account.
398140	409920	But if that's the case, you might think that it's pretty weird that I'm still talking about legacy service accounts more than a decade after MSA were introduced.
409920	417380	So the reason for that is that unfortunately, GMSA just didn't take over.
417380	421340	So let's talk about why that is the case.
421620	430540	So the first and I think most major problem with MSA is that they are just not fully supported.
430620	439680	So for us to configure a service , to configure an MSA for a service, the service has to support MSA.
439680	447680	And if the service doesn't support MSA, well, we can't just do it and then we have to use a legacy service account.
448400	463040	And so the other problem is that even if the service does support MSA, so say we have an existing service that is running with a legacy service account because we have our environment for like decades.
463040	464520	So it makes sense.
464520	467440	We couldn't done anything before.
467440	474120	So now we want to have this service that uses the legacy service account use MSA.
474120	476560	Well, that's a pretty difficult task.
476560	480620	It will require a lot of time and work from the IT team.
480620	488480	And if they will have some mistake, if they will get something wrong, the results can be down time for the service.
488480	494180	And some services are too critical to risk with this kind of risk.
494180	496660	So that's a problem .
496660	505320	But luckily for us, just recently in 2025, Microsoft introduced a new kind of MSA , DMSA.
505320	508820	So DMSA is delegated managed service account.
508820	516900	It's a new type of MSA that has all of the advantages that the previous types of MSA had.
516900	520980	But this time, the IT team can just lay back and relax.
520980	533180	Because there is a really new cool migration process that let IT teams take an existing legacy service account and migrate it into a DMSA.
533180	539000	And every service that uses the legacy service account will now use the DMSA.
539000	544600	And it doesn't matter if the service supports MSA or not, it will work.
544680	550180	And it doesn't require much work from the IT team.
550180	552540	It's pretty straightforward.
552540	555820	So they can't make any mistake there.
555820	558340	So it's pretty amazing process.
559420	572880	And one more thing about DMSA, Microsoft documentation says, I'm not sure if you can read the quote, but DMSA secret can be retrieved or found anywhere other than on the DC.
573400	578120	So when I saw this sentence, it was pretty weird for me.
578280	589400	And we will get to this sentence back later because I think that we can debate on if this statement is actually true or not.
589400	591200	But that's for later.
591200	594080	So let's talk about the migration process.
594960	600740	So we can actually divide the migration process into three phases.
601060	604020	At first we start the migration.
604020	606040	Then we have to wait.
606040	608580	And then we complete the migration.
608920	618100	So before actually talking about each of those phases, let's start with how authentication looks like before we even start the migration.
618220	624380	So we have a server on our left, an SQL server.
624480	628700	And that server is running an SQL service.
628800	633980	And we have configured a legacy service account for that service.
633980	637500	So the name of the legacy service account is SBC SQL.
637860	648600	And when the service will ‑‑ so the service needs to authenticate and for that it will request to authenticate as SBC SQL.
648640	652080	And the DC will respond with a TGT.
652680	653120	Okay.
653120	654560	So that's nice.
654560	657580	So now let's start the migration.
658180	663860	So when we start the migration, what happens is we have now a new DMSA.
663860	665040	I have created a DMSA.
665040	667200	I called it DMSA dollar.
667260	669340	And we started the migration.
669340	673540	So what happens is the two accounts get automatically linked.
673540	676540	So each account is pointing to the other.
676640	684660	And also the legacy service account is granted the right permissions on a certain attribute on the DMSA.
684780	688980	So this attribute is a pretty critical one.
688980	692260	It controls who can authenticate as the DMSA.
692260	700640	And I will explain why the legacy service accounts need these permissions in the next slide.
700700	706960	So, okay, we have started the migration process and now we are entering the waiting phase.
706960	721080	So what happens during this phase, so when the server is authenticating now, when the service will try to authenticate as SBC SQL, it will get a TGT in response once again.
721420	726300	This time, however, the response will include some additional information.
726300	735380	So the additional information will have a message saying that this user will be soon superseded by DMSA dollar.
735560	756180	So when the Kerberos client, which actually handles all of the authentication for the SQL service, so when the Kerberos client will see this message, it will automatically send an LDAP modification request to the DC requesting to allow SQL server, which is the server we are currently running on,
756180	759500	to be able to authenticate as the DMSA.
759500	771760	So we are, so the Kerberos client is doing that to make sure that the server will be able to use the DMSA after the migration will be completed.
771780	776180	And this is why the waiting phase is actually there.
776180	793540	So we want every server that is currently using this service, this service account, sorry, to authenticate with the service account and get the permissions to actually access the DMSA for the moment that we will complete the migration.
793900	796840	So at this point, we need to wait.
796840	799840	So, okay, we are waiting for about a week.
799840	802340	Then we complete the migration.
802500	806740	And when we complete the migration, we have the legacy service account.
806740	809560	And it gets automatically disabled.
809620	813660	And some Kerberos configurations are being copied to the DMSA.
814440	819440	Okay, so let's look at what happens during authentication now.
819700	825280	So once again, the service is configured to run with SVC SQL.
825280	837440	So it will try to authenticate as SVC SQL, but this time the DC will respond with an error because, and then the error will have some additional information.
837440	846620	So the error was because the user is disabled, but the additional information will say that this user is superseded by DMSA dollar.
846900	854680	So when the Kerberos client sees this message, it will just try to authenticate automatically as DMSA dollar.
854680	864540	And because we allowed SQLSRV to authenticate as the DMSA, it will work and the DC will reply with a TGT.
864960	866760	So that's great.
866760	872960	And almost everything I just showed is from Microsoft documentation about DMSA.
872980	877840	But there was this one thing that they didn't mention at all.
877840	882000	So it really bothered me because it's a really critical thing.
882000	885300	So this thing is privileges.
885540	898920	So we have a legacy service account and we have a DMSA and I said that there is a really cool new migration process that, you know, migrate the service account to the DMSA.
898920	909240	But I expected the permissions of DMSA to be the same as the legacy service account.
909240	913940	But the process was pretty weird.
914000	921260	So in order to understand what happens, let's talk a bit about Kerberos privileges.
921440	934360	So in Kerberos, in Kerberos TKET, we have a structure that is called the pack and our privileges in the domain are determined by the pack when we authenticate with Kerberos.
934560	944120	So in the pack, we have some information about the user and also a list of every group that the user is a member of.
944120	951520	So we had the legacy service account and they were a member of several groups.
952340	957640	And so that was like their privileges in the domain.
957640	959740	And now I've created a new DMSA.
959740	966720	I completed the migration process and I checked whether the DMSA is a member of the same groups.
966780	970280	And well, the DMSA is not a member of any group.
970360	977100	So by this logic, I can expect the pack of the DMSA to look like this.
977700	992080	But if that's the case, that's a huge problem because it means that those two users don't have the same privileges in the domain and therefore the service wouldn't work as expected.
992320	1005200	So I guess Microsoft engineers have watched Dragon Ball, same as me, because they too knew that when a problem is just too big, there is only one solution, which is fusion.
1005760	1010420	So the pack of the DMSA actually looks like this.
1010420	1018600	So what this is doing, when we authenticate as a DMSA, it will build a pack for the DMSA just as we can expect.
1018600	1023460	But then it will also check if the DMSA is linked to another account.
1023840	1045740	If so, the DC will also generate a pack for the other account and will just merge the two together and that way we will have a pack that has, I mean, that way the DMSA will have the privileges of SVC, SQL and the exact same privileges.
1046080	1065340	Okay, so when we saw that, we thought that this is like really interesting because I have never heard of any mechanism in Active Directory that just let you copy the privileges of one user, give it to another and without changing any group membership or something like that.
1065340	1071380	So I thought this was really cool and I wanted to know whether I can abuse it or not.
1071660	1074540	So, spoiler alert, I did abuse it.
1074540	1083300	But before actually talking about how I abused it, let's talk about how the migration process, like how we start the migration process.
1083700	1091760	So, Microsoft documentation says that in order to start a migration process, we need to execute this partial commandlet.
1092220	1103320	Now, if you will try to execute this partial commandlet as a non-domain admin, well, it will fail because Microsoft probably thought about it.
1103320	1110460	They don't want regular users to just migrate a legacy service to DMSA.
1110460	1111540	It's problematic.
1111540	1113120	Okay, that makes sense.
1113120	1117520	So, let's understand like why it is failing.
1117520	1120480	What is happening when we execute this command?
1120560	1127040	So, apparently this command is just a wrapper for an LDAP operation.
1127460	1133140	So this is just basically a request that we send to the DC to invoke some functionality.
1133720	1144460	And, well, if you will try to manually send this LDAP operation, this request to the DC as a non-domain admin, it will fail.
1144700	1147200	Yeah, sorry, forgot the animation.
1147200	1161200	So, what happens is that on the DC side, there is a verification and the DC checks if the color of this LDAP operation is a domain admin or not.
1161200	1164300	And if we're not a domain admin, it will just fail.
1164300	1165700	So, again, it makes sense.
1165700	1171380	Microsoft don't want us to just migrate services, service accounts.
1171380	1180600	So, at this point, let's understand what the DC is doing when this functionality gets invoked.
1180600	1185780	So, what the DC is doing is actually just changing some attributes.
1185780	1191620	So, it changes attributes on both the DMSA and the superseded user.
1191700	1218380	So, at this point, what we want to check if, like, if we have control over the DMSA, maybe even if we don't have domain admin rights, maybe we can just write to the same attributes and, like, you know, mimic the migration process and apparently that just worked.
1218380	1226120	So, if we change an attribute on the DMSA, that DMSA is now linked to whatever account we want.
1226120	1228040	There is no protection from that.
1228040	1239280	So, even if the account is in the protected users group or, like, I don't know, there is the account sensitive and, like, cannot be configured for delegation.
1239280	1241800	So, that won't work as well.
1241800	1250440	I mean, I can link the DMSA to any account I want and just copy the privileges of that account to my DMSA.
1250960	1253560	So, that leads us to bad success.
1255180	1255920	Okay.
1255920	1258320	So, let's go over the attack flow.
1258320	1266820	So, we have an attacker and that attacker has a control over a DMSA and their goal is to achieve domain admin privileges.
1267080	1273440	So, what the attacker will do is they will just simulate the DMSA migration.
1273700	1287320	So, they will link the DMSA to another user, a domain admin, and then what they have to do is to authenticate as a DMSA and the DC will just grant them the privileges.
1287420	1289160	So, okay, that's nice.
1289160	1292760	The attacker achieved their goals and that's pretty bad.
1292760	1304420	But, actually, I mean, the starting point, that's not trivial at all because, I mean, first of all, DMSA is a brand new feature.
1304420	1307980	So, I mean, most organizations don't use it.
1307980	1312460	So, gaining control over an existing DMSA is a pretty difficult task.
1312460	1321340	But, also, the DMSA by default are being created in a container called a managed service account container.
1321340	1335960	So, this container is highly restrictive and if we're not like tier zero accounts, we probably don't have control over this container or any object inside which includes the DMSA.
1335960	1341360	So, okay, that's not like a really strong attack.
1341360	1352720	But then we figured that while DMSA by default are being created in the managed account, in the managed service account container, they don't have to be created there.
1352720	1357340	So, apparently, we can create DMSA in any OU.
1357340	1366220	So, OU is organizational unit and basically this is like a folder in active directory.
1366220	1387160	And so, some folders may be considered like as, you know, less important because maybe they don't have any important object inside and maybe there is a team that consistently annoys the IT team in requesting to do stuff in that OU.
1387160	1391960	So, the IT team will just grant this team permissions over the OU.
1391960	1399640	I mean, it's their OU so they can just manage it and what's the worst that can happen, right?
1399640	1402300	So, that's the worst that can happen.
1402300	1414380	So, now the attacker has control over an OU and they will just create a DMSA there and the rest of the attack flow will be the exact same.
1415180	1418640	So, now let's see a demo of this attack.
1420040	1420720	Okay.
1420720	1428800	So, we are running as a weak user and we will try to add ourselves to the managed meals but we fail because we don't have permissions.
1429080	1438000	So, now we see that we have privileges to create an object inside of the temp OU and we will create a DMSA in that OU.
1438860	1443740	And now we will link this DMSA to the administrator account.
1444580	1445000	Okay.
1445000	1448980	So, the DMSA is linked and now we need to authenticate as the DMSA.
1448980	1451040	We will use Rubius for that.
1453000	1456800	So, now we can see that we are authenticated as the DMSA.
1456800	1458980	We will try to add ourselves to the managed meals once again.
1458980	1462860	This time we succeed as we are running with administrator privileges.
1473180	1473880	Right.
1473880	1477480	That was a great time for drinking water.
1477560	1477920	Okay.
1477920	1488080	So, we have reported this vulnerability to Microsoft and they agreed with us that this is actually a vulnerability.
1488720	1503760	And so, they said that if we have an attacker and that attacker has a control over an OU and from that they can just gain the privileges of any account in the domain and basically just own the domain.
1503760	1506860	This is a moderate severity vulnerability.
1507100	1512660	And because of that, it does not meet the bar for immediate servicing .
1513240	1518240	But, however, they did say that they will fix it in the future.
1518280	1520200	So, yeah.
1521020	1524780	But that's actually not the end of it.
1525580	1531700	So, when I started with the research, I saw this structure.
1531700	1537080	So, this structure is a structure that, okay.
1537080	1547760	So, the TGTs for DMSA includes this structure and this structure holds two very important fields.
1547760	1551820	It holds the current keys and previous keys of the DMSA.
1551820	1560260	So, in the current keys and previous keys, there are the Kerberos keys for the DMSA, which are basically credentials.
1560440	1565140	So, we can think about it as the password hash of the DMSA.
1565300	1574340	And when I saw it at first, I thought it makes, I mean, I thought this is, I mean, it makes sense.
1574340	1580260	The machine actually needs the credentials of the DMSA to do different stuff.
1580900	1586640	And I didn't give it any attention until I saw this response.
1586720	1590580	So, I hope you guys can actually see it.
1590580	1594660	But what happens here is we have a decoded response.
1594660	1598340	So, this is the Kerb DMSA key package structure.
1598340	1602040	And we have the current keys and previous keys.
1602040	1607800	So, in the current keys, we have the existing Kerberos keys of the DMSA.
1607800	1613700	I have just created and simulated the migration linked to the administrator account.
1613760	1617520	And we also have the previous keys.
1617520	1624700	So, that's pretty weird because this account is, I have just created it.
1624700	1628380	It doesn't suppose to have a previous password.
1628380	1633060	So, that's weird, but I actually didn't notice that.
1633060	1642380	What I did notice is that the value in the previous keys, and again, maybe you can't actually see it, but that's okay.
1642380	1644540	It's just an NTLM hash.
1644540	1656460	And usually I wouldn't recognize a specific NTLM hash, but I did recognize this specific NTLM hash because that's the NTLM hash of that password.
1656460	1659920	And this is the password that I always use.
1660060	1662360	I mean, in my lab environment, yeah?
1662360	1672020	So, when I saw the NTLM hash of that password, I immediately recognized it and I thought it's, it was like really weird.
1672020	1680580	Why the DMSA that I have just created and DMSA is this, you know, it's so secure and it has like randomly generated password.
1680660	1688300	So, why does it have a previous password that is AA126, my default password?
1688300	1700980	So, apparently what happens is when we link a DMSA to another account, we are not only stealing their privileges, we are also getting their credentials as well.
1700980	1704580	So, that's pretty cool, I think.
1704580	1709760	And that, of course, was the password that I configured for the administrator account.
1709860	1711940	As again, I always use it.
1711940	1725780	So, I created a tweet about it and in this tweet I show a video and I'm running this script and it will just dump the credentials of every user and computer in the domain.
1725880	1733380	And we also have here the credentials of which is, I think, the most critical account in the domain.
1733380	1736720	If you have it, you can craft golden tickets.
1737600	1746180	Yeah, so, I'm showing this because there was this one comment that I think summarized this whole thing perfectly.
1746300	1749960	So, it seems quite moderate.
1750560	1751320	Yeah.
1752120	1753080	Okay.
1753080	1755120	So, that's about it.
1755120	1756480	That's the attack.
1756560	1759560	And now, let's talk about detection.
1759940	1769520	So, I will talk just about detection and not mitigation at all because we will wait for Microsoft to patch it for the mitigation.
1770680	1772320	But, yeah.
1772320	1780620	So, for detection, when we execute the successor, there are a couple of logs that will be logged.
1780720	1787460	So, we have a log for creation but for this log we have to configure a cycle.
1787460	1789940	Cycle is system ACL.
1789980	1798160	So, you need to configure a cycle to actually log every time that a new DMSA will be created.
1798500	1801340	The next one is DMSA linkage.
1801340	1813360	So, again, configure a cycle and then every time that the attribute that controls the link will be, every time that it will be modified, the log will be generated.
1814040	1818680	And the next one, I think it's pretty interesting.
1819020	1823440	So, this is actually a log for DMSA.
1823760	1833840	And so, this log is for when you fetch a password for the DMSA, this log will be logged.
1833840	1848320	So, and you will have the caller seed and caller IP and they will hold the seed that actually fetched the password and IP that the request was originating from.
1848320	1872880	But when I authenticated as a DMSA, this log and this exact log has been generated and the weird thing about it is that in the caller seed, instead of like, I'm not sure what because I'm just authenticated as a DMSA, but the caller seed that we can see here is the seed of anonymous log on.
1873880	1885620	So, that's pretty weird and I think that it might be, like, it might be worth to take another look at it, but I haven't got the chance to do it yet.
1885620	1886820	So, maybe later.
1886820	1891120	But it will also include a blank in the caller IP.
1891280	1894040	So, that's pretty interesting, I think.
1894360	1903260	And anyway, I, MSRC were great to work with.
1903280	1910520	I mean, we did disagree on the vulnerability severity, but other than that, they were great.
1910520	1914180	So, I sent them the presentation before this talk.
1914180	1922540	I asked if they want to include any official statement and so they said that this is their official statement.
1922540	1927000	We are aware of this report and we'll be addressing it in an upcoming update.
1927000	1928600	So, stay tuned.
1930680	1933660	So, let's talk about conclusions.
1934340	1940960	So, first of all, DMSA is like a new security feature.
1940960	1943680	It was designed with security in mind.
1943680	1946120	It actually solves a lot of problems.
1946440	1956860	And it doesn't mean that the feature itself is necessarily secured just because they made it with, like, security in mind.
1957400	1975440	And so, the second point is to never skip the obvious because when I saw the whole pack merging thing and I talked with my manager about it and he said, well, maybe you can just try to change the attribute that control the link.
1975620	1978740	And I was like, no, that would be, like, way too easy.
1979160	1983260	But it apparently just worked and it was that easy.
1983520	1984520	So, yeah.
1984800	1988980	Next point is to log in the layer on DMSA links and creation.
1989240	1989880	Yeah.
1990520	1996960	And the final one is that DMSA is a great new feature.
1996960	1997500	I really love DMSA.
1997520	2005420	When Microsoft will patch it, I think it will be really worth for organizations to actually use this feature.
2005760	2007140	And, yeah.
2007140	2008520	So, that was it.
2008520	2009660	And hope you enjoyed.
2009660	2010700	Thank you so much.
