Anyway, are you all ready? Without further ado, Quentin and Will are going to wow you for the next 45 minutes. So let's give it up for them. Thank you. Hi, everyone. Welcome to our talk, turning your Active Directory into the attacker C2. Today we'll talk about group policy, object enumeration and exploitation. Let's first introduce ourselves. My name is Wilfred with my colleague Quentin, or Quentin in French. We do pen tests and red team at SYNACTIVE and this is the first time for us at DEF CON. So, let's start by a quick introduction. During an assessment, one of our colleagues said, well, yeah, we have an account that can modify a GPO that applies to domain controllers, but let us check for the ADCS first. So they enumerate ADCS, they find out they can exploit ESC4 which is a previous escalation. They exploited it successfully, but at the end, they got detected. So now we always mess up with them, like next time, maybe don't go straight for ADCS and look at GPO. So this is why we are talking about GPO today. Group policy object attack vectors may just be the ugly ducklings of ID exploitation. Why? Maybe it's not well known, maybe it's too risky to exploit because you can mess up active directory. Maybe there's not enough tooling. So we think it's a shame because attackers don't have such concern. And also GPO exploitation can be quite powerful because you can manage a lot of things into the active directory. So today we are going to brief, uh, give you a brief recap on how GPO works, how they are implemented. And we release four tools that will show that we can enumerate them and also exploit them with different kind of parts. Okay, so let's start by explaining group policy objects. A GPO is a collection of misconfiguration that applies to, uh, AD objects. It's a core feature of active directory. It deals with device and identity management. And a GPO can define user settings and computer settings. I will get into the details of that later. When you want to configure GPOs, you can open the group policy management console. And GPO has not directly, uh, not applied directly to user and computers, but most of the time to organizational units. They can be also applied to different objects such as sites or domains, but is less common. Something to, important to mention is like when you define settings for GPOs, by default GPO will inherit from the parent container. For instance here, the default domain policy will apply to all child containers, all child organizational units. For instance here, workstation, uh, servers and so on. The implementation of GPO in active directory is bit specific. They are basically made of two components. The first one will be the group policy container, which is a LDAP object. You will find out, you will find, uh, GPO metadata, name, description, version and so on. I will get some specific details after. You will also find the group policy template, which is the SMB share, that will contain the GPO files that describe the configuration that will be applied by the clients. So what you have to remember is basically you have two components, the LDAP parts and the SMB parts, as are tied together by a specific unique identifier, the GUID. And basically the LDAP part say what the, where the GPO applies and the SMB part said, okay, the GPO does this specific settings. Okay, so let's try to go into the details of the first part. The, everything regarding the LDAP. There are some noteworthy LDAP attributes, such as on GPC objects, the GPC file sys path, it will indicate where the, the UNC path of the GPT, so the SMB parts, where the GPO file located. You also have more attributes such as flags that will say the status of the user or computer configuration. It might be enabled or disabled. I will move on on that later. You also have specific LDAP attributes on organizational units. For instance, the GP link, it will say if the GPO is linked to this organizational unit, it can also be enforced. And you also have options such as inheritance. And the other part, the SMB part was the GPO templates, so in the SMB share you have multiple uh, configuration file, such as group.xml, received.xml and so on. When you can specify those, those settings. If I take a quick example on the bottom, you say group.xml, which is where you can assign uh, group assignments. Here we can see that the user Jack is added to the remote desktop user group. Okay. So, this is the basics, so now let's go into the details of the attributes. First, we will talk about inheritance on organizational units. I mentioned previously that by default, GPO will be inherited on the child containers. What you can do is like, you can avoid this by blocking inheritance, and when you go on the management console, right click on the workstation, and on the organizational unit, you can block inheritance, and what does, what's the change? On the LDAP you have the GPO option that will switch from 0 to 1, and it will be 1 if inheritance is blocked. And when you do that, any uh, parent uh, GPO will not apply to the specific organizational units. We also have the link attributes, so GPO are linked to organizational unit, like I mentioned earlier, and this is done by the GP link attributes. You will find in this specific attribute the common name of the GPO, and at the end you will find an integer that will describe the link status. This integer may vary from 0 to 3, and it will say if the GPO is linked, unforced, and so on. And if the GPO for instance is unforced, it will ignore the inheritance status. Here we have the, the table that said the configuration, most of the time you will find out that the integer value will be 0, but we also, we can also see unforced GPO, so we will find the integer value of 2. Move on to other attributes, now it's related to GPOs. So I mentioned earlier that GPO can apply to a user or computer configuration, and you can change it with the specific flags. So you can enable everything, which is the default. You can also choose to apply only computer or user settings, and you can also choose to disable everything. And what's going on behind the scene is like, we have a specific attribute again on the GPO object, which is called the flags, and we have an integer that will describe which component is enabled. So the integer, by default the integer value will be 0, so basically computer and user configuration are both applied, but we can see sometimes it's, for instance, if the integer value is 1, only computer settings are applied. Last part regarding GPO implementation is like, we have by default, the computers that updates their GPO, they are doing a background update every 90 minutes, with a random offset from 0 to 30 minutes. The setting can be changed, on the eGPO you can change the settings and put the value of 0, and the documentation, if the value is 0, it will try to update the GPO every 7 seconds. I will not recommend to update your GPO every 7 seconds, but it's technically possible. And so another thing to mention is like, not all policy are proceed. For instance, uh, software installation will be only applied when the computer starts, or there are also specific GPO that are triggered when the user logs on on the computer. So now, how do computers update these GPOs? So first, it interact with the domain controller, querying for the LDAP, for specific attributes, to know what are the GPO tied to the spe- to the specific computers. It queries the attributes such as GP link, or GP option, that I mentioned earlier. And is it now, the computer have a list of which GPO applies. Then it query the LDAP again for more information, such as GP file sys path, so now the computers know where the, uh, files are located, where the SMB share. By default it will be on the domain controllers in the CISVOL share. We also retrieve all the information such as flag, is computer or, uh, user or computer configuration are, are enabled or not. And now because it have all information regarding the LDAP, it initiate the SMB connection, and it retrieves all the file and applies the GPO. Okay, so this was, uh, how GPO works. There's also few, uh, other attributes that we don't have time to talk about, but it's not the main, main important one. So now, we want to present you a tool that we developed when we want to enumerate GPOs, and also doing like a stealthy way. We find out that during assessment, GPO enumeration is quite useful. It reveals valuable insights into the security posture of the system. And most of the time we will see, uh, interesting stuff like group membership or addition, previous assignment, risk modification and so on. So it's quite interesting from an offensive perspective and we go into the detail of each one. The first one will be, the most common one will be group memberships. Group memberships are frequently defined through GPO. Information that can prove crucial for lateral movements. For instance, I want to perform lateral movements, but I don't want to, I have a specific account, I don't want to try this specific account on every computer, it's quite noisy. And I don't want to perform, uh, wide range scans such as using net exec on large ranges. So by enumerating this through GPO, I know exactly where this specific user has admi- administrative privilege rights, or where it can do on specific computers. So I have a better understanding of group assignments. So, let's do an example. Here, I'm calling the LDAP, for uh, with a tool that is called LDAP, and I try to enumerate all the GPO. The first one is called LORGP, which is quite interesting for us because I want to perform lateral movements, uh, and this is also something that we already seen during our assessments. So, I'm interested in this specific one. I'm looking at this specific unique ID identifier, which starts with 008, and then I go to the domain controller on the SysVol share, and I try to retrieve all the file dedicated to this specific GPO. And within those files, I find out there's a group.xml file that say basically, the group domain user is added to the remote desktop user group. So I know this GPO is adding domain user to remote desktop. Now I need to find out where, on which computer. So, like I mentioned earlier, by default GPO, I mean, most of the time GPO are linked to organizational units. So again, I try to animate all the organizational units, and I can see here that my GPO LORGP is tied to workstation organizational units. Next step is to find out which computers within this organizational units, and here we have the works, WKS01corp.com. So, now if I, uh, type everything together, I can, I can know that the domain user group can LGP on the workstation01corp.com. So now I can move laterally easily without doing any noise. I don't want, I want to be stealthy. So it's better to animate GPOs. What you can do also is privilege assignments. You can assign, uh, interesting privilege for GPO. For instance, you can assign the SU debug privilege, which allows to debug any processes that you do not own, and it can be a free privilege escalation. We found out this is really uncommon, but still possible. But, in reality, it happens. Here we have an, uh, a practical example that's, we, the SETCB privilege has been assigned to any user on the, on the machine, and basically it's a free privilege escalation. With this specific privilege, you can add, uh, arbitrary groups to your token, such as administrator, and compromise the, the computer. What we see most of the time will be, uh, connection restriction. When you don't want your domain admin to connect anywhere to, in order to reduce the risk of credential exposure, you can perform connection restriction through, through GPOs, and basically they will deny, uh, access to specific computers. So it mitigates privilege escalation, and try to preserve the, the tiering model. So when you do it, when you're performing this kind of enumeration, you know, for instance, that domain admin will never connect to specific workstation, or specific machine to, uh, tie to organizational units. So, there's no point to go there and waiting for domain admin. You can also perform registry, registry modification through GPOs. Legacy name resolution protocols such as LMNA, MD, MDNS, and BNS are, are relative good, uh, exploitation vectors. It have, it have, it has been exploited since long time with such, with tools such as Responder. And administrator disable, disable those protocols through GPOs. Here, we can see that the, uh, MDNS protocol has been disabled through GPOs. So, by doing this kind of reconnaissance, I know that this, there's no point to exploit it on those specific machines. So, it helps, it, it helps me to, to choose, uh, re-revalent attack. Through GPO, you can also gather more information. For instance, you can go through hardening process. You can see that, for instance, LDAP or SMB signature has been enforced on which computer. You can also, so it's, it, it helps you to choose if relay attacks will be revalent or not. You can also, uh, we often see, uh, credential, um, credential hardening. For instance, the restrictions such as run SPPL and credential guard has been enabled. You can get more information regarding, uh, additional software installation such as EDR, so you know what you're dealing with. At the end, GPO animation can be time consuming and quite complex because there's a lot of things to take into consideration. You have to check for inheritance, you have to check for enforce link or not. You have to check if computer or user computer is enabled or disabled. There's also more specific filters, so we have to automate this. There's a lot of tools that try to enumerate, uh, GPO, uh, GPO, I mean, group PC objects, such as a well known blow down. But we, we noticed that it doesn't take every parameter into account. Here, I, I have an example where, um, within my workstation organizational unit, I have a child container, admin, and admin on the admin container, the original unit, the inheritance is blocked. I'm using the same GPO, L-O-L-G-P, that I mentioned previously , which allow any domain user to connect on those machines. So, I have a workstation one, which is within the admin container, and the inheritance is blocked. And the GPO, L-O-L-G-P, is on the workstation organizational unit. So basically, it prevents any user to connect to my workstation admin. On the right, on this, we have a partial command, when I try to, I mean, I update my GPOs, and I enumerate the members of the remote desktop user group. And the GPO, when the GPO are successfully updated, I can see there's no members, which is quite normal, because inheritance has been disabled. And when I collect the data with blood on, and I ingest it, blood on doesn't forget to take into consideration that the inheritance has been blocked on the admin container, and it show a path from domain user to workstation one, with the L-O-L-G-P edge, which is false. So, we notice there's other tools, but they also don't take every parameter into consideration , so we develop a tool, which is called GPO parser, that could parse all GPO configuration parameter that's presented earlier. It tries to, it tries to reveal misconfiguration and privileged relationships. It supports both online and offline analysis, and we, also we try to enrich blood on with useful hedger. This way we can create admin, the new hedges that we have lost from our GPO collection, such as admin tool, can L-G-P, can PS remote. You will find the tool on the, on the Synaptic GitHub right after the talk. So, I will give you a quick demo of this one. First we'll try to, um, collect it, I will, we'll collect it, uh, sorry, demo, I will, I will first show the, the demo that goes online. Okay, so basically you have to, here I'm doing the collection on remotely. You can collect GPO with, uh, a low privilege, uh, user, so I'm specifying the credential, I'm specifying the, the, um, the LDAP, and also the domain controller. It tries to connect, which is all the, all the file, and it parse. And here we can see for instance, this specific GPO, which is called Unforced SMB Signing, has been applied, you can see there's, there's some specific connection restriction tied to domain admin. You can also assign privilege, for instance, SA debug privilege to the developer groups, and so on. You can, for instance, you can see that the group, all, uh, admin, all over station are workstation admins. You can also perform this reconnaissance offline. So what you have to do is you have to collect all the LDAP data, I will do this LDAP, collect few information getting the LDAP. I will also need to connect the, retrieve the policy, which are by default on the SysVault share. I'm retrieving everything here. It can be, we can retrieve all the needed files, but here for the presentation, I just retrieve everything. And I will pass it locally. So I have to specify where I find the SysVault share and the LDAP folder. And what I also want to mention here, like, we can also filter, for instance, we want to know the GPO that's only applied to a specific target. For instance, the specific computer workstation one. And here, locally, I can see that all the GPO that's applied to this specific workstation, and now I can see the same information, but tied to this specific workstation. So basically it's the same, you can see that domain user can, uh, can, can connect through a remote desktop user group. Now I would like to let my colleague contact, speak about abusing ACLs. Alright, thank you Wilfred. So Wilfred explained to you how GPOs are implemented, and how you can abuse them to enumerate some security relevant, uh, configurations. For my part, I will actually explain to you how we can abuse GPO objects in order to compromise active directory objects, so users and computers. And the first way I'm going to do that is with the most standard way you would exploit a GPO in an active directory engagement. So let's say you have, uh, write access to a GPO with a user, um, and this is not an uncommon situation, we encounter it pretty often in engagements. This can be T1 accounts, this can result from administration, uh, mistakes, et cetera. And this is actually a very powerful primitive, attack primitive, because when you control a GPO, you can compromise all the objects that are linked, um, that are included in all linked organizational units, including sub-OS. Um, when you exploit a GPO, what you basically want to do is just leverage some built-in GPO features in order to deploy malicious configurations to the users and computers to which the GPO applies. And you can really, um, deploy a lot of malicious configurations. You can deploy some scheduled tasks, you can deploy some immediate tasks, or you can do something like add a user to a local group, you can, uh, transfer files, execute files, setting registry keys, you can define some logon or logoff scripts. Uh, what I want to, to, to point out is that imagination is really your only limit when you want to exploit a GPO to, in order to compromise the objects to which it applies. And, uh, we have some, some offensive tooling to exploit GPOs, not so many. Um, we can have some things like charge GPU abuse, by GPU abuse, GPONs, or the DRST tool suites. But, uh, during engagements, we found out that these tools have some limitations that made them pretty difficult to exploit. Uh, the main one is, uh, the stability and exploit safety consideration. So, GPOs are very critical in active directory. They are sensitive, uh, architecture components, so you really don't want to screw them up. So, exploit safety is really important. Um, there was also some, some lack, some lacking in clean up and revert capabilities. After we exploited, we want to clean up for stealth or just, just to clean up after yourself. Um, very often, there was no possibility to create GPOs, to manage links, to target specific objects with your malicious configurations, and more generally, there was a lack of available actions and options that you could configure, uh, to exploit your GPO. So, we created the group policy backdoor.py, uh, tool. This is a Python implementation using only LF3 and SMB protocol, so no impact for stealth considerations . Um, you can do quite a bunch of things with group policy backdoor. You can create your GPOs, delete them, back up them. You can manage your links. You can inject some customizable configurations. Um, importantly, you can also leverage the item level targeting feature of GPOs in order to only inject your configuration to specific objects. So, if you want to target a specific computer, you can, with group policy, uh, backdoor. You can also clean up after yourself and revert the actions you perform on clients. So, it will be available on GitHub, uh, after DEF CON. For it to be a little bit more concrete, let's take a real world example that we encountered, like, a few months ago. So, and let's try to exploit it with group policy backdoor. So, we compromised an account a few months back, uh, that has, that has, uh, right privileges of a pretty interesting GPO because the GPO was applying to a gem server that was used by domain administrators in order to perform some administrative actions. We didn't have any kind of privilege other than the rights on the GPO. We did not even have network access to this gem server. But what we did was that we exploited the GPO in order to add a scheduled task on this gem server. We configured this scheduled task to run in a privileged context in the, using the identity of a domain admin. And the scheduled task only added, uh, an account under our control to the domain admin's group. And you can see here a pretty interesting thing, is that we are exploiting a GPO that applies to a gem server in order to, let's, so to say, trap the gem server so that the scheduled task will trigger when the domain admin connects to it. All right, let's see a demonst- a quick demo. All right, uh, it's, this one, I think it's coming. All right, all right. So, let's say that we compromise the user that is called Aloy. You can see here, I'm authenticated with Kairos, with Aloy. Um, Aloy has some standard groups. You can see here I named the groups. It is part of the IT support group, quite standard. Uh, let's use group policy backdoor first to enumerate the GPOs of the domain with the enum list GPOs commands. You can see there is a bunch of GPOs. The one that interests us is called gem servers handling. Let's use group policy backdoor to get some more details on this GPO with the, uh, GPO details commands. All right . Um, the most important, uh, thing that we notice is that our current user, Aloy, has right permission of the GPO. This is pretty good. This means that we will be able to exploit it. And this GPO is, is tied to an organization unit that is called gem servers. In this gem servers organization unit, we have the gem server that we are trying to compromise. As you can see here, the AD01 bastion, which is the gem server that we are trying to exploit. All right. So, let's inject our malicious schedule task into the gem server. In order to do that, with group policy backdoor, you define a configuration through a .ini file that, uh, specifies what configuration you want to inject into the GPO and what option you want to, uh, configure your, uh, your malicious configuration with. So you can see here, quite standard, we want to inject a schedule task. Uh, we want it to run the cmd.exe program. We want it to add our user, Aloy, to the domain admins group. Uh, we want to impersonate ADM, which is a domain admin that connects to the gem server. And we want to repeat this, uh, schedule task every minute because we don't want to wait. Additionally, you can provide some filters. Here I say, I only want this schedule task to be defined on the AD01 bastion.com.com computer and not on anything else. For stealth, for instance. And you just, uh, provide a filter with a computer, computer name, um, uh, title. So let's run group policy backdoor with this configuration file, and this will inject our malicious schedule task into the GPO. You can see here, we provide the modify commands, and we provide the .ini file that I just, uh, showed, uh, to the gem server's hardening GPO on which we have write access. So we execute group policy backdoor. It does a bunch of stuff. I won't go into details, but it, uh, modifies the group policy container. It modifies the group policy templates in order to inject your configuration. In bub, it also bumps the GPO version so that clients will actually update the GPO. And now, all we have to do is, you, we can see on the domain controller here that, uh, the gem server's hardening GPO defines the schedule task with the group policy management console, just for illustration. So you can see here, our schedule task is there. It is configured to run with a trigger , with an action that adds our user to domain admin, some item level targeting in order to only be defined on the bastion. All right. So at this point, we would just wait for the bastion to refresh, uh, its GPOs, define the schedule task, and then add our user to the domain admins group. So that's what we're going to do. We will force the GPO refresh with GPO updates, because we don't have time to, to wait for 90 minutes. Um, so yeah, the GPO update command is executed. And you can see right after, that, uh, our schedule task will be defined on the gem server, and then the domain admin at the MQL will execute it, and add our user to the domain admins group. You can see here, we have the schedule task defined, running as MQL, and then it's all set. We just have to wait one minute, and our user will be actually added to the domain admins group. So I just cut the minute out, but, uh, you can see here with an LDIP command, that alloy is now part of the domain admins group. All right. So, you, you did your exploitation, that's great. What you want to do then, is clean up after yourself. You want, uh, to, to, to remove this configuration you injected into the GPO. And group policy backdoor makes it pretty easy, because each time it runs, it creates a state folder, that has many information about what it did, and you just have to provide the state folder to the clean commands, in order to, um, to clean up after yourself, and to, to remove the configuration that you injected from the GPO. So you can see here, I provide the state folder into the clean commands, I execute the commands, and it just, again, does a bunch of stuff, I won't go into details, but just removes the configuration from the GPO. All right. So that was, uh, I mean, we have a lot more examples of how we exploit the GPO during engagements. We used it to reach some network isolated workstations that we could not, uh, even pivot to. Uh, we used it to enable winarium, and add some firewall exceptions. We also used it to persist in the active, uh, directory environments after detection. So, the good news is that you can just extend group policy backdoor to your use cases, to, to add some more configurations that you want to inject into GPOs. You can do this pretty easily, so, don't hesitate to do so . All right, so this was kind of the standard GPO exploitation vector. We are going to dig a little bit deeper, and we're going to see how we can exploit group policy objects via, uh, NTLM relaying. A little, a little, um, context about this research. We were doing an engagement, uh , we were able to perform some NTLM relaying to the LDAP service, which is often the case . For instance, uh, you, you are able to relay HTTP to LDAP, right, in different configurations. And we were able to, uh, relay an interesting user that had right privileges of very interesting GPO, and this GPO applied to domain controllers. So, because we were relaying to the LDAP service, we had, we, we had the possibility to modify the group policy container, the LDAP, if you remember what Wilfred explains. But we had absolutely no privileges over this, the SMB share, so the group policy templates, on which the GPO configuration files are located. And we were wondering, is this even exploitable? Um, and it turns out that yes, it is. Because, uh, Wilfred mentioned it also a little bit earlier, but in the group policy, uh, container, you have an interesting attribute that is called the GPC file sys path. And it specifies the location of the G, the group policy templates as a UNC path. And by default, this will be simply the sys vault share , right. But, uh, it is actually possible to specify an arbitrary SMB share location in this attribute. Anything goes. And for, for Microsoft, this is a legitimate feature, this is expected, but not so much because it crushes the group policy management console. So, I guess this is kind of a gray area. Um, so you can see here, I just modify, uh, in, uh, in Windows, the GPC file sys path to a random IP address, right. And after 90 minutes, I start to see some objects that are trying to actually authenticate to me, in order to fetch the GPT files. So you can just specify anything in the GPC file sys path attributes. And so, if you pay attention, we now have, uh, an attack vector that is, uh, that you can implement through only NTM reading, by only modifying the group policy container. The first two steps are pretty standard, so you relay your user, uh, to the LDAP service, you interact with the LDAP service as the user. Um, this, the next step is to modify the GPC file sys path to point to your server. You say basically, yeah, the group policy template is on my machine. You implement an SMB server on your machine that serves malicious, uh, group policy template files, for instance, uh, defining a schedule task that you want to run on the victim. And now you just wait for the objects to try to apply the GPO, realize that the, the configuration files are on your system, and fetch it, fetch the files on your system. And it will work. So we created a tool that is already available, that is called GPODT, and that does just that. Um, I won't, I also won't go into details, but there was a main implementation challenge was to implement a working domain joined SMB server, because you can't just, uh, provide anonymous access to the object, so we refuse, modern, uh, Windows SMB clients will refuse to actually connect anonymously to, to a server. So, GPODT performs a net logon to overcome this, uh, this difficulty. Alright, time for another demo. Uh, with the GPODT tool. Alright. So, we have a domain , uh, we have the domain controllers, organizational units, with a GPO that applies to it , which is the DC corp hardening, uh, group policy objects, which is a standard group policy object, you have the GUID here. But what is interesting is that the ADOV user has some rights over this GPO. And, let's say that we relate the ADOV user to the LDAP service, we can see here, I've spinned off my NTM memory leaks, and I relate this user to the LDAP service. And I am interacting with the LDAP service as an ADOV user. Pretty standard. Um, so, I spin off the impact, uh, LDAP shell in order to execute LDAP commands, uh, as an ADOV user. Um, to be a little bit more comfortable, I will create a machine account, uh, with this LDAP shell that is called GPODT, and I will give all the rights over the group policy container for this machine account with the LDAP shell. So now I miss situation that I described earlier, that is to say the GPODT account has privileges over the group policy container, but nothing over the group policy templates. And we'll try to exploit this. We'll try to exploit this to add a local admin to the domain controller, and most specifically we will add the GPODT machine account that we created to the local admin group of the domain controller. We can see first that our GPODT account is not yet part of the domain, of the local admin group of the domain controller, within the same big client commands. You can see here I tried to connect to the CDOR share with GPODT. I got an access denied. This is quite expected. Now let's exploit, uh, let's exploit this situation with GPODT. So the command will look something like this. You specify the GUID of the GPO you want to exploit. You specify the user name and password of the user that has rights over the group, the group policy container. You specify the command that we want to execute. Here I want to add my GPODT computer account to the local admin group of the domain controller. And then you just press enter. The policy, uh, GPODT will do some, a lot of things, but the most important thing is that it will modify the GPC5 attributes to, uh, my, uh, my attacker machine, as you can see here. And now I just have to wait for the domain controller to update, update, uh, their GPOs and fetch the GPT files on my machine. And you can see on the right, I just, uh, execute GP updates and as soon as I execute GP updates, I have the domain controller trying to authenticate to me to fetch the GPT files, right? And I authenticate it with NetLogon and I provide, uh, the malicious, uh, GPT files to the domain controller and it will execute my immediate task that adds my GPODT machine accounts to the local admin group of the domain controller. As you can see, uh, then now I can SMB clients, uh, into the C, C dollar share of the domain controller. So yeah, I am local admin of the domain controller, which is, uh, good news. Thanks. Alright, last, last part. We'll dig even deeper, uh, and it will be the last, uh, organizational units, uh, by poisoning the GPO link attributes. A little bit, uh, a little bit of context, uh, we should explain to you that GPOs are linked right to organizational units through the GP link attributes. That looks something like, uh, what I put on the slide. Um, and when you have right access to an organizational unit, uh, Petros Petroupis showed a few years back that it is possible to add a GP link item in order to, um, simulate a many, a GPO that, uh, objects of the organizational units would try to apply. And why is it interesting? It is interesting in comparison with, uh, other organizational units at that vector that we previously have. So previously we only had one attack vector that was targeting organizational units that relied on ACL inheritance. And what you, what you did was basically to add a generic call, for instance, ACL to the organizational unit container, and it was by default inherited to, by all the objects of the OU, which was quite neat and simple and also reliable. But, uh, this attack vector had some pretty heavy limitations. It necessitated, uh, some high privileges, so write the ACL, and most importantly, it could not be used against what we call in active directory protected objects that has the admin counts equal to one and that attributes, because for these objects, ACL inheritance from the parent container is disabled. So GP link poisoning is pretty interesting because it can be exploited with very limited privileges over the organizational units. You only need to be able to write the GP link attributes, and it also works for privileged objects such as domain admins, right? So how does it work? What, what is, uh, precisely this attack? So what you do is that you modify the GP link attributes in order, as I said, to inject an additional GPO link to the OU. And as you can see here, uh, your injected item will not point to the domain, but to a domain name that resolves to your machine. Here, I added a GP link item that points to attacker.cop.com instead of cop.com. And when the objects are fetching the GPOs they should apply, because they are linked to their OUs, they will try to, to apply this GPO, and then the attacker should only simulate a group PC container, a simulator group PC template, and just execute malicious configurations through this, uh, injected GPO. So we created a tool that we called Unet, uh, to automate the attack. It is available on GitHub. We also added two edges to Bloodhound, so the right GP link, and then the right, uh, edges on organizational units, because they are exploitable through the, through the, um, attack vector I just described. All right, if I, let's just, uh, uh, describe it more visually. So first, you have a user that can modify, that can write the GP link of an OU, right, first step. Then you poison the GP link, you add an, an item to the GP link. Third, you, objects will try to fetch their group PC container on your machine, you simulate a group PC container. And finally, fourth, uh, the, the objects will also try to fetch the group PC template on your machine, you simulate a group PC template, and they apply your malicious configurations. All right, let's, uh, let's have the last demonstration of the session with the UNET tool. All right. So, we have a, we have a domain here. All right, does it work? Uh, I mean, it's weird. All right, just a second. Okay, so we have our domain, we have the PKI service, our UNET, that contains a, um, computer that is called 8001 PKI. So we'll try to, so on this PKI service, our UNET, we have a user that we dubbed N. Augustine, that will have some limited rights. Uh, she will only have the rights that is called managed GP link, which, uh, allows her to, as you can see here, manage group policy links on this OU. And so, we'll assume that we compromise the N. Augustine user, and we'll try to abuse this privilege, uh, she have, she has, sorry, on the, on the OU of PKI service. All right. So, we'll try to exploit it, in order to add the N. Augustine user to the local admin group of, um, of, uh, PKI, of the PKI server, 8001 PKI. So you can see here first, uh, the, uh, the PKI service OU only have one, has one GP link, uh, legitimate GPO. All right. And the N. Augustine user is not, uh, local admin of, uh, the 8001 PKI, uh, computer. As you can see here, access denied. All right. So, let's exploit, uh, this privilege with UNET. UNET takes, uh, config.ini file, that specifies some, some configurations. Uh, there are a bunch of them, but, uh, most importantly, you specify the target Augustine units. You specify the user that has the right to modify the GP link attributes, and you specify the command you want to run on child objects. As you can see here, I'm adding the N. Augustine user to the, um, to the local admin group of, uh, my targets. There are a bunch of other configurations that doesn't matter. Uh, we are spinning off a fake DC in order to simulate a good PC container, uh, but I won't go into details here. All right. So, let's execute, uh, UNET with this configuration. And you can see that there are a bunch of things that UNET does. Uh, it sets up fast forwarding to, to simulate a GPC. It doesn't matter. The most important thing is that it adds a GP link attributes into the Augustine units. As you can see here, if I do some LDIP, I have another, um, GP link that was added here that points to UNET.com.com, right? And UNET.com.com points to my machine. And so, what happens is what I described earlier. The objects will try to fetch, to apply the GPO by thinking that I am the LDAP server and I will simulate a good PC container. So, on the right, on the ID01 PKI server, I will just execute the GP update commands. And as soon as I do that, you can see on the left, on the UNET side, that I will have a communication from the ID01 PKI server that tries to authenticate to me. First, to fetch the GPC, so the LDAP parts, and I will answer to, to the computer. And then for the GPT, the good PC templates, and I will again authenticate it and respond with the, the appropriate files. And finally, we can see that the attack works because the end-of-use end-user is now local admin of the ID01 PKI computer. As you can see, I'm connecting to the C-dollar share and I am local admin of this computer. So we have used this GP link write permission. Thanks. All right, just a few words to conclude. So, we are, we believe that risk associated with GPUs are pretty much underestimated today. GPUs are very powerful just for enumeration, as Wilfried showed you, but also for exploitation primitives. There are a lot of exploitation primitives on GPUs, but also on the organizational units. And of course, we aim to, to, to provide a better understanding of how GPUs work, how you can enumerate stuff from them, how you can exploit objects from them, and GPUs are just, just fun and don't, don't hesitate to, to research on it. Thank you.